# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
340683 | 2020-12-28T07:26:00 Z | David_M | Red-blue table (IZhO19_stones) | C++14 | 4 ms | 1388 KB |
#include <bits/stdc++.h> #define ll long long #define pb push_back #define F first #define S second using namespace std; const ll N=1000006; int n, m, q; string x, y; int main(){ios_base::sync_with_stdio(false), cin.tie(0); cin>>q; while(q--){x=""; cin>>n>>m;if(n%2==0||m%2==0){cout<<1/0;return 0;} if(n==1){cout<<m<<endl;while(m--)cout<<'-';cout<<'\n';continue;} if(m==1){cout<<n<<endl;while(n--)cout<<"+\n";continue;} cout<<n+m-2<<'\n'; for (int i=1; i<=m/2; i++)x+='-'; for (int i=1; i<=m/2+1; i++)x+='+'; for (int i=1; i<=n/2; i++)cout<<x<<'\n'; for (int i=0; i<m-1; i++)x[i]='-'; x[m-1]='+'; cout<<x<<'\n'; x=""; for (int i=1; i<=m/2; i++)x+='+'; for (int i=1; i<=m/2; i++)x+='-'; x+='+'; for (int i=1; i<=n/2; i++)cout<<x<<'\n'; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 384 KB | Output is correct |
2 | Runtime error | 1 ms | 492 KB | Execution killed with signal 4 (could be triggered by violating memory limits) |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 492 KB | Execution killed with signal 4 (could be triggered by violating memory limits) |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 384 KB | Output is correct |
2 | Runtime error | 1 ms | 492 KB | Execution killed with signal 4 (could be triggered by violating memory limits) |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 1388 KB | Output is correct |
2 | Correct | 2 ms | 1388 KB | Output is correct |
3 | Correct | 2 ms | 1260 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 492 KB | Execution killed with signal 4 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 384 KB | Output is correct |
2 | Runtime error | 1 ms | 492 KB | Execution killed with signal 4 (could be triggered by violating memory limits) |