提出 #75649313


ソースコード 拡げる

#include <bits/stdc++.h>

using namespace std;
using ll=long long;

const int MXN=2e5+1;

ll N,K,A[MXN],P[MXN],L[MXN],C[MXN];

int main() {
    cin.tie(0)->sync_with_stdio(0);

    cin>>N>>K;
    
    for(int i=0;i<N;i++) {
        cin>>L[i];
        P[i+1]=P[i]+L[i];
        for(int j=0;j<L[i];j++) cin>>A[P[i]+j];
    }

    for(int i=0;i<N;i++) cin>>C[i];
    
    for(int i=0;i<N;i++) if((K-C[i]*L[i])<=0) {
        cout<<A[P[i]+(K-1)%L[i]];
        break;
    } else K-=C[i]*L[i];
}

提出情報

提出日時
問題 C - Long Sequence
ユーザ strain7626
言語 C++23 (GCC 15.2.0)
得点 300
コード長 514 Byte
結果 AC
実行時間 24 ms
メモリ 9876 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 3
AC × 23
セット名 テストケース
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
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 1 ms 3444 KiB
00_sample_01.txt AC 1 ms 3688 KiB
00_sample_02.txt AC 1 ms 3612 KiB
01_random_00.txt AC 14 ms 6112 KiB
01_random_01.txt AC 19 ms 7704 KiB
01_random_02.txt AC 12 ms 5784 KiB
01_random_03.txt AC 18 ms 7228 KiB
01_random_04.txt AC 18 ms 7452 KiB
01_random_05.txt AC 16 ms 6976 KiB
01_random_06.txt AC 13 ms 5876 KiB
01_random_07.txt AC 24 ms 9716 KiB
01_random_08.txt AC 10 ms 5212 KiB
01_random_09.txt AC 21 ms 8528 KiB
01_random_10.txt AC 10 ms 5224 KiB
01_random_11.txt AC 10 ms 5084 KiB
01_random_12.txt AC 10 ms 5108 KiB
01_random_13.txt AC 24 ms 9788 KiB
01_random_14.txt AC 24 ms 9752 KiB
01_random_15.txt AC 24 ms 9876 KiB
01_random_16.txt AC 22 ms 8764 KiB
01_random_17.txt AC 19 ms 7648 KiB
01_random_18.txt AC 17 ms 7144 KiB
01_random_19.txt AC 10 ms 5276 KiB