Submission #957615

#TimeUsernameProblemLanguageResultExecution timeMemory
957615ezzzayOlympiads (BOI19_olympiads)C++14
0 / 100
3 ms8540 KiB
#include<bits/stdc++.h> using namespace std; #define int long long #define ff first #define ss second #define pb push_back const int N=2e3+4; int a[N][N]; signed main(){ int n,k,c; cin>>n>>k>>c; vector<int>vc; for(int i=1;i<=n;i++){ for(int j=1;j<=k;j++){ cin>>a[i][j]; } } int s=0; for(int i=1;i<=n;i++){ int tmp[N]; for(int l=0;l<=k;l++)tmp[l]=0; for(int l=0;l<=n;l++){ if(i==l)continue; for(int j=1;j<=k;j++){ tmp[j]=max(tmp[j],a[l][j]); } } int h=0; for(int j=1;j<=k;j++)h+=tmp[j]; vc.pb(h); } sort(vc.begin(),vc.end(), greater<int>()); cout<<vc[k-1]; }

Compilation message (stderr)

olympiads.cpp: In function 'int main()':
olympiads.cpp:18:9: warning: unused variable 's' [-Wunused-variable]
   18 |     int s=0;
      |         ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...