답안 #1044650

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1044650 2024-08-05T12:02:21 Z Nickpapadak Game (eJOI20_game) C++14
0 / 100
1 ms 348 KB
#include<bits/stdc++.h>
using namespace std;
const unsigned int MAXN = 2e+1 + 5;
int grid[MAXN][MAXN];
int N, M;
int cnt;
int main(){
    scanf("%d%d", &N, &M);
    char ps[M];
    scanf("%s", ps);
    for(int i = 1; i<=N; ++i){
        char s[M];
        scanf("%s", s);
        for(int j = 1; j <=M;++j)
            grid[i][j] = (ps[j-1]-'0') + (s[j-1]-'0');
        for(int j = 0; j<M;++j){
            ps[j] = s[j];
        }
    }
    for(int i = 1; i<=N; ++i){
        char s[M+1];
        scanf("%s", s);
        for(int j = 1; j<=M; ++j){
            grid[i][j] += (s[j] -'0') + (s[j-1] - '0');
            if(grid[i][j] == 4) cnt++;
        }
    }
    printf("%d", (N*M) - cnt);
    // for(int i = 1; i<=N;++i){
    //     for(int j = 1; j <=M;++j){
    //         printf("%d ", grid[i][j]);
    //     }
    //     printf("\n");
    // }
    return 0;
}

Compilation message

game.cpp: In function 'int main()':
game.cpp:8:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |     scanf("%d%d", &N, &M);
      |     ~~~~~^~~~~~~~~~~~~~~~
game.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |     scanf("%s", ps);
      |     ~~~~~^~~~~~~~~~
game.cpp:13:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |         scanf("%s", s);
      |         ~~~~~^~~~~~~~~
game.cpp:22:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   22 |         scanf("%s", s);
      |         ~~~~~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -