Submission #61645

# Submission time Handle Problem Language Result Execution time Memory
61645 2018-07-26T08:47:56 Z win11905 Baza (COCI17_baza) C++11
50 / 50
251 ms 30244 KB
#include <bits/stdc++.h>
using namespace std;

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:9:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d", &n, &m);
     ~~~~~^~~~~~~~~~~~~~~~~
baza.cpp:10:66: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for(int i = 1; i <= n; ++i) for(int j = 1; j <= m; ++j) scanf("%d", A[i]+j);
                                                             ~~~~~^~~~~~~~~~~~~~
baza.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &q);
     ~~~~~^~~~~~~~~~
baza.cpp:13:42: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         for(int j = 1; j <= m; ++j) scanf("%d", ret+j);
                                     ~~~~~^~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 60 ms 2808 KB Output is correct
2 Correct 48 ms 4248 KB Output is correct
3 Correct 125 ms 9792 KB Output is correct
4 Correct 28 ms 9792 KB Output is correct
5 Correct 92 ms 10944 KB Output is correct
6 Correct 142 ms 15756 KB Output is correct
7 Correct 248 ms 21764 KB Output is correct
8 Correct 127 ms 23124 KB Output is correct
9 Correct 105 ms 26076 KB Output is correct
10 Correct 251 ms 30244 KB Output is correct