Submission #79956

#TimeUsernameProblemLanguageResultExecution timeMemory
79956pzdbaBaza (COCI17_baza)C++14
50 / 50
155 ms30408 KiB
#include <bits/stdc++.h> using namespace std; int a[1005][1005]; int b[1005]; int main(){ int n, m; scanf("%d%d", &n, &m); for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++) scanf("%d", &a[i][j]); } int q; scanf("%d", &q); for(int i=1;i<=q;i++){ for(int j=1;j<=m;j++) scanf("%d", &b[j]); int ans = 0; for(int i=1;i<=n;i++){ bool ok = 1; for(int j=1;j<=m;j++){ if(b[j] == a[i][j] || b[j] == -1) continue; ok = 0; } ans += ok; } printf("%d\n", ans); } }

Compilation message (stderr)

baza.cpp: In function 'int main()':
baza.cpp:7:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d", &n, &m);
  ~~~~~^~~~~~~~~~~~~~~~
baza.cpp:9:30: 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", &a[i][j]);
                         ~~~~~^~~~~~~~~~~~~~~~
baza.cpp:12:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &q);
  ~~~~~^~~~~~~~~~
baza.cpp:14:30: 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", &b[j]);
                         ~~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...