Submission #1231064

#TimeUsernameProblemLanguageResultExecution timeMemory
1231064hitsuujRed-blue table (IZhO19_stones)C++20
0 / 100
52 ms2120 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define pii pair<int,int>
#define fi first
#define se second
#define inf LLONG_MAX
#define ti tuple<int,int,int>
signed main(){
    int t;cin>>t;while(t--){
        int n,m;cin>>n>>m;
        int grid[n+10][m+10];
        memset(grid,0,sizeof(grid));
        int mew[n+10][m+10];
        memset(mew,0,sizeof(mew));
        //all red
        int ans=n,ans2=m;
        for(int j=1;j<(m+1)/2;j++){
            for(int i=1;i<=n;i++){
                grid[i][j]=1;
            }
            ans++;
        }
        //all blue 
        for(int i=1;i<(n+1)/2;i++){
            for(int j=1;j<=m;j++){
                mew[i][j]=1;
            }
            m++;
        }
        if(ans>ans2){
            for(int i=1;i<=n;i++){
                for(int j=1;j<=m;j++){
                    if(grid[i][j]) cout<<'-';
                    else cout<<'+';
                }
                cout<<endl;
            }
            cout<<endl;
        }
        else{
            for(int i=1;i<=n;i++){
                for(int j=1;j<=m;j++){
                    if(!mew[i][j]) cout<<'-';
                    else cout<<'+';
                }
                cout<<endl;
            }
            cout<<endl;
        }
    }
}

// Row red>blue 
// Col red<blue 
// val less than half 
// val more than half 

// +--+
// +--+
// ++++

// -++
// ---
// ---
// ---


// +++-
// ----
// ----

// +-++
// +-++


// ++
// ++
// ++
// ++



// +++
// +++
// +++
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...