Submission #75670053


Source Code Expand

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

int main() {

    int N;
    long long K;
    cin >> N >> K;

    vector<vector<int>> A(N);
    vector<long long> C(N);

    for (int i = 0; i < N; i++) {

        int L;
        cin >> L >> C.at(i);

        A.at(i).resize(L);

        for (int j = 0; j < L; j++) {
            cin >> A.at(i).at(j);
        }
    }

    for (int i = 0; i < N; i++) {

        long long block = A.at(i).size() * C.at(i);

        if (K > block) {
            K -= block;
        }
        else {

            // Ai の中の何番目か
            long long index = (K - 1) % A.at(i).size();

            cout << A.at(i).at(index) << endl;
            return 0;
        }
    }
}

Submission Info

Submission Time
Task C - Long Sequence
User naka0713
Language C++23 (GCC 15.2.0)
Score 0
Code Size 751 Byte
Status WA
Exec Time 1540 ms
Memory > 1048576 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
WA × 3
WA × 12
MLE × 11
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
Case Name Status Exec Time Memory
00_sample_00.txt WA 1 ms 3500 KiB
00_sample_01.txt WA 1 ms 3384 KiB
00_sample_02.txt WA 1 ms 3496 KiB
01_random_00.txt WA 842 ms 467348 KiB
01_random_01.txt WA 313 ms 143284 KiB
01_random_02.txt MLE 486 ms > 1048576 KiB
01_random_03.txt MLE 537 ms > 1048576 KiB
01_random_04.txt MLE 517 ms > 1048576 KiB
01_random_05.txt WA 1323 ms 728272 KiB
01_random_06.txt MLE 496 ms > 1048576 KiB
01_random_07.txt WA 337 ms 125132 KiB
01_random_08.txt MLE 478 ms > 1048576 KiB
01_random_09.txt MLE 481 ms > 1048576 KiB
01_random_10.txt WA 50 ms 4116 KiB
01_random_11.txt WA 50 ms 4044 KiB
01_random_12.txt WA 50 ms 4116 KiB
01_random_13.txt MLE 483 ms > 1048576 KiB
01_random_14.txt MLE 479 ms > 1048576 KiB
01_random_15.txt WA 1540 ms 842492 KiB
01_random_16.txt WA 1092 ms 586300 KiB
01_random_17.txt MLE 478 ms > 1048576 KiB
01_random_18.txt MLE 479 ms > 1048576 KiB
01_random_19.txt MLE 479 ms > 1048576 KiB