Submission #717726

#TimeUsernameProblemLanguageResultExecution timeMemory
717726AndrijaMPoi (IOI09_poi)C++14
5 / 100
598 ms16740 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n,t,p; cin>>n>>t>>p; int cpt[t]={0}; vector<int>v[n]; int val[n]; memset(val,0,sizeof val); vector<pair<int,int>>r; for(int i=0;i<n;i++) { for(int j=0;j<t;j++) { int num; cin>>num; v[i].push_back(num); cpt[j]+=num;///lugje-cpt[j] treba } } for(int i=0;i<n;i++) { for(int j=0;j<t;j++) { if(v[i][j]==1) val[i]+=n-cpt[j]; } r.push_back({val[i],i+1}); } sort(r.begin(),r.end()); for(int i=0;i<r.size();i++) { if(r[i].second==p) { cout<<r[i].first<<" "<<i+1<<endl; return 0; } } return 0; }

Compilation message (stderr)

poi.cpp: In function 'int main()':
poi.cpp:34:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   34 |     for(int i=0;i<r.size();i++)
      |                 ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...