답안 #61644

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
61644 2018-07-26T08:47:10 Z win11905 Baza (COCI17_baza) C++11
컴파일 오류
0 ms 0 KB
const int N = 1e3+5;

int n, m, q, ret[N], A[N][N];

int main() {
    scanf("%d %d", &n, &m);
    for(int i = 1; i <= n; ++i) for(int j = 1; j <= m; ++j) scanf("%d", A[i]+j);
    scanf("%d", &q);
    for(int i = 0; i < q; ++i) {
        for(int j = 1; j <= m; ++j) scanf("%d", ret+j);
        int sum = 0;
        for(int i = 1; i <= n; ++i) {
            bool st = true;
            for(int j = 1; j <= m; ++j) {
                if(ret[j] == -1) continue;
                if(A[i][j] != ret[j]) st = false;
            }
            sum += st;
        }
        printf("%d\n", sum);
    } 
}

Compilation message

baza.cpp: In function 'int main()':
baza.cpp:7:5: error: 'scanf' was not declared in this scope
     scanf("%d %d", &n, &m);
     ^~~~~
baza.cpp:21:9: error: 'printf' was not declared in this scope
         printf("%d\n", sum);
         ^~~~~~
baza.cpp:21:9: note: suggested alternative: 'int'
         printf("%d\n", sum);
         ^~~~~~
         int