题意:一个联合国大楼每层都有数量相等大小相同的格子,将其分配给n个国家,使任意两个不同的国家都相邻(同层有公共边或相邻层的同一个格子)。

分析:可以设计一个只有两层的大楼,第一层每个国家占一行,第二层每个国家占一列,即每层都是n*n的。

#pragma comment(linker, "/STACK:102400000, 102400000")
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<iostream>
#include<sstream>
#include<iterator>
#include<algorithm>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<deque>
#include<queue>
#include<list>
#define Min(a, b) ((a < b) ? a : b)
#define Max(a, b) ((a < b) ? b : a)
typedef long long ll;
typedef unsigned long long llu;
const int INT_INF = 0x3f3f3f3f;
const int INT_M_INF = 0x7f7f7f7f;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
const ll LL_M_INF = 0x7f7f7f7f7f7f7f7f;
const int dr[] = {, , -, , -, -, , };
const int dc[] = {-, , , , -, , -, };
const int MOD = 1e9 + ;
const double pi = acos(-1.0);
const double eps = 1e-;
const int MAXN = + ;
const int MAXT = + ;
using namespace std;
map<int, char> mp;
void init(){
string s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
for(int i = ; i < ; ++i){
mp[i] = s[i];
}
}
int main(){
int n;
init();
bool flag = true;
while(scanf("%d", &n) == ){
if(flag) flag = false;
else printf("\n");
printf("2 %d %d\n", n, n);
for(int i = ; i < n; ++i){
for(int j = ; j < n; ++j){
printf("%c", mp[i]);
}
printf("\n");
}
printf("\n");
for(int i = ; i < n; ++i){
for(int j = ; j < n; ++j){
printf("%c", mp[j]);
}
printf("\n");
}
}
return ;
}

最新文章

  1. WPF 无边框透明按钮
  2. 关于C语言的一些trick
  3. iOS中编写单例类的心得
  4. yaf框架使用(centos6.5)
  5. WebApp 里Meta标签大全,webappmeta标签大全
  6. android怎么连接sqlite数据库?
  7. java的nio之:java的nio系列教程之Scatter/Gather
  8. 什么是struts2?
  9. Maven学习:常用mvn命令
  10. 迷宫城堡--HDOJ 1269(Tarjan)
  11. Java编程-第一个Java程序
  12. 编写可维护的JS 06
  13. 感觉Release有时比Debug要健壮
  14. ACE工具概述
  15. DuelJS 介绍
  16. Java中JDK和JRE的区别是什么?它们的作用分别是什么?
  17. Java动态代理机制研读
  18. ubuntu 安装 mkfs.ubifs
  19. linux系统编程之进程(六):父进程查询子进程的退出,wait,waitpid
  20. Python3 循环语句

热门文章

  1. PAT B1019/A1069 数字黑洞
  2. centos7 bond双网卡
  3. JavaScript--选择器
  4. JDBC--获取数据库连接
  5. 104、Java中String类之使用indexOf()等功能查找
  6. gitlab导入备份数据
  7. I2S 总线学习:2-I2S驱动WM8978
  8. msf生成软件
  9. 小程序真机上报错 for developer: some selectors are not allowed in component wxss , including tag name selectors, id selectors, and attribute selectors
  10. nuxt.js 初始化 npm run dev 报错