답안 #501282

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
501282 2022-01-02T18:04:00 Z DragonO_o Red-blue table (IZhO19_stones) C++14
27 / 100
21 ms 1336 KB
#include <bits/stdc++.h>

using namespace std;

#define x first
#define y second
#define pb push_back
#define all(a) a.begin(),a.end()
#define int long long

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int,int>pi;
typedef pair<ll,ll>pll;
typedef vector<ll>vll;
typedef vector<int>vi;
typedef vector<bool>vb;
typedef vector<vi>vvi;
typedef vector<vll>vvll;
typedef vector<pi>vpi;
typedef vector<pll>vpll;

const int N=1e3+99;

char a[N][N];

signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int tt;
    cin>>tt;
    while(tt--){
        int n,m;
        cin>>n>>m;
        for(int i=1;i<=n;++i){
            for(int j=1;j<=m;++j){
                a[i][j]='*';
            }
        }
        cout<<max(n,m)+(min(n,m)-1)/2<<"\n";
        if(n<=m){
            for(int i=1;i<=(n+2)/2;++i){
                for(int j=1;j<=m;++j){
                    a[i][j]='-';
                }
            }
            for(int i=1;i<=n;++i){
                for(int j=1;j<=m;++j){
                    if(a[i][j]=='-'){
                        cout<<'-';
                    }
                    else{
                        cout<<'+';
                    }
                }
                cout<<"\n";
            }
        }
        else{
            for(int i=1;i<=n;++i){
                for(int j=1;j<=(m+2)/2;++j){
                    a[i][j]='+';
                }
            }
            for(int i=1;i<=n;++i){
                for(int j=1;j<=m;++j){
                    if(a[i][j]=='+'){
                        cout<<'+';
                    }
                    else{
                        cout<<'-';
                    }
                }
                cout<<"\n";
            }
        }
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 324 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 332 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 324 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Incorrect 2 ms 320 KB Wrong answer in test 5 29: 31 < 32
# 결과 실행 시간 메모리 Grader output
1 Incorrect 21 ms 1336 KB Wrong answer in test 97 21: 107 < 116
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 20 ms 1336 KB Wrong answer in test 24 24: 35 < 44
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 324 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Incorrect 2 ms 320 KB Wrong answer in test 5 29: 31 < 32