Submission #921532

# Submission time Handle Problem Language Result Execution time Memory
921532 2024-02-04T05:55:37 Z josanneo22 Poi (IOI09_poi) C++17
5 / 100
177 ms 16216 KB
#pragma warning(suppress : 4996)
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;

#define L(i,j,k) for(int i=(j);i<=(k);++i)
#define R(i,j,k) for(int i=(j);i>=(k);--i)
#define all(x) x.begin(),x.end()
#define me(x,a) memset(x,a,sizeof(x))


int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);

    int N, M; int id; cin >> N >> M >> id;
    id--;
    vector<i64> people_not_scoring(M + 1, N);
    vector<vector<int>> a(N + 1, vector<int>(M + 1));
    L(i, 1, N) {
        L(j, 1, M) {
            cin >> a[i][j];
            people_not_scoring[j] -= (a[i][j] == 1);
        }
    }
    vector<i64> score(N + 1);
    vector<int> number_of_AC(N + 1);
    L(i, 1, N) L(j, 1, M) {
        score[i] += 1LL * a[i][j] * people_not_scoring[j];
        number_of_AC[i]++;
    }
    vector<int> ord(N); iota(all(ord), 1);
    sort(all(ord), [&](int i, int j) {
        if (score[i] != score[j]) return score[i] > score[j];
        else if (number_of_AC[i] != number_of_AC[j]) return number_of_AC[i] > number_of_AC[j];
        return  i < j;
    });

    L(i, 0, N - 1) {
        if (ord[i] == id) {
            cout << score[id] << ' ' << i + 1 << '\n';
            return 0;
        }
    }
}

Compilation message

poi.cpp:1: warning: ignoring '#pragma warning ' [-Wunknown-pragmas]
    1 | #pragma warning(suppress : 4996)
      |
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Correct 0 ms 348 KB Output is correct
5 Incorrect 1 ms 344 KB Output isn't correct
6 Incorrect 1 ms 348 KB Output isn't correct
7 Incorrect 1 ms 348 KB Output isn't correct
8 Incorrect 1 ms 348 KB Output isn't correct
9 Incorrect 1 ms 348 KB Output isn't correct
10 Incorrect 2 ms 580 KB Output isn't correct
11 Incorrect 6 ms 944 KB Output isn't correct
12 Incorrect 9 ms 1368 KB Output isn't correct
13 Incorrect 25 ms 2652 KB Output isn't correct
14 Incorrect 37 ms 3828 KB Output isn't correct
15 Incorrect 65 ms 6236 KB Output isn't correct
16 Incorrect 70 ms 6868 KB Output isn't correct
17 Incorrect 104 ms 9912 KB Output isn't correct
18 Incorrect 115 ms 11096 KB Output isn't correct
19 Incorrect 152 ms 14632 KB Output isn't correct
20 Incorrect 177 ms 16216 KB Output isn't correct