| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 252339 | SamAnd | Poi (IOI09_poi) | C++17 | 452 ms | 23892 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int N = 2003;
struct ban
{
    int i, q, s;
    ban()
    {
        i = q = s = 0;
    }
};
bool operator<(const ban& a, const ban& b)
{
    if (a.s > b.s)
        return true;
    if (a.s < b.s)
        return false;
    if (a.q > b.q)
        return true;
    if (a.q < b.q)
        return false;
    return a.i < b.i;
}
int n, m, p;
int a[N][N];
int u[N];
ban b[N];
int main()
{
    #ifdef SOMETHING
    freopen("input.txt", "r", stdin);
    #endif // SOMETHING
    scanf("%d%d%d", &n, &m, &p);
    for (int i = 1; i <= n; ++i)
    {
        for (int j = 1; j <= m; ++j)
            scanf("%d", &a[i][j]);
    }
    for (int j = 1; j <= m; ++j)
        u[j] = n;
    for (int i = 1; i <= n; ++i)
    {
        for (int j = 1; j <= m; ++j)
            u[j] -= a[i][j];
    }
    for (int i = 1; i <= n; ++i)
    {
        b[i].i = i;
        for (int j = 1; j <= m; ++j)
        {
            b[i].q += a[i][j];
            if (a[i][j])
                b[i].s += u[j];
        }
    }
    sort(b + 1, b + n + 1);
    for (int i = 1; i <= n; ++i)
    {
        if (b[i].i == p)
        {
            printf("%d %d\n", b[i].s, i);
        }
    }
    return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
