結果
問題 | No.2490 Escalator |
ユーザー | SSRS |
提出日時 | 2023-09-29 22:46:31 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,179 bytes |
コンパイル時間 | 3,655 ms |
コンパイル使用メモリ | 243,760 KB |
実行使用メモリ | 25,176 KB |
最終ジャッジ日時 | 2024-07-22 16:44:10 |
合計ジャッジ時間 | 11,193 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | AC | 2 ms
6,940 KB |
testcase_11 | AC | 1 ms
6,944 KB |
testcase_12 | AC | 2 ms
6,944 KB |
testcase_13 | AC | 2 ms
6,940 KB |
testcase_14 | AC | 2 ms
6,940 KB |
testcase_15 | AC | 2 ms
6,940 KB |
testcase_16 | AC | 2 ms
6,940 KB |
testcase_17 | AC | 2 ms
6,944 KB |
testcase_18 | AC | 2 ms
6,940 KB |
testcase_19 | AC | 2 ms
6,940 KB |
testcase_20 | AC | 2 ms
6,940 KB |
testcase_21 | AC | 2 ms
6,940 KB |
testcase_22 | AC | 1 ms
6,940 KB |
testcase_23 | AC | 2 ms
6,940 KB |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | WA | - |
testcase_37 | WA | - |
testcase_38 | WA | - |
testcase_39 | WA | - |
testcase_40 | WA | - |
testcase_41 | WA | - |
testcase_42 | WA | - |
testcase_43 | WA | - |
testcase_44 | AC | 139 ms
24,908 KB |
testcase_45 | AC | 136 ms
24,864 KB |
testcase_46 | WA | - |
testcase_47 | WA | - |
testcase_48 | AC | 140 ms
24,904 KB |
testcase_49 | AC | 140 ms
25,036 KB |
testcase_50 | AC | 135 ms
24,908 KB |
testcase_51 | AC | 139 ms
24,900 KB |
testcase_52 | AC | 138 ms
24,964 KB |
testcase_53 | AC | 139 ms
25,032 KB |
testcase_54 | WA | - |
testcase_55 | WA | - |
testcase_56 | WA | - |
testcase_57 | WA | - |
testcase_58 | WA | - |
testcase_59 | WA | - |
testcase_60 | WA | - |
testcase_61 | WA | - |
testcase_62 | WA | - |
testcase_63 | WA | - |
testcase_64 | WA | - |
testcase_65 | WA | - |
testcase_66 | WA | - |
testcase_67 | WA | - |
testcase_68 | WA | - |
testcase_69 | WA | - |
testcase_70 | WA | - |
testcase_71 | WA | - |
testcase_72 | WA | - |
testcase_73 | WA | - |
testcase_74 | AC | 127 ms
25,032 KB |
testcase_75 | AC | 125 ms
24,908 KB |
ソースコード
#include <bits/stdc++.h> #include <atcoder/convolution> using namespace std; const long long MOD = 998244353; int main(){ int N; cin >> N; vector<int> A(N * 2); for (int i = 0; i < N * 2; i++){ cin >> A[i]; if (A[i] == -1){ A[i] = 0; } } vector<int> B(N * 4); for (int i = 0; i < N * 2; i++){ B[i] = A[i]; B[N * 2 + i] = A[i]; } vector<long long> A1(N * 2), A2(N * 2), A3(N * 2); for (int i = 0; i < N * 2; i++){ A1[i] = A[i]; A2[i] = (long long) A[i] * A[i] % MOD; A3[i] = (long long) A[i] * A[i] * A[i] % MOD; } vector<long long> B1(N * 4), B2(N * 4), B3(N * 4); for (int i = 0; i < N * 4; i++){ B1[i] = B[i]; B2[i] = (long long) B[i] * B[i] % MOD; B3[i] = (long long) B[i] * B[i] * B[i] % MOD;; } vector<long long> A1B3 = atcoder::convolution(A1, B3); vector<long long> A2B2 = atcoder::convolution(A2, B2); vector<long long> A3B1 = atcoder::convolution(A3, B1); bool ok = false; for (int i = N * 2; i < N * 4; i++){ if ((A1B3[i] - A2B2[i] * 2 + A3B1[i] + MOD * 2) % MOD == 0){ ok = true; } } if (ok){ cout << "Yes" << endl; } else { cout << "No" << endl; } }