| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 399388 | iulia13 | Poi (IOI09_poi) | C++14 | 708 ms | 16140 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <algorithm>
using namespace std;
const int nmax = 2005;
int a[nmax][nmax];
int v[nmax];
struct ura{
    int sc, id, tsk;
};
ura b[nmax];
bool cmp(ura x, ura y)
{
    if (x.sc != y.sc)
        return x.sc > y.sc;
    if (x.tsk != y.tsk)
        return x.tsk > y.tsk;
    return x.id < y.id;
}
int main()
{
    int n, t, p, i, j;
    cin >> n >> t >> p;
    for (i = 1; i <= n; i++)
        for (j = 1; j <= t; j++)
            cin >> a[i][j], b[i].tsk += a[i][j];
    for (j = 1; j <= t; j++)
        for (i = 1; i <= n; i++)
            v[j] += (1 - a[i][j]);
    for (i = 1; i <= n; i++)
    {
        b[i].id = i;
        for (j = 1; j <= t; j++)
            b[i].sc += a[i][j] * v[j];
    }
    sort (b + 1, b + n + 1, cmp);
    for (i = 1; i <= n; i++)
        if (b[i].id == p)
        {
            cout << b[i].sc << " " << i;
            return 0;
        }
    return 0;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
