Submission #58937979


Source Code Expand

#include <bits/stdc++.h>

using namespace std;

int main() {
    int n, c;

    cin >> n >> c;

    int cnt = 0;
    int prev_sec = -c;
    for(int i = 0; i < n; i++) {
        int t;
        cin >> t;
        if(t - prev_sec >= c) {
            cnt++;
            prev_sec = t;
        }
    }
    cout << cnt << endl;

    return 0;
}

Submission Info

Submission Time
Task A - Candy Button
User nnth_y
Language C++ 20 (gcc 12.2)
Score 150
Code Size 360 Byte
Status AC
Exec Time 1 ms
Memory 3500 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 3488 KiB
00_sample_01.txt AC 1 ms 3428 KiB
00_sample_02.txt AC 1 ms 3480 KiB
01_random_00.txt AC 1 ms 3364 KiB
01_random_01.txt AC 1 ms 3428 KiB
01_random_02.txt AC 1 ms 3440 KiB
01_random_03.txt AC 1 ms 3456 KiB
01_random_04.txt AC 1 ms 3460 KiB
01_random_05.txt AC 1 ms 3492 KiB
01_random_06.txt AC 1 ms 3440 KiB
01_random_07.txt AC 1 ms 3444 KiB
02_handmade_00.txt AC 1 ms 3496 KiB
02_handmade_01.txt AC 1 ms 3452 KiB
02_handmade_02.txt AC 1 ms 3500 KiB
02_handmade_03.txt AC 1 ms 3364 KiB
02_handmade_04.txt AC 1 ms 3484 KiB
02_handmade_05.txt AC 1 ms 3432 KiB