Submission #370326

# Submission time Handle Problem Language Result Execution time Memory
370326 2021-02-23T19:03:57 Z nicolaalexandra Red-blue table (IZhO19_stones) C++14
27 / 100
43 ms 1516 KB
#include <bits/stdc++.h>
#define DIM 1010
using namespace std;

int t,n,m,i,j;
int a[DIM][DIM],sol[DIM][DIM];

int main (){

    //ifstream cin ("date.in");
    //ofstream cout ("date.out");

    cin>>t;
    for (;t--;){
        cin>>n>>m;

        if (n + (m-1)/2 > m + (n-1)/2){
            cout<<n + (m-1)/2<<"\n";
            for (i=1;i<=n;i++,cout<<"\n")
                for (j=1;j<=m;j++){
                    if (j <= (m+2)/2)
                        cout<<"+";
                    else cout<<"-";
                }

        } else {
            cout<<m + (n-1)/2<<"\n";
            for (i=1;i<=n;i++,cout<<"\n")
                for (j=1;j<=m;j++){
                    if (i <= (n+2)/2)
                        cout<<"-";
                    else cout<<"+";
                }
        }


    }

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 2 ms 364 KB Output is correct
4 Incorrect 4 ms 364 KB Wrong answer in test 5 29: 31 < 32
# Verdict Execution time Memory Grader output
1 Incorrect 43 ms 1388 KB Wrong answer in test 97 21: 107 < 116
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 41 ms 1516 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 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 2 ms 364 KB Output is correct
4 Incorrect 4 ms 364 KB Wrong answer in test 5 29: 31 < 32