Submission #71479239


Source Code Expand

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

int main(){
    int n;
    cin >> n;
    int A[n];
    for(int i = 0; i < n; i++) cin >> A[i];

    int MAX = 1;
    for(int i = 0; i < n; i++){
        if(i < MAX) MAX = max(MAX, A[i] + i);
    }

    cout << min(MAX, n) << endl;
}

Submission Info

Submission Time
Task C - Domino
User sakimori_coder
Language C++23 (GCC 15.2.0)
Score 300
Code Size 316 Byte
Status AC
Exec Time 89 ms
Memory 5688 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 20
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All min.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
min.txt AC 1 ms 3420 KiB
random_01.txt AC 86 ms 5456 KiB
random_02.txt AC 32 ms 4128 KiB
random_03.txt AC 87 ms 5440 KiB
random_04.txt AC 16 ms 4008 KiB
random_05.txt AC 84 ms 5688 KiB
random_06.txt AC 83 ms 5444 KiB
random_07.txt AC 84 ms 5328 KiB
random_08.txt AC 45 ms 4700 KiB
random_09.txt AC 84 ms 5468 KiB
random_10.txt AC 65 ms 4968 KiB
random_11.txt AC 84 ms 5536 KiB
random_12.txt AC 24 ms 4180 KiB
random_13.txt AC 41 ms 5476 KiB
random_14.txt AC 89 ms 5592 KiB
random_15.txt AC 87 ms 5444 KiB
random_16.txt AC 86 ms 5596 KiB
sample_01.txt AC 1 ms 3544 KiB
sample_02.txt AC 1 ms 3640 KiB
sample_03.txt AC 1 ms 3408 KiB