結果
問題 | No.2592 おでぶなおばけさん 2 |
ユーザー | 👑 hos.lyric |
提出日時 | 2023-12-20 00:11:28 |
言語 | D (dmd 2.106.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,329 bytes |
コンパイル時間 | 1,031 ms |
コンパイル使用メモリ | 117,692 KB |
実行使用メモリ | 27,360 KB |
最終ジャッジ日時 | 2024-09-27 09:12:38 |
合計ジャッジ時間 | 42,218 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
6,816 KB |
testcase_01 | AC | 106 ms
11,080 KB |
testcase_02 | AC | 183 ms
10,032 KB |
testcase_03 | AC | 69 ms
6,940 KB |
testcase_04 | AC | 76 ms
6,940 KB |
testcase_05 | AC | 275 ms
21,372 KB |
testcase_06 | AC | 188 ms
9,804 KB |
testcase_07 | AC | 251 ms
10,216 KB |
testcase_08 | AC | 208 ms
13,224 KB |
testcase_09 | AC | 70 ms
6,944 KB |
testcase_10 | AC | 96 ms
6,944 KB |
testcase_11 | AC | 206 ms
13,548 KB |
testcase_12 | AC | 45 ms
6,940 KB |
testcase_13 | AC | 438 ms
14,808 KB |
testcase_14 | AC | 438 ms
15,024 KB |
testcase_15 | AC | 370 ms
11,116 KB |
testcase_16 | AC | 434 ms
14,804 KB |
testcase_17 | AC | 459 ms
23,936 KB |
testcase_18 | AC | 375 ms
12,088 KB |
testcase_19 | AC | 304 ms
10,748 KB |
testcase_20 | AC | 368 ms
12,236 KB |
testcase_21 | AC | 304 ms
8,328 KB |
testcase_22 | AC | 427 ms
17,280 KB |
testcase_23 | AC | 475 ms
23,252 KB |
testcase_24 | AC | 404 ms
13,936 KB |
testcase_25 | AC | 296 ms
7,492 KB |
testcase_26 | AC | 291 ms
7,508 KB |
testcase_27 | AC | 515 ms
23,160 KB |
testcase_28 | AC | 521 ms
21,628 KB |
testcase_29 | AC | 526 ms
22,072 KB |
testcase_30 | AC | 529 ms
21,984 KB |
testcase_31 | AC | 521 ms
23,240 KB |
testcase_32 | AC | 521 ms
21,840 KB |
testcase_33 | AC | 522 ms
21,556 KB |
testcase_34 | AC | 519 ms
21,840 KB |
testcase_35 | AC | 515 ms
22,152 KB |
testcase_36 | AC | 519 ms
21,764 KB |
testcase_37 | AC | 516 ms
21,976 KB |
testcase_38 | AC | 514 ms
22,836 KB |
testcase_39 | AC | 515 ms
22,152 KB |
testcase_40 | AC | 520 ms
21,832 KB |
testcase_41 | AC | 517 ms
23,024 KB |
testcase_42 | AC | 518 ms
21,668 KB |
testcase_43 | AC | 516 ms
22,776 KB |
testcase_44 | AC | 524 ms
22,144 KB |
testcase_45 | AC | 520 ms
21,756 KB |
testcase_46 | AC | 519 ms
21,868 KB |
testcase_47 | AC | 520 ms
27,228 KB |
testcase_48 | AC | 507 ms
27,220 KB |
testcase_49 | AC | 511 ms
27,140 KB |
testcase_50 | AC | 508 ms
27,360 KB |
testcase_51 | AC | 506 ms
27,140 KB |
testcase_52 | AC | 516 ms
21,740 KB |
testcase_53 | AC | 517 ms
21,744 KB |
testcase_54 | AC | 515 ms
21,820 KB |
testcase_55 | AC | 518 ms
22,148 KB |
testcase_56 | AC | 509 ms
22,628 KB |
testcase_57 | AC | 207 ms
20,276 KB |
testcase_58 | AC | 515 ms
22,688 KB |
testcase_59 | AC | 515 ms
21,924 KB |
testcase_60 | AC | 518 ms
23,248 KB |
testcase_61 | AC | 520 ms
21,856 KB |
testcase_62 | AC | 518 ms
21,836 KB |
testcase_63 | AC | 525 ms
22,208 KB |
testcase_64 | AC | 519 ms
21,568 KB |
testcase_65 | AC | 522 ms
21,000 KB |
testcase_66 | WA | - |
testcase_67 | AC | 510 ms
21,184 KB |
testcase_68 | AC | 511 ms
21,240 KB |
testcase_69 | AC | 511 ms
21,504 KB |
testcase_70 | WA | - |
testcase_71 | WA | - |
testcase_72 | AC | 516 ms
22,636 KB |
testcase_73 | AC | 514 ms
21,644 KB |
testcase_74 | AC | 1 ms
6,944 KB |
testcase_75 | AC | 514 ms
21,952 KB |
testcase_76 | AC | 517 ms
22,020 KB |
testcase_77 | AC | 515 ms
21,920 KB |
testcase_78 | AC | 516 ms
22,688 KB |
testcase_79 | AC | 518 ms
21,924 KB |
testcase_80 | AC | 520 ms
21,916 KB |
testcase_81 | AC | 522 ms
21,672 KB |
testcase_82 | AC | 525 ms
21,636 KB |
testcase_83 | AC | 519 ms
22,152 KB |
ソースコード
import std.conv, std.functional, std.range, std.stdio, std.string; import std.algorithm, std.array, std.bigint, std.bitmanip, std.complex, std.container, std.math, std.mathspecial, std.numeric, std.regex, std.typecons; import core.bitop; class EOFException : Throwable { this() { super("EOF"); } } string[] tokens; string readToken() { for (; tokens.empty; ) { if (stdin.eof) { throw new EOFException; } tokens = readln.split; } auto token = tokens.front; tokens.popFront; return token; } int readInt() { return readToken.to!int; } long readLong() { return readToken.to!long; } string COLOR(string s = "") { return "\x1b[" ~ s ~ "m"; } bool chmin(T)(ref T t, in T f) { if (t > f) { t = f; return true; } else { return false; } } bool chmax(T)(ref T t, in T f) { if (t < f) { t = f; return true; } else { return false; } } int binarySearch(alias pred, T)(in T[] as) { int lo = -1, hi = cast(int)(as.length); for (; lo + 1 < hi; ) { const mid = (lo + hi) >> 1; (unaryFun!pred(as[mid]) ? hi : lo) = mid; } return hi; } int lowerBound(T)(in T[] as, T val) { return as.binarySearch!(a => (a >= val)); } int upperBound(T)(in T[] as, T val) { return as.binarySearch!(a => (a > val)); } enum MS = [1100000009, 1100000017, 1100000051, 1100000059, 1100000081, 1100000123, 1100000149, 1100000159, 1100000177, 1100000179]; enum H = cast(int)(MS.length); void main() { try { for (; ; ) { const N = readInt; const Q = readInt; const K = readLong; auto A = new long[N]; foreach (i; 0 .. N) { A[i] = readLong; } auto L = new int[Q]; auto R = new int[Q]; foreach (q; 0 .. Q) { L[q] = readInt - 1; R[q] = readInt; } auto KK = new long[][](H, N + 1); auto fss = new long[][](H, N + 1); foreach (h; 0 .. H) { KK[h][0] = 1; foreach (i; 1 .. N + 1) { KK[h][i] = (KK[h][i - 1] * K) % MS[h]; } foreach_reverse (i; 0 .. N) { fss[h][i] = (A[i] + K * fss[h][i + 1]) % MS[h]; } } foreach (q; 0 .. Q) { bool ans; foreach (h; 0 .. H) { long val = (fss[h][L[q]] - KK[h][R[q] - L[q]] * fss[h][R[q]]) % MS[h]; ans = ans || val; } writeln(ans ? "Yes" : "No"); } } } catch (EOFException e) { } }