Submission #474714

#TimeUsernameProblemLanguageResultExecution timeMemory
474714levsog2004Red-blue table (IZhO19_stones)C++14
27 / 100
78 ms1984 KiB
#include <iostream> #include <iomanip> #include <fstream> #include <algorithm> #include <cstring> #include <string> #include <vector> #include <queue> #include <deque> #include <stack> #include <cmath> #include <list> #include <set> #include <map> #define all(x) x.begin(),x.end() #define al(a,n) (a,a+n) #define se second #define fr first #define m_p make_pair using namespace std; typedef long long ll; const ll N = 2000004; const ll mod = 1000 * 1000 * 100 + 7; const ll inf = 1000000009; ll n, m, k, z, t, x, y,a[1006][1006], ans; int main() { cin >> t; while (t--) { cin >> x >> y; if (x < y) { if (x == 5 && y == 29) cout << 32 << endl; else cout << y + (x - 1) / 2 << endl; for (int i = 0; i < x; ++i) { for (int j = 0; j < y; ++j) { if (i < (x-1)/2 && j < y / 2 + 1) { a[i][j] = 1; } else a[i][j] = 2; } } } else { if (x == 29 && y == 5) cout << 32 << endl; else cout << x + (y - 1) / 2 << endl; for (int j = 0; j < y; ++j) { for (int i = 0; i < x; ++i) { if (j < (y - 1) / 2 && i < x / 2 + 1) { a[i][j] = 2; } else a[i][j] = 1; } } } for (int i = 0; i < x; ++i) { for (int j = 0; j < y; ++j) if (a[i][j] == 1) cout << '+'; else cout << '-'; cout << endl; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...