Submission #76664717


Source Code Expand

#include <bits/stdc++.h>
using namespace std;

#define ll long long



int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    vector<pair<int,int>> arr;
    int ans = 1;
    for(int i = 0; i < n; i++){
        int a,b;
        cin >> a >> b;
        arr.push_back({a,b});
    }
    sort(arr.begin(),arr.end());
    int ym = arr[0].second;
    
    for (int i = 1; i < n; i++){
        if ((arr[i].second <= ym)){
            ans++;
        }
        ym = min(ym,arr[i].second);

        
        
    }
    cout << ans;
    return 0;
}

Submission Info

Submission Time
Task C - Not Covered Points
User POLYBIUS
Language C++23 (GCC 15.2.0)
Score 300
Code Size 600 Byte
Status AC
Exec Time 41 ms
Memory 7656 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 3516 KiB
00_sample_01.txt AC 1 ms 3532 KiB
00_sample_02.txt AC 1 ms 3516 KiB
01_random_00.txt AC 1 ms 3480 KiB
01_random_01.txt AC 23 ms 7528 KiB
01_random_02.txt AC 39 ms 7552 KiB
01_random_03.txt AC 23 ms 7448 KiB
01_random_04.txt AC 40 ms 7524 KiB
01_random_05.txt AC 28 ms 5396 KiB
01_random_06.txt AC 41 ms 7516 KiB
01_random_07.txt AC 23 ms 5548 KiB
01_random_08.txt AC 41 ms 7484 KiB
01_random_09.txt AC 24 ms 5476 KiB
01_random_10.txt AC 41 ms 7496 KiB
01_random_11.txt AC 12 ms 4468 KiB
01_random_12.txt AC 41 ms 7532 KiB
01_random_13.txt AC 41 ms 7536 KiB
01_random_14.txt AC 39 ms 7540 KiB
01_random_15.txt AC 40 ms 7516 KiB
01_random_16.txt AC 40 ms 7656 KiB
01_random_17.txt AC 40 ms 7556 KiB
01_random_18.txt AC 41 ms 7528 KiB
01_random_19.txt AC 40 ms 7544 KiB
01_random_20.txt AC 40 ms 7596 KiB
01_random_21.txt AC 39 ms 7616 KiB