Submission #76645458


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define LONGMAX 1e18
#define INTMAX 2147483647

int main(void)
{
    int N;
    cin >> N;
    vector<pair<int, int>> XY(N);
    vector<int> Y_min(N, 0);
    for (int i = 0; i < N; i++)
    {
        int X, Y;
        cin >> X >> Y;
        XY[i] = {X, Y};
    }
    sort(XY.begin(), XY.end());
    Y_min[0] = INTMAX;
    for (int i = 1; i < N; i++)
    {
        Y_min[i] = min(XY[i - 1].second, Y_min[i - 1]); // 左からi番目の点の左側にある点の中で一番下にあるもののYを記録
    }
    int ans = 0;
    for (int i = 0; i < N; i++)
    {
        if (XY[i].second < Y_min[i])
        {
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

Submission Info

Submission Time
Task C - Not Covered Points
User lalashvbp
Language C++23 (GCC 15.2.0)
Score 300
Code Size 790 Byte
Status AC
Exec Time 124 ms
Memory 7000 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 25
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, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 01_random_21.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3528 KiB
00_sample_01.txt AC 1 ms 3584 KiB
00_sample_02.txt AC 1 ms 3576 KiB
01_random_00.txt AC 1 ms 3416 KiB
01_random_01.txt AC 107 ms 6872 KiB
01_random_02.txt AC 124 ms 6776 KiB
01_random_03.txt AC 108 ms 7000 KiB
01_random_04.txt AC 124 ms 6932 KiB
01_random_05.txt AC 82 ms 5696 KiB
01_random_06.txt AC 123 ms 6872 KiB
01_random_07.txt AC 67 ms 5352 KiB
01_random_08.txt AC 124 ms 6920 KiB
01_random_09.txt AC 71 ms 5352 KiB
01_random_10.txt AC 124 ms 6844 KiB
01_random_11.txt AC 36 ms 4488 KiB
01_random_12.txt AC 124 ms 6864 KiB
01_random_13.txt AC 124 ms 6860 KiB
01_random_14.txt AC 124 ms 6848 KiB
01_random_15.txt AC 124 ms 6924 KiB
01_random_16.txt AC 124 ms 6924 KiB
01_random_17.txt AC 124 ms 6888 KiB
01_random_18.txt AC 124 ms 6904 KiB
01_random_19.txt AC 124 ms 6860 KiB
01_random_20.txt AC 124 ms 6872 KiB
01_random_21.txt AC 124 ms 6924 KiB