[2016-03-04][UVA][1605][Building for UN]

[2016-03-04][UVA][1605][Building for UN]
  • 时间:2016-03-04 20:24:38 星期五
  • 题目编号:UVA 1605
  • 题目大意:给定n个国家,加你建设联合国大楼,大楼每个格子为一个office,要求每个国家的office都互相相邻,输出所有可能
  • 输入:若干个n
  • 输出:建设大楼的h w l层数行数列数
  • 方法:建成n*n的国家,第i个国家,分配第一层的i行和第二层的j列给它

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
using namespace std;
typedef long long LL;
#define CLR(x,y) memset((x),(y),sizeof((x)))
#define FOR(x,y,z) for(int (x)=(y);(x)<(z);++(x))
#define FORD(x,y,z) for(int (x)=(y);(x)>=(z);--(x))
#define FOR2(x,y,z) for((x)=(y);(x)<(z);++(x))
#define FORD2(x,y,z) for((x)=(y);(x)>=(z);--(x))


const int maxn = 51;
char res[2][maxn][maxn];
int main(){
        //freopen("in.txt","r",stdin);
        //freopen("out.txt","w",stdout);
    int n;
        bool flg = 0;
    while(~scanf("%d",&n)){
                if(flg) puts("");
                CLR(res,0);
        FOR(i,0,n){
            FOR(j,0,n){
                res[0][i][j] = i + (i >=26?'a'-26:'A');
                res[1][i][j] = j + (j >=26?'a'-26:'A');
            }
        }
                printf("%d %d %d\n",2,n,n);
                FOR(k,0,2){
                        FOR(i,0,n){
                                puts(res[k][i]);
                        }
                        puts("");
                }
                flg = 1;
    }
    return 0;
}  







来自为知笔记(Wiz)


posted on 2016-03-04 21:13  红洋  阅读(150)  评论(0)    收藏  举报

导航