| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 335585 | Joshc | Poi (IOI09_poi) | C++11 | 494 ms | 23916 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
int l[2001][2001], v[2001];
int main() {
    int n, t, p;
    scanf("%d%d%d", &n, &t, &p);
    for (int i=1; i<=n; i++) {
        for (int j=1; j<=t; j++) scanf("%d", &l[i][j]);
    }
    for (int i=1; i<=t; i++) {
        for (int j=1; j<=n; j++) v[i] += !l[j][i];
    }
    vector<pair<int, pair<int, int> > > x;
    for (int i=1; i<=n; i++) {
        int a=0, b=0;
        for (int j=1; j<=t; j++) {
            a += l[i][j]*v[j];
            b += l[i][j];
        }
        x.push_back({-a, {-b, i}});
    }
    sort(x.begin(), x.end());
    for (int i=0; i<n; i++) {
        if (x[i].second.second == p) printf("%d %d\n", -x[i].first, i+1);
    }
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
