提出 #704850


ソースコード 拡げる

#include<bits/stdc++.h>
using namespace std;

int main(){
	int N,M,T;
	int a;
	int b = 0;
	int total = 0;
	cin >> N;
	cin >> M;
	cin >> T;
	if(N == 0){
		cout << T << endl;
		return 0;
	}
	cin >> a;//a ken me

	if(a >= M){
		total += a - M;
	}


	for(int i = 1; i < N; i++){
			cin >> b;
			if(b - a >= 2*M){ //do study
				 total += b - a - 2*M;
			}
	//	else{//do not study
	//		
	//	}
		a = b;// 
			
	}
	
	

	if(T >= a + M){
		total += T - a - M;
	}

	cout << total << endl;
	return 0;
}

提出情報

提出日時
問題 B - 豪邸と宅配便
ユーザ order1
言語 C++14 (GCC 5.4.1)
得点 100
コード長 533 Byte
結果 AC
実行時間 5 ms
メモリ 256 KiB

ジャッジ結果

セット名 All
得点 / 配点 100 / 100
結果
AC × 23
セット名 テストケース
All 00_sample_00, 00_sample_01, 00_sample_02, 10_random_01, 10_random_02, 10_random_03, 10_random_04, 10_random_05, 10_random_06, 10_random_07, 10_random_08, 10_random_09, 10_random_10, 20_large_01, 20_large_02, 20_large_03, 20_large_04, 20_large_05, 30_do_not_return01, 30_do_not_return02, 30_do_not_return03, 30_do_not_return04, 30_do_not_return05
ケース名 結果 実行時間 メモリ
00_sample_00 AC 4 ms 256 KiB
00_sample_01 AC 4 ms 256 KiB
00_sample_02 AC 4 ms 256 KiB
10_random_01 AC 4 ms 256 KiB
10_random_02 AC 4 ms 256 KiB
10_random_03 AC 5 ms 256 KiB
10_random_04 AC 4 ms 256 KiB
10_random_05 AC 5 ms 256 KiB
10_random_06 AC 4 ms 256 KiB
10_random_07 AC 4 ms 256 KiB
10_random_08 AC 4 ms 256 KiB
10_random_09 AC 4 ms 256 KiB
10_random_10 AC 4 ms 256 KiB
20_large_01 AC 4 ms 256 KiB
20_large_02 AC 4 ms 256 KiB
20_large_03 AC 4 ms 256 KiB
20_large_04 AC 4 ms 256 KiB
20_large_05 AC 4 ms 256 KiB
30_do_not_return01 AC 4 ms 256 KiB
30_do_not_return02 AC 4 ms 256 KiB
30_do_not_return03 AC 4 ms 256 KiB
30_do_not_return04 AC 4 ms 256 KiB
30_do_not_return05 AC 4 ms 256 KiB