# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
433137 | ioi | Poi (IOI09_poi) | C++14 | 761 ms | 23740 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;
struct con{
int idx , numberofsolved , score ;
bool operator < (const con & a)const {
if(score != a.score)
return score > a.score ;
if(numberofsolved != a.numberofsolved)
return numberofsolved > a.numberofsolved ;
return idx < a.idx ;
}
};
int main(){
int n , t , p ;
cin >> n >> t >> p ;
p-- ;
int points[t] = {} ;
int arr[n][t];
for(int i = 0 ; i < n; i ++){
for(int j = 0 ; j < t ; j ++){
cin >> arr[i][j] ;
if(arr[i][j] == 0)points[j] ++ ;
}
}
deque<con> d ;
for(int i = 0 ; i < n ; i ++){
int sc = 0 , nos = 0 ;
for(int j = 0 ; j < t ; j ++)
sc += (arr[i][j] ? points[j] : 0) , nos += !!arr[i][j];
d.push_back({i , nos , sc});
}
sort(d.begin() , d.end());
for(int r = 0 ; r < d.size() ; r ++ ){
if(d[r].idx == p){
cout << d[r].score << " " << r + 1 << endl ;
break;
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |