Submission #344047

# Submission time Handle Problem Language Result Execution time Memory
344047 2021-01-05T05:04:43 Z Nurlykhan Red-blue table (IZhO19_stones) C++17
0 / 100
45 ms 1388 KB
#include <bits/stdc++.h>

using namespace std;

int t;
int n, m;

void solve() {
    // n and m odd
    printf("%d\n", n + m / 2);
    for (int i = 0; i < n - 1; i++) {
        for (int j = 0; j < m; j++) {
            if (i % 2 == 0 && j % 2 == 0)
                printf("+");
            if (i % 2 == 0 && j % 2)
                printf("-");
            if (i % 2 && j % 2 == 0)
                printf("-");
            if (i % 2 && j % 2)
                printf("+");
        }
        printf("\n");
    }
    for (int j = 0; j < m; j++) {
        if (j % 2 == 0)
            printf("-");
        if (j % 2)
            printf("+");
    }
    printf("\n");
}

int main() {
    scanf("%d", &t);
    while (t--) {
        scanf("%d%d", &n, &m);
        solve();
    }

    return 0;
}

Compilation message

stones.cpp: In function 'int main()':
stones.cpp:34:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   34 |     scanf("%d", &t);
      |     ~~~~~^~~~~~~~~~
stones.cpp:36:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   36 |         scanf("%d%d", &n, &m);
      |         ~~~~~^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong answer in test 1 3: 2 < 3
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 364 KB in the table A+B is not equal to 25
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong answer in test 1 3: 2 < 3
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 43 ms 1388 KB in the table A+B is not equal to 107
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 45 ms 1388 KB in the table A+B is not equal to 36
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong answer in test 1 3: 2 < 3
2 Halted 0 ms 0 KB -