# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
744553 | 2023-05-18T18:01:24 Z | Andrei | Red-blue table (IZhO19_stones) | C++17 | 26 ms | 1312 KB |
#include <bits/stdc++.h> using namespace std; /** clin[i] ccol[j] a + b n + m n,m sunt impare n + (m-1)/2 n = m lin,col +-+ +-+ +++ ++- ++- ++- */ int t; int n,m; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin>>t; while(t--) { cin>>n>>m; int maxim=0; int anslin; int anscol; for(int i=1; i<=n; i++) { for(int j=1; j<=m; j++) { int aux=0; if(j>m-j) aux+=i; aux+=m-j; if(i<n-i) aux+=j; if(aux>maxim) { maxim=aux; anslin=i; anscol=j; } } } if(maxim<m) { maxim=m; anslin=0; anscol=0; } cout<<maxim<<"\n"; for(int i=1; i<=n; i++) { for(int j=1; j<=m; j++) { if(i<=anslin && j<=anscol) cout<<"+"; else cout<<"-"; } cout<<"\n"; } } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 340 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 2 ms | 340 KB | Output is correct |
4 | Incorrect | 2 ms | 340 KB | Wrong answer in test 5 29: 31 < 32 |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 26 ms | 1312 KB | Wrong answer in test 97 21: 107 < 116 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 23 ms | 1244 KB | Wrong answer in test 24 24: 35 < 44 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 2 ms | 340 KB | Output is correct |
4 | Incorrect | 2 ms | 340 KB | Wrong answer in test 5 29: 31 < 32 |
5 | Halted | 0 ms | 0 KB | - |