Submission #207728

#TimeUsernameProblemLanguageResultExecution timeMemory
207728DodgeBallManBaza (COCI17_baza)C++14
50 / 50
180 ms9208 KiB
#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 (stderr)

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 timeMemoryGrader output
Fetching results...