結果

問題 No.1310 量子アニーリング
ユーザー wolgnikwolgnik
提出日時 2020-12-07 21:01:44
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 752 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 81,808 KB
実行使用メモリ 92,044 KB
最終ジャッジ日時 2023-10-17 16:39:45
合計ジャッジ時間 2,761 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,564 KB
testcase_01 AC 36 ms
53,564 KB
testcase_02 AC 36 ms
53,564 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 36 ms
53,564 KB
testcase_06 WA -
testcase_07 AC 41 ms
53,564 KB
testcase_08 AC 36 ms
53,564 KB
testcase_09 AC 35 ms
53,564 KB
testcase_10 WA -
testcase_11 AC 45 ms
62,392 KB
testcase_12 AC 51 ms
64,468 KB
testcase_13 AC 78 ms
72,084 KB
testcase_14 AC 93 ms
76,292 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 135 ms
87,932 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 67 ms
69,148 KB
testcase_21 AC 57 ms
66,112 KB
testcase_22 AC 161 ms
92,028 KB
testcase_23 AC 79 ms
72,132 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
N = int(input())
mod = 998244353
res = 0

class Factorial:
  def __init__(self, n, mod):
    self.mod = mod
    self.f = [1]
    for i in range(1, n + 1):
      self.f.append(self.f[-1] * i % mod)
    self.i = [pow(self.f[-1], mod - 2, mod)]
    for i in range(1, n + 1)[: : -1]:
      self.i.append(self.i[-1] * i % mod)
    self.i.reverse()
  def factorial(self, i): return self.f[i]
  def ifactorial(self, i): return self.i[i]
  def combi(self, n, k): return self.f[n] * self.i[n - k] % self.mod * self.i[k] % self.mod
  def permi(self, n, k): return self.f[n] * self.i[n - k] % self.mod

f = Factorial(N, mod)

for i in range(N + 1):
  res += f.combi(N, i) * pow(2, abs(N - 2 * i), mod)
  res %= mod
print(res)
0