# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
498545 | 2021-12-25T12:27:43 Z | The_Samurai | Red-blue table (IZhO19_stones) | C++ | 31 ms | 1332 KB |
#include <bits/stdc++.h> using namespace std; void solve() { int n, m, ans, x = 1; cin >> n >> m; if (n == 1) { cout << m << '\n'; for (int i = 0; i < m; i++) { cout << '-'; } cout << '\n'; return; } if (n == 2) { if (m == 1) { cout << "2\n"; cout << "+\n+\n"; return; } cout << m << '\n'; for (int i = 0; i < m; i++) { cout << '-'; } cout << '\n'; for (int i = 0; i < m; i++) { cout << '-'; } cout << '\n'; return; } if (n == 3) { if (m == 1) { cout << "3\n"; cout << "+\n+\n+\n"; return; } cout << m + 1 << '\n'; for (int i = 0; i < 2; i++) { for (int j = 0; j < m; j++) { cout << '-'; } cout << '\n'; } for (int i = 0; i < m; i++) { cout << '+'; } cout << '\n'; return; } // if (n == 4) { // cout << m + 1 << '\n'; // for (int i = 0; i < 3; i++) { // for (int j = 0; j < m; j++) { // cout << '-'; // } // cout << '\n'; // } // for (int i = 0; i < m; i++) { // cout << '+'; // } // cout << '\n'; // return; // } if (m <= 2) { cout << n << '\n'; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cout << '+'; } cout << '\n'; } return; } if (m == 3) { cout << n + 1 << '\n'; for (int i = 0; i < n; i++) { cout << "++-\n"; } cout << '\n'; return; } // if (m == 4) { // cout << n + 1 << '\n'; // for (int i = 0; i < n; i++) { // cout << "+++-\n"; // } // } if (n == m) { int x = 0; if (n % 2 == 0) { x = 1; } cout << n + 1 + n % 2 + x << '\n'; for (int i = 0; i < n; i++) { for (int j = 0; j < m / 2 + m % 2 + x; j++) { cout << '+'; } for (int j = m / 2 + m % 2 + x; j < m; j++) { cout << '-'; } cout << '\n'; } } } int main() { int t; cin >> t; while (t--) { solve(); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Incorrect | 0 ms | 204 KB | in the table A+B is not equal to 6 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Incorrect | 0 ms | 204 KB | in the table A+B is not equal to 6 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | Wrong answer |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 31 ms | 1332 KB | in the table A+B is not equal to 26 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Incorrect | 0 ms | 204 KB | in the table A+B is not equal to 6 |