Submission #66353

#TimeUsernameProblemLanguageResultExecution timeMemory
66353KLPPBaza (COCI17_baza)C++14
50 / 50
144 ms32972 KiB
#include<iostream> #include<vector> #include<queue> #include<algorithm> #include<stdio.h> using namespace std; int n,m; int arr[10000][10000]; int main(){ scanf("%d %d",&n,&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--){ bool b[n]; for(int i=0;i<n;i++)b[i]=true; for(int j=0;j<m;j++){ int x; scanf("%d",&x); if(x!=-1){ for(int i=0;i<n;i++){ if(arr[i][j]!=x)b[i]=false; } } } int ans=0; for(int i=0;i<n;i++)ans+=b[i]; printf("%d\n",ans); } return 0; }

Compilation message (stderr)

baza.cpp: In function 'int main()':
baza.cpp:11: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:13:28: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   for(int j=0;j<m;j++)scanf("%d",&arr[i][j]);
                       ~~~~~^~~~~~~~~~~~~~~~~
baza.cpp:16:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&q);
  ~~~~~^~~~~~~~~
baza.cpp:22:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    scanf("%d",&x);
    ~~~~~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...