提出 #75638451


ソースコード 拡げる

#include <bits/stdc++.h>
using namespace std;
int main() {
    int64_t N;
    cin >> N;
    int64_t K;
    cin >> K;
    vector<int64_t> L(N);
    vector<vector<int64_t>> A(N);
    for (int64_t i = 0; i < N; i++) {
      cin >> L.at(i);
      A.at(i).resize(L.at(i));
      for (int64_t j = 0; j < L.at(i); j++) {
        cin >> A.at(i).at(j);
      }
    }
    vector<int64_t> C(N);
    for (int64_t i = 0; i < N; i++) {
      cin >> C.at(i);
    }
    for (int64_t i = 0; i < N; i++) {
      if (K - C.at(i)*L.at(i) <= 0) {
        cout << A.at(i).at((K-1)%L.at(i)) << endl;
        break;
      }
      else {
        K -= C.at(i)*L.at(i);
      }
    }
    return 0;
  }

提出情報

提出日時
問題 C - Long Sequence
ユーザ KOJIKEE
言語 C++23 (GCC 15.2.0)
得点 300
コード長 704 Byte
結果 AC
実行時間 117 ms
メモリ 17232 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 3524 KiB
00_sample_01.txt AC 1 ms 3524 KiB
00_sample_02.txt AC 1 ms 3416 KiB
01_random_00.txt AC 62 ms 7136 KiB
01_random_01.txt AC 85 ms 10816 KiB
01_random_02.txt AC 55 ms 6004 KiB
01_random_03.txt AC 80 ms 9808 KiB
01_random_04.txt AC 82 ms 9920 KiB
01_random_05.txt AC 72 ms 8672 KiB
01_random_06.txt AC 58 ms 6284 KiB
01_random_07.txt AC 115 ms 16884 KiB
01_random_08.txt AC 49 ms 5452 KiB
01_random_09.txt AC 99 ms 13664 KiB
01_random_10.txt AC 47 ms 4832 KiB
01_random_11.txt AC 47 ms 4672 KiB
01_random_12.txt AC 47 ms 4832 KiB
01_random_13.txt AC 117 ms 17232 KiB
01_random_14.txt AC 116 ms 17164 KiB
01_random_15.txt AC 116 ms 17232 KiB
01_random_16.txt AC 102 ms 14116 KiB
01_random_17.txt AC 85 ms 10960 KiB
01_random_18.txt AC 78 ms 9508 KiB
01_random_19.txt AC 49 ms 5236 KiB