Submission #147735

# Submission time Handle Problem Language Result Execution time Memory
147735 2019-08-30T14:02:32 Z leatherman Red-blue table (IZhO19_stones) C++14
0 / 100
30 ms 1524 KB
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

#pragma GCC optimize("-O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")

#define ll long long
#define ld long double
#define endl "\n"
#define fi first
#define se second
#define y1 sadjfskldf
#define PB push_back
#define sqr(x) ((x) * (x))
#define all(x) x.begin(), x.end()
using namespace std;
using namespace __gnu_pbds;
mt19937_64 rnd(chrono::system_clock::now().time_since_epoch().count());

const ll N = 1005;

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
ll Q,n,m;
int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin>>Q;
    while(Q--)
    {
        cin>>n>>m;
        if(n / 2 + 1 >= m / 2 + 1)
        {
            cout<<n / 2 + 1 + m - (n / 2 + 1)<<endl;
            for(int i = 1; i <= n; i++)
            {
                for(int j = 1; j <= m; j++)
                {
                    if(j <= m / 2 + 1) cout<<'+';
                    else cout<<'-';
                }
                cout<<endl;
            }
        } else
        {
            cout<< m / 2 + 1 + n - (m / 2 + 1)<<endl;
            for(int i = 1; i <= n; i++)
            {
                for(int j = 1; j <= m; j++)
                {
                    if(i <= n / 2 + 1) cout<<'-';
                    else cout<<'+';
                }
                cout<<endl;
            }
        }
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB in the table A+B is not equal to 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB in the table A+B is not equal to 3
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB in the table A+B is not equal to 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 30 ms 1400 KB in the table A+B is not equal to 21
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 29 ms 1524 KB in the table A+B is not equal to 24
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB in the table A+B is not equal to 1
2 Halted 0 ms 0 KB -