Submission #52069211


Source Code Expand

/**
 *  @the_hyp0cr1t3
 *  06.04.2024 17:34
**/
#include <bits/stdc++.h>

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

    int n;
    std::cin >> n;
    std::map<int, int> v;
    while (n--) {
        int a, c;
        std::cin >> a >> c;
        if (!v.count(c))
            v[c] = a;
        else
            v[c] = std::min(v[c], a);
    }

    int ans = 0;
    for (auto [c, a] : v)
        ans = std::max(ans, a);

    std::cout << ans << '\n';

}

Submission Info

Submission Time
Task C - Colorful Beans
User the_hyp0cr1t3
Language C++ 20 (gcc 12.2)
Score 250
Code Size 501 Byte
Status AC
Exec Time 139 ms
Memory 12976 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 250 / 250
Status
AC × 2
AC × 30
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt
All 00_sample_00.txt, 00_sample_01.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, 01_random_16.txt, 01_random_17.txt, 02_maximum_00.txt, 02_maximum_01.txt, 02_maximum_02.txt, 02_maximum_03.txt, 02_maximum_04.txt, 02_maximum_05.txt, 02_maximum_06.txt, 02_maximum_07.txt, 02_maximum_08.txt, 02_maximum_09.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3596 KiB
00_sample_01.txt AC 1 ms 3468 KiB
01_random_00.txt AC 21 ms 5712 KiB
01_random_01.txt AC 12 ms 4708 KiB
01_random_02.txt AC 83 ms 10308 KiB
01_random_03.txt AC 13 ms 3496 KiB
01_random_04.txt AC 66 ms 4092 KiB
01_random_05.txt AC 50 ms 3716 KiB
01_random_06.txt AC 49 ms 3612 KiB
01_random_07.txt AC 46 ms 4240 KiB
01_random_08.txt AC 34 ms 3804 KiB
01_random_09.txt AC 73 ms 4728 KiB
01_random_10.txt AC 6 ms 3528 KiB
01_random_11.txt AC 19 ms 3680 KiB
01_random_12.txt AC 54 ms 4176 KiB
01_random_13.txt AC 40 ms 3784 KiB
01_random_14.txt AC 10 ms 3864 KiB
01_random_15.txt AC 60 ms 4288 KiB
01_random_16.txt AC 16 ms 3804 KiB
01_random_17.txt AC 30 ms 3572 KiB
02_maximum_00.txt AC 83 ms 5576 KiB
02_maximum_01.txt AC 92 ms 6748 KiB
02_maximum_02.txt AC 54 ms 3564 KiB
02_maximum_03.txt AC 76 ms 4800 KiB
02_maximum_04.txt AC 80 ms 5404 KiB
02_maximum_05.txt AC 139 ms 12900 KiB
02_maximum_06.txt AC 139 ms 12976 KiB
02_maximum_07.txt AC 101 ms 8156 KiB
02_maximum_08.txt AC 104 ms 8136 KiB
02_maximum_09.txt AC 102 ms 8100 KiB