Submission #1577211


Source Code Expand

Copy
#include <iostream>
using namespace std;

int main(){
	int n;
	cin >> n;
	int a[100002]{};
	while(n--){
		int l, r;
		cin >> l >> r;
		a[--l]++;
		a[r]--;
	}
	for(int i = 1; i < 100002; i++) a[i] += a[i - 1];
	int ans = 0;
	for(int i = 0; i < 100002; i++) ans += a[i];
	cout << ans << endl;
}

Submission Info

Submission Time
Task B - Theater
User jbyxm
Language C++14 (GCC 5.4.1)
Score 200
Code Size 309 Byte
Status
Exec Time 2 ms
Memory 640 KB

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample_01.txt, sample_02.txt
All 200 / 200 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, sample_01.txt, sample_02.txt
Case Name Status Exec Time Memory
01.txt 2 ms 640 KB
02.txt 2 ms 640 KB
03.txt 2 ms 640 KB
04.txt 2 ms 640 KB
05.txt 2 ms 640 KB
06.txt 2 ms 640 KB
sample_01.txt 2 ms 640 KB
sample_02.txt 2 ms 640 KB