Submission #19544072


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, t;
	cin >> n >> t;
	int res = 0;
	int last = 0;
	for (int i = 0; i < n; i++) {
		int a;
		cin >> a;
		if (last >= a) {
			res += a + t - last;
			last = a + t;
		} else {	
			last = a + t;
			res += t;
		}
	}
	cout << res << endl;
}

Submission Info

Submission Time
Task B - 自動ドア
User cszclin
Language C++ (GCC 9.2.1)
Score 100
Code Size 540 Byte
Status AC
Exec Time 40 ms
Memory 3608 KB

Judge Result

Set Name Sample Subtask1 Subtask2
Score / Max Score 0 / 0 50 / 50 50 / 50
Status
AC × 2
AC × 31
AC × 61
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
Subtask1 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, sample_01.txt, sample_02.txt
Subtask2 sample_01.txt, sample_02.txt, sample_23.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, subtask2_01.txt, subtask2_02.txt, subtask2_03.txt, subtask2_04.txt, subtask2_05.txt, subtask2_06.txt, subtask2_07.txt, subtask2_08.txt, subtask2_09.txt, subtask2_10.txt, subtask2_11.txt, subtask2_12.txt, subtask2_13.txt, subtask2_14.txt, subtask2_15.txt, subtask2_16.txt, subtask2_17.txt, subtask2_18.txt, subtask2_19.txt, subtask2_20.txt, subtask2_21.txt, subtask2_22.txt, subtask2_23.txt, subtask2_24.txt, subtask2_25.txt, subtask2_26.txt, subtask2_27.txt, subtask2_28.txt, subtask2_29.txt
Case Name Status Exec Time Memory
sample_01.txt AC 10 ms 3420 KB
sample_02.txt AC 3 ms 3528 KB
sample_23.txt AC 2 ms 3528 KB
subtask1_01.txt AC 25 ms 3604 KB
subtask1_02.txt AC 13 ms 3584 KB
subtask1_03.txt AC 31 ms 3608 KB
subtask1_04.txt AC 15 ms 3416 KB
subtask1_05.txt AC 15 ms 3416 KB
subtask1_06.txt AC 11 ms 3528 KB
subtask1_07.txt AC 32 ms 3560 KB
subtask1_08.txt AC 31 ms 3576 KB
subtask1_09.txt AC 26 ms 3384 KB
subtask1_10.txt AC 10 ms 3608 KB
subtask1_11.txt AC 18 ms 3496 KB
subtask1_12.txt AC 29 ms 3496 KB
subtask1_13.txt AC 30 ms 3388 KB
subtask1_14.txt AC 26 ms 3384 KB
subtask1_15.txt AC 33 ms 3508 KB
subtask1_16.txt AC 37 ms 3504 KB
subtask1_17.txt AC 36 ms 3500 KB
subtask1_18.txt AC 35 ms 3364 KB
subtask1_19.txt AC 36 ms 3564 KB
subtask1_20.txt AC 36 ms 3500 KB
subtask1_21.txt AC 35 ms 3384 KB
subtask1_22.txt AC 35 ms 3548 KB
subtask1_23.txt AC 36 ms 3412 KB
subtask1_24.txt AC 38 ms 3564 KB
subtask1_25.txt AC 33 ms 3568 KB
subtask1_26.txt AC 35 ms 3504 KB
subtask1_27.txt AC 36 ms 3528 KB
subtask1_28.txt AC 34 ms 3416 KB
subtask1_29.txt AC 35 ms 3576 KB
subtask2_01.txt AC 25 ms 3536 KB
subtask2_02.txt AC 21 ms 3572 KB
subtask2_03.txt AC 19 ms 3504 KB
subtask2_04.txt AC 8 ms 3364 KB
subtask2_05.txt AC 30 ms 3420 KB
subtask2_06.txt AC 14 ms 3600 KB
subtask2_07.txt AC 24 ms 3536 KB
subtask2_08.txt AC 12 ms 3536 KB
subtask2_09.txt AC 20 ms 3388 KB
subtask2_10.txt AC 40 ms 3500 KB
subtask2_11.txt AC 18 ms 3536 KB
subtask2_12.txt AC 24 ms 3364 KB
subtask2_13.txt AC 19 ms 3556 KB
subtask2_14.txt AC 11 ms 3552 KB
subtask2_15.txt AC 33 ms 3604 KB
subtask2_16.txt AC 35 ms 3556 KB
subtask2_17.txt AC 36 ms 3504 KB
subtask2_18.txt AC 33 ms 3600 KB
subtask2_19.txt AC 36 ms 3572 KB
subtask2_20.txt AC 36 ms 3532 KB
subtask2_21.txt AC 33 ms 3368 KB
subtask2_22.txt AC 35 ms 3608 KB
subtask2_23.txt AC 36 ms 3416 KB
subtask2_24.txt AC 33 ms 3412 KB
subtask2_25.txt AC 35 ms 3524 KB
subtask2_26.txt AC 37 ms 3500 KB
subtask2_27.txt AC 33 ms 3576 KB
subtask2_28.txt AC 35 ms 3532 KB
subtask2_29.txt AC 36 ms 3368 KB