# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
201866 | guangxuan | Red-blue table (IZhO19_stones) | C++14 | 40 ms | 1436 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main(){
int T;
scanf("%d",&T);
while(T--){
int n,m;
scanf("%d%d",&n,&m);
int ans1 = n + (m-1)/2, ans2 = m + (n-1)/2;
printf("%d\n",max(ans1,ans2));
if(ans1>ans2){
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
if(j<(m-1)/2)printf("-");
else printf("+");
}
puts("");
}
}
else{
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
if(i<(n-1)/2)printf("+");
else printf("-");
}
puts("");
}
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |