Submission #73482487


Source Code Expand

#include<bits/stdc++.h>
#include"atcoder/all"
using namespace std;
using namespace atcoder;
#define int long
int inf = 2000000000000000000;
signed main(){
    int n;cin>>n;
    int a[n];
    for(int i=0;i<n;i++)cin>>a[i];
    map<int,int>ma;
    int ans=0;
    for(int i=0;i<n;i++){
        ma[a[i]]=max(ma[a[i]],ma[a[i]-1]+1);
        ans=max(ans,ma[a[i]]);
    }
    cout<<ans<<"\n";
}

Submission Info

Submission Time
Task D - Max Straight
User Sabakanmelm
Language C++23 (GCC 15.2.0)
Score 400
Code Size 404 Byte
Status AC
Exec Time 181 ms
Memory 30100 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 3
AC × 26
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, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 01_random_21.txt, 01_random_22.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3488 KiB
00_sample_01.txt AC 1 ms 3424 KiB
00_sample_02.txt AC 1 ms 3424 KiB
01_random_00.txt AC 1 ms 3552 KiB
01_random_01.txt AC 1 ms 3528 KiB
01_random_02.txt AC 1 ms 3428 KiB
01_random_03.txt AC 111 ms 17596 KiB
01_random_04.txt AC 122 ms 17644 KiB
01_random_05.txt AC 100 ms 19188 KiB
01_random_06.txt AC 45 ms 11392 KiB
01_random_07.txt AC 181 ms 30100 KiB
01_random_08.txt AC 31 ms 4320 KiB
01_random_09.txt AC 1 ms 3688 KiB
01_random_10.txt AC 76 ms 5228 KiB
01_random_11.txt AC 78 ms 5300 KiB
01_random_12.txt AC 7 ms 3760 KiB
01_random_13.txt AC 82 ms 5344 KiB
01_random_14.txt AC 2 ms 3720 KiB
01_random_15.txt AC 90 ms 5672 KiB
01_random_16.txt AC 46 ms 4688 KiB
01_random_17.txt AC 80 ms 17644 KiB
01_random_18.txt AC 76 ms 17388 KiB
01_random_19.txt AC 86 ms 17672 KiB
01_random_20.txt AC 58 ms 13448 KiB
01_random_21.txt AC 111 ms 17608 KiB
01_random_22.txt AC 9 ms 4692 KiB