提出 #66308340
ソースコード 拡げる
#include <bits/stdc++.h>
using LL = long long;
#define int LL // delete if MLE/TLE
using namespace std;
using vInt = vector<int>;
using vLL = vector<LL>;
using pLL = pair<LL, LL>;
using vPLL = vector<pLL>;
using pii = pair<int, int>;
using vPii = vector<pii>;
using matInt = vector<vInt>;
using matPii = vector<vPii>;
using matLL = vector<vLL>;
using vBool = vector<bool>;
using matBool = vector<vBool>;
using vStr = vector<string>;
#define all(x) (x).begin(), (x).end()
#define cyes cout << "Yes" << '\n'
#define cno cout << "No" << '\n'
#define for0(i, n) for(int (i)=0; (i)<(n); (i)++)
#define for1(i, n) for(int (i)=1; (i)<=(n); (i)++)
#define newInt(n) int n; cin >> n
#define newLL(n) LL n; cin >> n
#define newVInt(A, f, t) vInt A(t); for(int i=f; i<t; i++) cin >> A[i]
#define newVLL(A, f, t) vLL A(t); for(int i=f; i<t; i++) cin >> A[i]
#define endl '\n'
#define ff first
#define ss second
void solve(){
int N, M;
cin >> N >> M;
vPii A(M+1);
for(int i=1; i<=M; i++)
cin >> A[i].ff >> A[i].ss;
vInt X(N+2);
for(int i=1; i<=M; i++){
X[A[i].ff]++;
X[A[i].ss+1]--;
}
for(int i=1; i<=N; i++)
X[i] += X[i-1];
int minv = 1e18;
for(int i=1; i<=N; i++)
minv = min(minv, X[i]);
cout << minv << '\n';
}
int32_t main(){
ios::sync_with_stdio(false);
cin.tie(nullptr); cout.tie(nullptr);
solve();
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | C - Not All Covered |
| ユーザ | menborong |
| 言語 | C++ 20 (gcc 12.2) |
| 得点 | 300 |
| コード長 | 1487 Byte |
| 結果 | AC |
| 実行時間 | 26 ms |
| メモリ | 14228 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 300 / 300 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| 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 |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 00_sample_00.txt | AC | 1 ms | 3468 KiB |
| 00_sample_01.txt | AC | 1 ms | 3436 KiB |
| 00_sample_02.txt | AC | 1 ms | 3476 KiB |
| 01_test_00.txt | AC | 15 ms | 5972 KiB |
| 01_test_01.txt | AC | 18 ms | 6416 KiB |
| 01_test_02.txt | AC | 15 ms | 6180 KiB |
| 01_test_03.txt | AC | 17 ms | 6244 KiB |
| 01_test_04.txt | AC | 10 ms | 9944 KiB |
| 01_test_05.txt | AC | 22 ms | 10004 KiB |
| 01_test_06.txt | AC | 22 ms | 13536 KiB |
| 01_test_07.txt | AC | 25 ms | 14096 KiB |
| 01_test_08.txt | AC | 10 ms | 11356 KiB |
| 01_test_09.txt | AC | 25 ms | 14228 KiB |
| 01_test_10.txt | AC | 12 ms | 11848 KiB |
| 01_test_11.txt | AC | 26 ms | 14136 KiB |
| 01_test_12.txt | AC | 26 ms | 14120 KiB |
| 01_test_13.txt | AC | 25 ms | 14132 KiB |
| 01_test_14.txt | AC | 25 ms | 14084 KiB |
| 01_test_15.txt | AC | 25 ms | 14172 KiB |
| 01_test_16.txt | AC | 25 ms | 14132 KiB |
| 01_test_17.txt | AC | 25 ms | 14084 KiB |
| 01_test_18.txt | AC | 26 ms | 14124 KiB |
| 01_test_19.txt | AC | 21 ms | 14160 KiB |
| 01_test_20.txt | AC | 22 ms | 14120 KiB |
| 01_test_21.txt | AC | 22 ms | 14120 KiB |