# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
568623 | TomkeMonke | Poi (IOI09_poi) | C++17 | 586 ms | 23796 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;
const int MAXN = 2e3 + 7;
int tab[MAXN][MAXN];
int scores[MAXN];
int main(){
int n, t, p;
cin >> n >> t >> p;
for(int i = 1; i <= n; i++){
for(int j = 1; j <= t; j++){
cin >> tab[i][j];
}
}
//for(int j = 1; j <= t; j++)
// cout << tab[p][j] << endl;
int res = 0;
for(int i = 1; i <= t; i++){
res = 0;
for(int j = 1; j <= n; j++){
if(tab[j][i] == 0) res++;
}
for(int j = 1; j <= n; j++){
if(tab[j][i] == 1) scores[j] += res;
}
}
cout << scores[p] << " ";
//for(int i = 1; i <= n; i++)
// cout << scores[i] << " ";
//cout << endl;
res = scores[p];
sort(scores + 1, scores + n + 1);
for(int i = 1; i <= n; i++){
if(scores[i] == res){
cout << (n - i - 1) << endl;
break;
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |