Submission #532481

# Submission time Handle Problem Language Result Execution time Memory
532481 2022-03-03T03:00:02 Z dannyboy20031204 Red-blue table (IZhO19_stones) C++17
0 / 100
32 ms 1284 KB
#include<bits/stdc++.h>
using namespace std;
#define ll long long
void db() {cout << '\n';}
template <typename T, typename ...U> void db(T a, U ...b){
    cout << a << ' ', db(b...);
}
void solve(){
    int n, m;
    cin >> n >> m;
    if (n + (m - 1) / 2 > m + (n - 1) / 2){
        for (int i = 0; i < n; i++){
            for (int j = 0; j < m; j++){
                if (j % 2 == 0 or (m % 2 == 0 and j == m - 1)) cout << '+';
                else cout << '-';
            }
            cout << '\n';
        }
    }
    else{
        for (int i = 0; i < n; i++){
            for (int j = 0; j < m; j++){
                if (i % 2 == 0 or (n % 2 == 0 and i == n - 1)) cout << '-';
                else cout << '+';
            }
            cout << '\n';
        }
    }
}
int main(){
    ios::sync_with_stdio(0), cin.tie(0);
    int t;
    cin >> t;
    while (t--) solve();
}
# 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 1 ms 332 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 -
# Verdict Execution time Memory Grader output
1 Incorrect 25 ms 1284 KB Expected integer, but "+-+-+-+-+-+-+-+-+-+-+" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 32 ms 1180 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 -