Submission #474093

#TimeUsernameProblemLanguageResultExecution timeMemory
474093ValiAntoniePoi (IOI09_poi)C++14
55 / 100
785 ms15980 KiB
#include <bits/stdc++.h> using namespace std; int n,t,p,a[2001][2001],i,j,suma,task[2001],nr,ok,total[2001]; int main() { cin>>n>>t>>p; for(i=1;i<=n;i++){ for(j=1;j<=t;j++){ cin>>a[i][j]; } } for(i=1;i<=t;i++){ suma = 0; for(j=1;j<=n;j++){ if(!a[j][i]) suma++; } task[i] = suma; } for(i=1;i<=n;i++){ for(j=1;j<=t;j++){ if(a[i][j]) total[i] += task[j]; } } nr = total[p]; cout << total[p] << " "; sort(total+1,total+n+1); for(i=1;i<=n;i++){ if(total[i] > nr){ cout << n - i + 2; ok = 1; break; } } if(!ok) cout << 1; return 0; }

Compilation message (stderr)

poi.cpp: In function 'int main()':
poi.cpp:39:1: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   39 | if(!ok)
      | ^~
poi.cpp:41:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   41 |     return 0;
      |     ^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...