# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
251016 | 79brue | Poi (IOI09_poi) | C++14 | 411 ms | 12152 KiB |
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;
int n, p, k;
bool solved[2002][2002];
int points[2002];
int score[2002];
int cnt[2002];
int ans;
int main(){
scanf("%d %d %d", &n, &p, &k);
for(int i=1; i<=n; i++){
for(int j=1; j<=p; j++){
scanf("%d", &solved[i][j]);
if(!solved[i][j]) points[j]++;
else cnt[i]++;
}
}
for(int i=1; i<=n; i++){
for(int j=1; j<=p; j++){
if(solved[i][j]) score[i] += points[j];
}
}
// for(int i=1; i<=p; i++)
// printf("%d problem point: %d\n", i, points[i]);
for(int i=1; i<=n; i++){
// printf("%d\'s score: %d\n", i, score[i]);
if(score[k] < score[i]) ans++;
else if(score[k] == score[i]){
if(cnt[k] < cnt[i]) ans++;
else if(cnt[k] == cnt[i] && i<k) ans++;
}
}
printf("%d %d", score[k], ans+1);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |