Submission #59034467


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
const int N=110;
int n,C,T[N];
int main(){
	cin>>n>>C;
	int lst=-1,ans=0;
	for(int i=1;i<=n;i++){
		cin>>T[i];
		if(lst==-1||T[i]-lst>=C){
			ans++;
			lst=T[i];
		}
	}
	cout<<ans<<"\n";
	return 0;
}

Submission Info

Submission Time
Task A - Candy Button
User jpy_cpp
Language C++ 20 (gcc 12.2)
Score 150
Code Size 260 Byte
Status AC
Exec Time 1 ms
Memory 3568 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 150 / 150
Status
AC × 3
AC × 17
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 02_handmade_00.txt, 02_handmade_01.txt, 02_handmade_02.txt, 02_handmade_03.txt, 02_handmade_04.txt, 02_handmade_05.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3476 KiB
00_sample_01.txt AC 1 ms 3388 KiB
00_sample_02.txt AC 1 ms 3368 KiB
01_random_00.txt AC 1 ms 3432 KiB
01_random_01.txt AC 1 ms 3428 KiB
01_random_02.txt AC 1 ms 3400 KiB
01_random_03.txt AC 1 ms 3416 KiB
01_random_04.txt AC 1 ms 3424 KiB
01_random_05.txt AC 1 ms 3564 KiB
01_random_06.txt AC 1 ms 3544 KiB
01_random_07.txt AC 1 ms 3492 KiB
02_handmade_00.txt AC 1 ms 3568 KiB
02_handmade_01.txt AC 1 ms 3384 KiB
02_handmade_02.txt AC 1 ms 3336 KiB
02_handmade_03.txt AC 1 ms 3396 KiB
02_handmade_04.txt AC 1 ms 3432 KiB
02_handmade_05.txt AC 1 ms 3416 KiB