Submission #1580798


Source Code Expand

Copy
#include <iostream>
using namespace std;

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

Submission Info

Submission Time
Task B - Theater
User jbyxm
Language C++14 (GCC 5.4.1)
Score 200
Code Size 281 Byte
Status
Exec Time 2 ms
Memory 384 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 384 KB
02.txt 2 ms 384 KB
03.txt 2 ms 384 KB
04.txt 2 ms 384 KB
05.txt 2 ms 384 KB
06.txt 1 ms 384 KB
sample_01.txt 1 ms 384 KB
sample_02.txt 1 ms 384 KB