Submission #868056

# Submission time Handle Problem Language Result Execution time Memory
868056 2023-10-30T10:27:16 Z alexdd Red-blue table (IZhO19_stones) C++17
27 / 100
18 ms 1372 KB
#include<bits/stdc++.h>
using namespace std;
int n,m;
signed main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);
    int t;
    cin>>t;
    while(t--)
    {
        cin>>n>>m;
        if(m+(n-1)/2 > n+(m-1)/2)
        {
            cout<<m+(n-1)/2<<"\n";
            for(int i=1;i<=n;i++)
            {
                for(int j=1;j<=m;j++)
                {
                    if(i<=n-(n-1)/2)
                        cout<<'-';
                    else
                        cout<<'+';
                }
                cout<<"\n";
            }
        }
        else
        {
            cout<<n+(m-1)/2<<"\n";
            for(int i=1;i<=n;i++)
            {
                for(int j=1;j<=m;j++)
                {
                    if(j<=m-(m-1)/2)
                        cout<<'+';
                    else
                        cout<<'-';
                }
                cout<<"\n";
            }
        }
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Incorrect 2 ms 348 KB Wrong answer in test 5 29: 31 < 32
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 18 ms 1372 KB Wrong answer in test 97 21: 107 < 116
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 17 ms 1368 KB Wrong answer in test 24 24: 35 < 44
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Incorrect 2 ms 348 KB Wrong answer in test 5 29: 31 < 32
5 Halted 0 ms 0 KB -