惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

K
Kaspersky official blog
Martin Fowler
Martin Fowler
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
V
Visual Studio Blog
博客园_首页
Engineering at Meta
Engineering at Meta
The Cloudflare Blog
MongoDB | Blog
MongoDB | Blog
Blog — PlanetScale
Blog — PlanetScale
T
The Blog of Author Tim Ferriss
雷峰网
雷峰网
D
Docker
博客园 - 司徒正美
S
SegmentFault 最新的问题
M
MIT News - Artificial intelligence
博客园 - 叶小钗
博客园 - 三生石上(FineUI控件)
U
Unit 42
J
Java Code Geeks
A
About on SuperTechFans
N
Netflix TechBlog - Medium
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
S
Security Affairs
I
Intezer
Cisco Talos Blog
Cisco Talos Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
B
Blog RSS Feed
P
Privacy & Cybersecurity Law Blog
T
Tenable Blog
T
Threatpost
H
Hacker News: Front Page
G
Google Developers Blog
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
Apple Machine Learning Research
Apple Machine Learning Research
L
Lohrmann on Cybersecurity
大猫的无限游戏
大猫的无限游戏
Google DeepMind News
Google DeepMind News
A
Arctic Wolf
S
Secure Thoughts
GbyAI
GbyAI
NISL@THU
NISL@THU
S
Security @ Cisco Blogs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Webroot Blog
Webroot Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
O
OpenAI News
Spread Privacy
Spread Privacy
Application and Cybersecurity Blog
Application and Cybersecurity Blog

博客园 - xmx

Amazon 2面杯具 N皇后回溯 "中航文化杯" 2007 ACM/ICPC 国际大学生程序设计竞赛亚洲区域赛(南京) 一个用来练dfs的简单迷宫问题 pku 1662 还是找规律的 今天西华的比赛,啥都不说啦,相当的nice!~~~ 今天北京赛区的比赛 pku 1505 copying books(DP) 最近看的一些东西 The 2007 ACM Asia Programming Contest Changchun Site Internet Preliminary Contest nice 位运算果真是好东西,今天算是学到点啦^_^ FOJ月赛-2007年9月 pku 1850 前面一直没注意到某个不规范的情况,导致结果一直比标准的大...调了好久... 终于有算最长重复子串(数)的后缀数组啦,nice The 2007 ACM Asia Programming Contest - Nanjing Preliminary pku 3219 人家居然用几十B就过了,肯定有超强的规律,可是我自己找了个,挂了...只能老实算... 一道双向dp,差点超时^_^||| dp pku 1050 N和素数P,求杨辉三角第N行中能被P整除的数的个数
pku 1806 Manhattan 2025(找规律)
xmx · 2007-10-15 · via 博客园 - xmx

#include <stdio.h>
#include <string.h>

char  ss[1000][1000];
void pp1(int a , int b , int c)   //a 行数    b最大数   c最小数
{
     int i , j , k , p , q;    
      for(j = 1;j <= a;j++)
         for(k = 1;k <= a;k++)
               ss[j][k] = '.';
         for(i = 0;i <= b - c;i++)
         {
           for(r = 0;r <= i;r++)
           { ss[(a + 1) / 2 + r][(a + 1) / 2 - i + r]=char(c + i) + '0';//这四行代码搞死我了,起先一直在脑子勾画,可
             ss[(a + 1) / 2 - i + r][(a + 1) / 2 - r]=char(c + i) + '0'; //就是wa,在wa了大概5次以后,没办法,只好在
             ss[(a + 1) / 2 - i + r][(a + 1) / 2 + r]=char(c + i) + '0';//纸上画,结果一画就出来了,看来还是形象话的
             ss[(a + 1) / 2 + r][(a + 1) / 2 + i - r]=char(c + i) + '0';//东西更容易思考啊^_^
           }
          // printf("***\n");
         }
//         //printf("*********************\n");
////         for(p=1;p<=(a-1)/2;p++)
////                     { for(q=1;q<=(a-1)/2;q++)
////                         printf("%c",ss[p][q]);
////                    
////                         printf("\n"); 
////                     } 
////                     printf("\n");
//}
void pp2( int a )
{
     int i , j , k;
         for(j = 1;j <= a;j++)
            for(k = 1;k <= a;k++)
               ss[j][k]='.';
}

int main()
{
    int n,m,i,s,j,p,q;
    while(scanf("%d",&n)==1)
    {
        for(i = 0;i < n;i++)
           {
             scanf("%d",&m);
             printf("Scenario #%d:\n",i+1);
             if(m <= 9)
            { for (j = 1;j <= m * 2 + 1;j++)
                {
                  if(j > m + 1) s = j - m - 1;
                  else s = m - j + 1;
                    pp1(2 * m + 1, m , s);
                    printf("slice #%d:\n",j);
                   for(p = 1; p <= 2 * m + 1;p++)
                     { for(q = 1;q <= 2 * m + 1;q++)
                         printf("%c",ss[p][q]);            
                         printf("\n"); 
                     } 
                 }
                 printf("\n"); 
           }
          
           else
           {pp2( m * 2 + 1 );
           printf("slice #1:\n");
                   for(p = 1;p <= 2 * m + 1;p++)
                     { for(q = 1;q <= 2 * m + 1;q++)
                         printf("%c",ss[p][q]);            
                         printf("\n"); 
                     } 
                 }
                 printf("\n"); 
           }
          
    }
    return 0;
}