# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
433137 | ioi | Poi (IOI09_poi) | C++14 | 761 ms | 23740 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
}
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |