Submission #50787458


Source Code Expand

/**
 *  @the_hyp0cr1t3
 *  02.03.2024 17:38
**/
#include <bits/stdc++.h>

using i64 = long long;

int main() {
    std::cin.tie(nullptr)->sync_with_stdio(false);

    int n, t;
    std::cin >> n >> t;

    std::vector<i64> cur(n);

    std::map<i64, int> cnt;
    cnt[0] = n;

    while (t--) {
        int a, b;
        std::cin >> a >> b;
        --a;
        if (!--cnt[cur[a]])
            cnt.erase(cur[a]);
        cur[a] += b;
        cnt[cur[a]]++;
        std::cout << cnt.size() << '\n';
    }

}

Submission Info

Submission Time
Task D - Diversity of Scores
User the_hyp0cr1t3
Language C++ 20 (gcc 12.2)
Score 400
Code Size 538 Byte
Status AC
Exec Time 142 ms
Memory 12384 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 3
AC × 22
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 02_max_00.txt, 02_max_01.txt, 03_killer_00.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3416 KiB
00_sample_01.txt AC 1 ms 3360 KiB
00_sample_02.txt AC 1 ms 3508 KiB
01_random_00.txt AC 32 ms 4608 KiB
01_random_01.txt AC 54 ms 3684 KiB
01_random_02.txt AC 64 ms 6044 KiB
01_random_03.txt AC 68 ms 5972 KiB
01_random_04.txt AC 80 ms 7280 KiB
01_random_05.txt AC 90 ms 6544 KiB
01_random_06.txt AC 95 ms 8632 KiB
01_random_07.txt AC 100 ms 8392 KiB
01_random_08.txt AC 118 ms 9712 KiB
01_random_09.txt AC 123 ms 9652 KiB
01_random_10.txt AC 127 ms 10808 KiB
01_random_11.txt AC 130 ms 8916 KiB
01_random_12.txt AC 142 ms 11692 KiB
01_random_13.txt AC 105 ms 4436 KiB
01_random_14.txt AC 136 ms 12384 KiB
01_random_15.txt AC 132 ms 8144 KiB
02_max_00.txt AC 34 ms 4764 KiB
02_max_01.txt AC 31 ms 4580 KiB
03_killer_00.txt AC 32 ms 4672 KiB