結果

問題 No.2490 Escalator
ユーザー SSRSSSRS
提出日時 2023-09-29 22:46:31
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,179 bytes
コンパイル時間 5,007 ms
コンパイル使用メモリ 240,040 KB
実行使用メモリ 24,992 KB
最終ジャッジ日時 2023-09-29 22:46:45
合計ジャッジ時間 12,794 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 1 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 5 ms
4,376 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 1 ms
4,384 KB
testcase_19 AC 2 ms
4,384 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 1 ms
4,380 KB
testcase_22 AC 1 ms
4,384 KB
testcase_23 AC 1 ms
4,384 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 142 ms
24,716 KB
testcase_45 AC 140 ms
24,516 KB
testcase_46 WA -
testcase_47 WA -
testcase_48 AC 141 ms
24,816 KB
testcase_49 AC 139 ms
24,652 KB
testcase_50 AC 152 ms
24,816 KB
testcase_51 AC 150 ms
24,652 KB
testcase_52 AC 142 ms
24,860 KB
testcase_53 AC 143 ms
24,652 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 133 ms
24,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
  }
}
0