結果

問題 No.1503 Bitwise And Convolution Twisted
ユーザー noshi91noshi91
提出日時 2020-12-31 22:54:06
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 541 bytes
コンパイル時間 909 ms
コンパイル使用メモリ 76,128 KB
実行使用メモリ 14,848 KB
最終ジャッジ日時 2024-04-26 21:42:35
合計ジャッジ時間 6,662 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
10,752 KB
testcase_01 AC 2 ms
5,248 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 1,129 ms
5,376 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>

int main() {
  using ll = long long;

  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);

  int N;
  std::cin >> N;
  const int m = 1 << N;
  std::vector<ll> A(m), B(m), C(m, 0);
  for (ll &e : A) {
    std::cin >> e;
  }
  for (ll &e : B) {
    std::cin >> e;
  }

  for (int k = 0; k != m; ++k) {
    for (int i = 0; i != m; ++i) {
      C[k] = (C[k] + A[i] * B[i & k]) % 998244353;
    }
  }

  for (int i = 0; i != m; ++i) {
    std::cout << C[i] << " \n"[i + 1 == m];
  }

  return 0;
}
0