http://acm.hdu.edu.cn/showproblem.php?pid=6554
好简单的题昨天为什么不去写。。。
解题思路:n*m 只能用凸去填充
如果必须填满 那只能是4n*4n啊。。。
所以 很简单了
#include<algorithm> #include<iostream> #include<vector> #include<cstdio> #include<cstring> #include<cmath> #include<string> #include<queue> #include<ctime> #include<stack> #include<map> #include<set> #include<cstring> using namespace std; typedef long long ll; int main() { int n, m; while (cin >> n >> m) { if (n % 4 != 0 || m % 4 != 0) { cout << "no response\n"; } else { string a[4] = { "1113","2133","2243","2444" }; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cout << a[i % 4][j % 4]; } cout << endl; } } } return 0; }
Comments | NOTHING