Submission #94922

#TimeUsernameProblemLanguageResultExecution timeMemory
94922MohamedAhmed0Baza (COCI17_baza)C++14
50 / 50
97 ms7928 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n , m ; scanf("%d %d" , &n , &m); int arr[n][m] , arr2[m]; for(int i = 0 ; i < n ; ++i) { for(int j = 0 ; j < m ; ++j) scanf("%d" , &arr[i][j]); } int q ; scanf("%d" , &q); while(q--) { for(int i = 0 ; i < m ; ++i) scanf("%d" , &arr2[i]); int ans = 0 ; for(int i = 0 ; i < n ; ++i) { bool t = true ; for(int j = 0 ; j < m ; ++j) { if(!t) break; if(arr[i][j] != arr2[j] && arr2[j] != -1) t = false ; } if(t) ans++; } printf("%d\n" , ans); } return 0 ; }

Compilation message (stderr)

baza.cpp: In function 'int main()':
baza.cpp:8: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:13:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d" , &arr[i][j]);
             ~~~~~^~~~~~~~~~~~~~~~~~~
baza.cpp:16:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d" , &q);
     ~~~~~^~~~~~~~~~~
baza.cpp:20:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d" , &arr2[i]);
             ~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...