結果

問題 No.420 mod2漸化式
ユーザー 37kt_
提出日時 2016-09-11 01:15:01
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 36 ms / 1,000 ms
コード長 271 bytes
コンパイル時間 334 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-12-24 11:33:03
合計ジャッジ時間 2,575 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

x = int(input())
if x > 31:
  print(0, 0)
  exit()

c = [[0 for i in range(32)] for j in range(32)]
c[0][0] = 1
for i in range(31):
  for j in range(31):
    c[i + 1][j] += c[i][j]
    c[i + 1][j + 1] += c[i][j]
s = c[31][x]
t = ((1 << 31) - 1) * s * x // 31
print(s, t)
0