This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |