Submission #295854

#TimeUsernameProblemLanguageResultExecution timeMemory
295854HemimorPoi (IOI09_poi)C++14
100 / 100
444 ms24176 KiB
#include <algorithm> #include <iostream> #include <iomanip> #include <numeric> #include <cassert> #include <vector> #include <cmath> #include <queue> #include <set> #include <map> #define syosu(x) fixed<<setprecision(x) using namespace std; typedef long long ll; typedef unsigned int uint; typedef unsigned long long ull; typedef pair<int,int> P; typedef pair<double,double> pdd; typedef pair<ll,ll> pll; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<double> vd; typedef vector<vd> vvd; typedef vector<ll> vl; typedef vector<vl> vvl; typedef vector<string> vs; typedef vector<P> vp; typedef vector<vp> vvp; typedef vector<pll> vpll; typedef pair<P,int> pip; typedef vector<pip> vip; const int inf=1<<30; const ll INF=1ll<<60; const double pi=acos(-1); const double eps=1e-8; const ll mod=1e9+7; const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1}; int n,m,k; vvi a; vi b,c; int main(){ scanf("%d%d%d",&n,&m,&k); k--; a=vvi(n,vi(m)); b=vi(m); c=vi(n); for(int i=0;i<n;i++) for(int j=0;j<m;j++){ scanf("%d",&a[i][j]); b[j]+=1-a[i][j]; } vvi d(n,vi(3)); for(int i=0;i<n;i++){ int t=0; for(int j=0;j<m;j++){ c[i]+=b[j]*a[i][j]; t+=a[i][j]; } d[i][0]=c[i]; d[i][1]=t; d[i][2]=-i; } sort(d.rbegin(),d.rend()); cout<<c[k]<<' '; for(int i=0;i<n;i++) if(d[i][2]==-k) cout<<i+1<<endl; }

Compilation message (stderr)

poi.cpp: In function 'int main()':
poi.cpp:43:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   43 |  scanf("%d%d%d",&n,&m,&k);
      |  ~~~~~^~~~~~~~~~~~~~~~~~~
poi.cpp:49:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   49 |   scanf("%d",&a[i][j]);
      |   ~~~~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...