Submission #499706

# Submission time Handle Problem Language Result Execution time Memory
499706 2021-12-29T09:36:58 Z SOIVIEONE Red-blue table (IZhO19_stones) C++14
0 / 100
33 ms 1432 KB
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>

#define INF 1000000021
#define pb push_back
#define sqr(a) (a)*(a)
#define M(a, b) make_pair(a,b)
#define F first
#define S second
#define all(x) (x.begin(), x.end())
#define deb(x) cerr << #x << " = " << x << '\n'
#define N 322222

using namespace std;
//using namespace __gnu_pbds;

typedef long double ld;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
const ll MOD = 1000000007ll;

ll bn(ll aa, ll n)
{
    ll r = 1ll;
    for(; n > 0; n >>= 1ll)
    {
        if(n & 1)
            r = (r * aa) % MOD;
        aa = (aa * aa) % MOD;
    }
    return r;

}

const ld pi = 2 * acos(0.0);
//template<class T, class TT> bool pal(T a, TT n){int k=0;for(int i=0;i<=n/2;i++){if(a[i]!=a[n-i-1]){k=1;break;}}return k?0:1;}

//int month[] = {0,31,28,31,30,31,30,31,31,30,31,30,31};

char a[1234][1234];
void solve()
{
    int n, m;
    cin >> n >> m;


    if(n < m)
    {
        for(int i = 1; i <= n; i ++)
            for(int j = 1; j <= m; j ++)
            {
                if(i <= n / 2 + 1)
                    a[i][j] = '+';
                else
                    a[i][j] = '-';
            }
    }
    else
    {
        for(int i = 1; i <= n; i ++)
            for(int j = 1; j <= m; j ++)
            {
                if(j <= m / 2 + 1)
                    a[i][j] = '-';
                else
                    a[i][j] = '+';
            }
    }
    for(int i = 1; i <= n; i ++, cout << '\n')
        for(int j = 1; j <= m; j ++)
            cout << a[i][j];
}


int main()
{
    int t = 1;
    cin >> t;
    while(t --)
        solve();
    return 0;

}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Expected integer, but "+++" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 332 KB Expected integer, but "+++++++++++++++++++++++++++++++++++++++++++++" found
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Expected integer, but "+++" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 33 ms 1300 KB Expected integer, but "-----------++++++++++" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 31 ms 1432 KB Expected integer, but "-------------+++++++++++" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Expected integer, but "+++" found
2 Halted 0 ms 0 KB -