結果

問題 No.2592 おでぶなおばけさん 2
ユーザー ochiaigawaochiaigawa
提出日時 2023-12-20 12:09:19
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,002 bytes
コンパイル時間 2,668 ms
コンパイル使用メモリ 209,724 KB
実行使用メモリ 15,744 KB
最終ジャッジ日時 2023-12-20 12:09:37
合計ジャッジ時間 18,218 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,548 KB
testcase_01 AC 43 ms
8,704 KB
testcase_02 AC 43 ms
7,296 KB
testcase_03 AC 17 ms
6,548 KB
testcase_04 AC 15 ms
6,548 KB
testcase_05 AC 100 ms
15,360 KB
testcase_06 AC 46 ms
7,680 KB
testcase_07 AC 51 ms
7,424 KB
testcase_08 AC 62 ms
9,856 KB
testcase_09 AC 21 ms
6,548 KB
testcase_10 AC 15 ms
6,548 KB
testcase_11 AC 64 ms
10,112 KB
testcase_12 AC 14 ms
6,548 KB
testcase_13 AC 96 ms
11,008 KB
testcase_14 AC 95 ms
11,136 KB
testcase_15 AC 69 ms
8,320 KB
testcase_16 AC 95 ms
11,136 KB
testcase_17 AC 109 ms
12,544 KB
testcase_18 AC 69 ms
8,320 KB
testcase_19 AC 56 ms
6,656 KB
testcase_20 AC 67 ms
8,576 KB
testcase_21 AC 49 ms
6,548 KB
testcase_22 AC 95 ms
11,648 KB
testcase_23 WA -
testcase_24 AC 82 ms
9,728 KB
testcase_25 AC 46 ms
6,548 KB
testcase_26 AC 47 ms
6,548 KB
testcase_27 WA -
testcase_28 AC 146 ms
15,744 KB
testcase_29 AC 143 ms
15,744 KB
testcase_30 WA -
testcase_31 AC 139 ms
15,744 KB
testcase_32 AC 153 ms
15,744 KB
testcase_33 AC 147 ms
15,744 KB
testcase_34 AC 144 ms
15,744 KB
testcase_35 AC 142 ms
15,744 KB
testcase_36 AC 141 ms
15,744 KB
testcase_37 AC 139 ms
15,744 KB
testcase_38 AC 143 ms
15,744 KB
testcase_39 AC 146 ms
15,744 KB
testcase_40 AC 155 ms
15,744 KB
testcase_41 AC 141 ms
15,744 KB
testcase_42 AC 140 ms
15,744 KB
testcase_43 AC 143 ms
15,744 KB
testcase_44 AC 140 ms
15,744 KB
testcase_45 AC 144 ms
15,744 KB
testcase_46 AC 144 ms
15,744 KB
testcase_47 AC 134 ms
15,744 KB
testcase_48 AC 135 ms
15,744 KB
testcase_49 AC 137 ms
15,744 KB
testcase_50 AC 137 ms
15,744 KB
testcase_51 AC 135 ms
15,744 KB
testcase_52 AC 143 ms
15,744 KB
testcase_53 AC 146 ms
15,744 KB
testcase_54 AC 144 ms
15,744 KB
testcase_55 AC 146 ms
15,744 KB
testcase_56 AC 146 ms
15,744 KB
testcase_57 AC 91 ms
15,744 KB
testcase_58 AC 143 ms
15,744 KB
testcase_59 AC 142 ms
15,744 KB
testcase_60 AC 143 ms
15,744 KB
testcase_61 AC 140 ms
15,744 KB
testcase_62 AC 146 ms
15,744 KB
testcase_63 AC 141 ms
15,744 KB
testcase_64 AC 142 ms
15,744 KB
testcase_65 AC 139 ms
15,744 KB
testcase_66 AC 139 ms
15,744 KB
testcase_67 AC 138 ms
15,744 KB
testcase_68 AC 140 ms
15,744 KB
testcase_69 AC 140 ms
15,744 KB
testcase_70 AC 140 ms
15,744 KB
testcase_71 AC 164 ms
15,744 KB
testcase_72 AC 140 ms
15,744 KB
testcase_73 AC 141 ms
15,744 KB
testcase_74 AC 2 ms
6,676 KB
testcase_75 AC 144 ms
15,744 KB
testcase_76 AC 143 ms
15,744 KB
testcase_77 AC 142 ms
15,744 KB
testcase_78 AC 144 ms
15,744 KB
testcase_79 AC 144 ms
15,744 KB
testcase_80 AC 147 ms
15,744 KB
testcase_81 AC 143 ms
15,744 KB
testcase_82 AC 142 ms
15,744 KB
testcase_83 AC 141 ms
15,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
vector<long long> m = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43};
const int sz = m.size();
int main() {
  cin.tie(0); cout.tie(0);
  ios::sync_with_stdio(false);
  int N, Q;
  long long K;
  cin >> N >> Q >> K;
  vector<long long> A(N);
  for(int i = 0; i < N; i++) {
    cin >> A[i];
  }
  vector<vector<long long>> C(sz, vector<long long>(N + 1));
  vector<long long> p(sz, 1);
  vector<long long> k(sz);
  for(int i = 0; i < sz; i++) {
    k[i] = K % m[i];
  }
  for(int i = 0; i < N; i++) {
    for(int j = 0; j < sz; j++) {
      C[j][i + 1] = (C[j][i] + A[i] % m[j] * p[j] % m[j] + m[j]) % m[j];
      p[j] = p[j] * k[j] % m[j];
    }
  }
  while(Q--) {
    int L, R;
    cin >> L >> R;
    --L;
    bool fn = false;
    for(int i = 0; i < sz; i++) {
      if(C[i][R] - C[i][L] != 0) {
        fn = true;
      }
    }
    cout << (fn ? "Yes\n" : "No\n");
  }
  return 0;
}
0