Submission #19544296


Source Code Expand

Copy
#include <iostream>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <queue>
#include <iomanip>
#include <numeric>
#include <cmath>
using namespace std;

int main() {
	int n, d, k;
	cin >> n >> d >> k;
	vector<pair<int, int>> vp;
	for (int i = 0; i < d; i++) {
		int l, r;
		cin >> l >> r;
		vp.emplace_back(l, r);
	}
	for (int i = 0; i < k; i++) {
		int s, t;
		cin >> s >> t;
		int b = s, e = s;
		for (int j = 0; j < d; j++) {
			int l = vp[j].first, r = vp[j].second;
			if (e < l || r < b) {
				continue;
			} else {
				b = min(b, l);
				e = max(e, r);
			}
			if (t >= b && t <= e) {
				cout << j + 1 << endl;
				break;
			}
		}
	}
}

Submission Info

Submission Time
Task C - 民族大移動
User cszclin
Language C++ (GCC 9.2.1)
Score 100
Code Size 787 Byte
Status AC
Exec Time 26 ms
Memory 3684 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 52
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All sample_01.txt, sample_02.txt, sample_03.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask1_16.txt, subtask1_17.txt, subtask1_18.txt, subtask1_19.txt, subtask1_20.txt, subtask1_21.txt, subtask1_22.txt, subtask1_23.txt, subtask1_24.txt, subtask1_25.txt, subtask1_26.txt, subtask1_27.txt, subtask1_28.txt, subtask1_29.txt, subtask1_30.txt, subtask1_31.txt, subtask1_32.txt, subtask1_33.txt, subtask1_34.txt, subtask1_35.txt, subtask1_36.txt, subtask1_37.txt, subtask1_38.txt, subtask1_39.txt, subtask1_40.txt, subtask1_41.txt, subtask1_42.txt, subtask1_43.txt, subtask1_44.txt, subtask1_45.txt, subtask1_46.txt, subtask1_47.txt, subtask1_48.txt, subtask1_49.txt
Case Name Status Exec Time Memory
sample_01.txt AC 11 ms 3392 KB
sample_02.txt AC 2 ms 3340 KB
sample_03.txt AC 2 ms 3556 KB
subtask1_01.txt AC 15 ms 3584 KB
subtask1_02.txt AC 8 ms 3428 KB
subtask1_03.txt AC 10 ms 3568 KB
subtask1_04.txt AC 15 ms 3520 KB
subtask1_05.txt AC 12 ms 3584 KB
subtask1_06.txt AC 12 ms 3584 KB
subtask1_07.txt AC 14 ms 3624 KB
subtask1_08.txt AC 8 ms 3448 KB
subtask1_09.txt AC 10 ms 3608 KB
subtask1_10.txt AC 4 ms 3572 KB
subtask1_11.txt AC 14 ms 3588 KB
subtask1_12.txt AC 7 ms 3520 KB
subtask1_13.txt AC 2 ms 3492 KB
subtask1_14.txt AC 11 ms 3612 KB
subtask1_15.txt AC 13 ms 3544 KB
subtask1_16.txt AC 13 ms 3592 KB
subtask1_17.txt AC 15 ms 3464 KB
subtask1_18.txt AC 14 ms 3588 KB
subtask1_19.txt AC 13 ms 3500 KB
subtask1_20.txt AC 16 ms 3512 KB
subtask1_21.txt AC 13 ms 3604 KB
subtask1_22.txt AC 16 ms 3588 KB
subtask1_23.txt AC 12 ms 3668 KB
subtask1_24.txt AC 14 ms 3544 KB
subtask1_25.txt AC 14 ms 3612 KB
subtask1_26.txt AC 15 ms 3528 KB
subtask1_27.txt AC 15 ms 3664 KB
subtask1_28.txt AC 13 ms 3608 KB
subtask1_29.txt AC 18 ms 3516 KB
subtask1_30.txt AC 13 ms 3612 KB
subtask1_31.txt AC 13 ms 3468 KB
subtask1_32.txt AC 17 ms 3528 KB
subtask1_33.txt AC 13 ms 3524 KB
subtask1_34.txt AC 12 ms 3468 KB
subtask1_35.txt AC 16 ms 3588 KB
subtask1_36.txt AC 13 ms 3616 KB
subtask1_37.txt AC 17 ms 3668 KB
subtask1_38.txt AC 13 ms 3620 KB
subtask1_39.txt AC 16 ms 3520 KB
subtask1_40.txt AC 12 ms 3520 KB
subtask1_41.txt AC 18 ms 3524 KB
subtask1_42.txt AC 17 ms 3512 KB
subtask1_43.txt AC 17 ms 3524 KB
subtask1_44.txt AC 16 ms 3528 KB
subtask1_45.txt AC 26 ms 3612 KB
subtask1_46.txt AC 16 ms 3684 KB
subtask1_47.txt AC 15 ms 3664 KB
subtask1_48.txt AC 19 ms 3668 KB
subtask1_49.txt AC 15 ms 3516 KB