Submission #784675

#TimeUsernameProblemLanguageResultExecution timeMemory
784675oscar1fCouncil (JOI23_council)C++17
16 / 100
4057 ms27308 KiB
#include<bits/stdc++.h> using namespace std; const int MAX_PERS=300*1000+5,MAX_PROP=22; int nbPers,nbChoix,rep,val; int choix[MAX_PERS][MAX_PROP]; int somme[MAX_PROP]; signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin>>nbPers>>nbChoix; for (int i=0;i<nbPers;i++) { for (int j=0;j<nbChoix;j++) { cin>>choix[i][j]; somme[j]+=choix[i][j]; } } for (int i=0;i<nbPers;i++) { rep=0; for (int j=0;j<nbPers;j++) { if (i!=j) { val=0; for (int k=0;k<nbChoix;k++) { if (somme[k]-choix[i][k]-choix[j][k]>=nbPers/2) { val++; } } rep=max(rep,val); } } cout<<rep<<"\n"; } return 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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...