# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
539165 | astoria | Poi (IOI09_poi) | C++14 | 582 ms | 23760 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 main() {
int N,T,P;
cin >> N >> T >> P;
P--;
int taskssolved[N][T];
int score[T] = {0};
for (int i=0; i<N; i++){
for (int j=0; j<T; j++){
cin >> taskssolved[i][j];
if (taskssolved[i][j] == 0) score[j]++;
}
}
int scores[N] = {0};
for (int i=0; i<N; i++){
for (int j=0; j<T; j++){
if (taskssolved[i][j] == 1) scores[i] += score[j];
}
}
int numsolves[N] = {0};
for (int i=0; i<N; i++){
for (int j=0; j<T; j++){
if (taskssolved[i][j] == 1) numsolves[i]++;
}
}
for (int i=0; i<N; i++){
scores[i] = 0-scores[i];
numsolves[i] = 0-numsolves[i];
}
pair<int,pair<int,int> > alltheinfo[N]; // <score, <numsolves,id> >
for (int i=0; i<N; i++){
alltheinfo[i] = make_pair(scores[i], make_pair(numsolves[i],i));
}
sort(alltheinfo,alltheinfo+N);
for (int i=0; i<N; i++){
if (alltheinfo[i].second.second == P){
cout << 0-alltheinfo[i].first << " " << (i+1);
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |