Submission #769743

# Submission time Handle Problem Language Result Execution time Memory
769743 2023-06-30T07:38:27 Z Trunkty Red-blue table (IZhO19_stones) C++14
0 / 100
19 ms 1464 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
 
int t;
char arr[1005][1005];
 
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> t;
    for(int e=1;e<=t;e++){
        int n,m;
        cin >> n >> m;
        if(n>=m){
            int rem = m-m/2-1, need = n-(n-n/2-1);
            for(int i=1;i<=n;i++){
                for(int j=1;j<=m;j++){
                    arr[i][j] = '+';
                }
            }
            int curr=1,cnt=0;
            for(int c=0;c<rem*n;c++){
                if(cnt==need){
                    cnt = 0;
                    curr++;
                }
                arr[c%n+1][curr] = '-';
                cnt++;
            }
        }
        else{
            int rem = n-n/2-1, need = m-(m-m/2-1);
            for(int i=1;i<=n;i++){
                for(int j=1;j<=m;j++){
                    arr[i][j] = '-';
                }
            }
            int curr=1,cnt=0;
            for(int c=0;c<rem*m;c++){
                if(cnt==need){
                    cnt = 0;
                    curr++;
                }
                arr[curr][c%m+1] = '-';
                cnt++;
            }
        }
        for(int i=1;i<=n;i++){
            for(int j=1;j<=m;j++){
                cout << arr[i][j];
            }
            cout << "\n";
        }
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Expected integer, but "---" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB Expected integer, but "---------------------------------------------" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Expected integer, but "---" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 19 ms 1364 KB Expected integer, but "--+-+-+-+-+-+-+-+-+++" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 19 ms 1464 KB Expected integer, but "--+-+-+-+-+--+-+-+-+++++" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Expected integer, but "---" found
2 Halted 0 ms 0 KB -