Submission #75172472


Source Code Expand

#include <bits/stdc++.h>

using namespace std;

mt19937_64    rng(chrono::steady_clock::now().time_since_epoch().count());

#define       nline                     "\n"
#define       pb                        push_back
#define       ppb                       pop_back
#define       mp                        make_pair
#define       ff                        first
#define       ss                        second
#define       fall(x, n)                for(int x=0; x<n; x++)
#define       rall(x, n)                for(int x=n-1; x>=0; x--)
#define       frange(x, start, end)     for(int x=start; x<=end; x++)
#define       rrange(x, start, end)     for(int x=start; x>=end; x--)
#define       in(i, v)                  for(auto &i: v) cin >> i;
#define       vi                        vector<int>
#define       ii                        pair<int, int>
#define       sz(x)                     ((int)(x).size())
#define       all(x)                    (x).begin(), (x).end()
#define       mod                       1000000007
#define       INF                       0x1fffffffffffffffLL

typedef       long long                 ll;
typedef       unsigned long long        ull;
typedef       long double               lld;

#ifdef        LOCAL
#include      "debug.h"
#else
#define       debug(x)
#endif

#define       int                       long long

void solve()
{
    int n, m; cin >> n >> m;
    vi pre(n + 5);
    while (m--) {
        int a, b; cin >> a >> b;
        pre[a]++; pre[b + 1]--;
    }
    int ans = INF;
    frange(i, 1, n) {
        pre[i] += pre[i - 1];
        ans = min(ans, pre[i]);
    }
    cout << ans << nline;
}

signed main()
{
#ifdef LOCAL
    freopen("i.txt", "r", stdin); freopen("o.txt", "w", stdout); freopen("e.txt", "w", stderr);
#endif
    auto begin = chrono::high_resolution_clock::now();
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int t = 1;
    while (t--) solve();
    auto end = chrono::high_resolution_clock::now();
    auto elapsed = chrono::duration_cast<chrono::nanoseconds>(end - begin);
    cerr << fixed << "Time measured <= *_* => " << elapsed.count() * 1e-9 << " seconds.\n";
    return 0;
}

Submission Info

Submission Time
Task F - Not All Covered
User kumaresh_rk
Language C++23 (GCC 15.2.0)
Score 300
Code Size 2231 Byte
Status AC
Exec Time 33 ms
Memory 11348 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_test_00.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt, 01_test_14.txt, 01_test_15.txt, 01_test_16.txt, 01_test_17.txt, 01_test_18.txt, 01_test_19.txt, 01_test_20.txt, 01_test_21.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 2 ms 3772 KiB
00_sample_01.txt AC 1 ms 3908 KiB
00_sample_02.txt AC 1 ms 3884 KiB
01_test_00.txt AC 13 ms 4428 KiB
01_test_01.txt AC 14 ms 4060 KiB
01_test_02.txt AC 12 ms 4428 KiB
01_test_03.txt AC 12 ms 4060 KiB
01_test_04.txt AC 15 ms 9624 KiB
01_test_05.txt AC 22 ms 7180 KiB
01_test_06.txt AC 28 ms 11232 KiB
01_test_07.txt AC 30 ms 11220 KiB
01_test_08.txt AC 15 ms 11208 KiB
01_test_09.txt AC 29 ms 11276 KiB
01_test_10.txt AC 16 ms 11232 KiB
01_test_11.txt AC 30 ms 11152 KiB
01_test_12.txt AC 33 ms 11112 KiB
01_test_13.txt AC 29 ms 11152 KiB
01_test_14.txt AC 29 ms 11200 KiB
01_test_15.txt AC 28 ms 11152 KiB
01_test_16.txt AC 27 ms 11208 KiB
01_test_17.txt AC 28 ms 11152 KiB
01_test_18.txt AC 26 ms 11348 KiB
01_test_19.txt AC 22 ms 11276 KiB
01_test_20.txt AC 22 ms 11348 KiB
01_test_21.txt AC 22 ms 11152 KiB