Submission #919551

# Submission time Handle Problem Language Result Execution time Memory
919551 2024-02-01T06:17:02 Z manizare Red-blue table (IZhO19_stones) C++14
0 / 100
19 ms 1368 KB
#include <bits/stdc++.h>
#pragma GCC optimize ("O3,unroll-loops")
#pragma GCC target("avx2") 
#define pb push_back
#define F first
#define S second 
#define all(a) a.begin(),a.end()
#define pii pair <int,int>
#define PII pair<pii , pii>
#define int long long 
#define sz(v) (int)v.size()
#define rep(i , a , b) for(int i=a;i <= (b);i++)
#define per(i , a , b) for(int i=a;i >= (b);i--)
#define deb(x) cout <<#x << " : " << x << "\n" ; 
using namespace std ;   
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int maxn = 2e5 + 10 , maxm = 1e6+10 , lg = 18 , inf= 1e18 , mod = 998244353 ;

signed main(){
	ios_base::sync_with_stdio(false);cin.tie(0);
    int t ;
    cin >>  t;
    while(t--){
        int n , m ;
        cin >> n >> m ;
        if(n+(m-1)/2 >= m+(n-1)/2){
            cout << n+(m-1)/2 << "\n"; 
            rep(i , 1, n){
                rep(j ,1 , m){
                    if(j%2==1 || j == m){
                        cout << "+" ;
                    }else {
                        cout << "-" ; 
                    }
                }
                cout << "\n"; 
            }
        }else{
            cout << m+(n-1)/2 << "\n"; 
            rep(i , 1 ,n){
                rep(j , 1, m){
                    if(i%2==1 || i == n){
                        cout << "+" ;;
                    }else{
                        cout << "-" ;
                    }
                }
                cout << "\n"; 
            }
        }
    }
}
/*
    
*/
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB in the table A+B is not equal to 3
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB in the table A+B is not equal to 46
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB in the table A+B is not equal to 3
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 19 ms 1360 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 Incorrect 1 ms 344 KB in the table A+B is not equal to 3
2 Halted 0 ms 0 KB -