답안 #598465

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
598465 2022-07-18T11:37:19 Z Trisanu_Das Poi (IOI09_poi) C++17
0 / 100
21 ms 32284 KB
#include <bits/stdc++.h>
using namespace std;
 
int main()
{
    int n, t, p; cin >> n >> t >> p;
    vector<int> solves(t, 0);
    vector<vector<int> > v(n, vector(t, int(0)));
    for(int i = 0;i < n;i++) {
        for(int j = 0;j < t;j++) {
            cin >> v[i - 1][j];
            solves[j] += v[i - 1][j];
        }
    }
    vector<array<int,3>> stats(n);
    vector<int> cnt(n, 0);
    vector<int> sum(n, 0);
    for(int i = 0;i < n;i++) {
        for(int j = 0; j < t;j++) {
            cnt[i] += v[i][j];
            sum[i] += v[i][j] * (n - solves[j]);
        }
        stats[i-1]={-sum[i],-cnt[i],i};
    }
    p--;
    sort(stats.begin(), stats.end());
    for(int i = 0;i < n;i++) if(stats[i][2] == p) cout << -stats[i][0] << " " << i+1 << "\n";
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 6
2 Runtime error 0 ms 340 KB Execution killed with signal 11
3 Runtime error 1 ms 340 KB Execution killed with signal 11
4 Runtime error 1 ms 340 KB Execution killed with signal 11
5 Runtime error 1 ms 340 KB Execution killed with signal 11
6 Runtime error 1 ms 340 KB Execution killed with signal 11
7 Runtime error 1 ms 340 KB Execution killed with signal 11
8 Runtime error 1 ms 340 KB Execution killed with signal 11
9 Runtime error 1 ms 468 KB Execution killed with signal 11
10 Runtime error 1 ms 596 KB Execution killed with signal 11
11 Runtime error 1 ms 1364 KB Execution killed with signal 11
12 Runtime error 2 ms 2004 KB Execution killed with signal 11
13 Runtime error 4 ms 5076 KB Execution killed with signal 11
14 Runtime error 5 ms 7124 KB Execution killed with signal 11
15 Runtime error 8 ms 12412 KB Execution killed with signal 11
16 Runtime error 8 ms 13396 KB Execution killed with signal 11
17 Runtime error 15 ms 19488 KB Execution killed with signal 11
18 Runtime error 16 ms 22044 KB Execution killed with signal 11
19 Runtime error 19 ms 29076 KB Execution killed with signal 11
20 Runtime error 21 ms 32284 KB Execution killed with signal 11