Submission #284745

# Submission time Handle Problem Language Result Execution time Memory
284745 2020-08-28T01:34:59 Z dantoh000 Red-blue table (IZhO19_stones) C++14
27 / 100
45 ms 1400 KB
#include <bits/stdc++.h>
using namespace std;
int main(){
    int tc;
    scanf("%d",&tc);
    while (tc--){
        int n,m;
        scanf("%d%d",&n,&m);
        if (n > m){
            printf("%d\n",n+(m-1)/2);
            for (int i = 0; i < n; i++){
                for (int j = 0; j < m; j++){
                    if (j < (m-1)/2){
                        printf("-");
                    }
                    else printf("+");
                }
                printf("\n");
            }
        }
        else{
            printf("%d\n",(n-1)/2+m);
            for (int i = 0; i < n; i++){
                for (int j = 0; j < m; j++){
                    if (i < (n-1)/2){
                        printf("+");
                    }
                    else printf("-");
                }
                printf("\n");
            }
        }

    }

}

Compilation message

stones.cpp: In function 'int main()':
stones.cpp:5:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    5 |     scanf("%d",&tc);
      |     ~~~~~^~~~~~~~~~
stones.cpp:8:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    8 |         scanf("%d%d",&n,&m);
      |         ~~~~~^~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 256 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Incorrect 3 ms 384 KB Wrong answer in test 5 29: 31 < 32
# Verdict Execution time Memory Grader output
1 Incorrect 45 ms 1400 KB Wrong answer in test 97 21: 107 < 116
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 44 ms 1372 KB Wrong answer in test 24 24: 35 < 44
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 256 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Incorrect 3 ms 384 KB Wrong answer in test 5 29: 31 < 32