# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
251016 | 2020-07-19T23:58:40 Z | 79brue | Poi (IOI09_poi) | C++14 | 411 ms | 12152 KB |
#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
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 512 KB | Output is correct |
2 | Correct | 0 ms | 384 KB | Output is correct |
3 | Correct | 0 ms | 384 KB | Output is correct |
4 | Correct | 1 ms | 384 KB | Output is correct |
5 | Correct | 1 ms | 384 KB | Output is correct |
6 | Correct | 1 ms | 384 KB | Output is correct |
7 | Correct | 1 ms | 512 KB | Output is correct |
8 | Correct | 1 ms | 512 KB | Output is correct |
9 | Correct | 2 ms | 512 KB | Output is correct |
10 | Correct | 6 ms | 768 KB | Output is correct |
11 | Correct | 13 ms | 1152 KB | Output is correct |
12 | Correct | 21 ms | 1664 KB | Output is correct |
13 | Correct | 61 ms | 2848 KB | Output is correct |
14 | Correct | 90 ms | 3960 KB | Output is correct |
15 | Correct | 150 ms | 5644 KB | Output is correct |
16 | Correct | 166 ms | 6140 KB | Output is correct |
17 | Correct | 241 ms | 7928 KB | Output is correct |
18 | Correct | 280 ms | 9208 KB | Output is correct |
19 | Correct | 372 ms | 11256 KB | Output is correct |
20 | Correct | 411 ms | 12152 KB | Output is correct |