結果

問題 No.420 mod2漸化式
コンテスト
ユーザー ああいい
提出日時 2022-04-21 14:42:24
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 25 ms / 1,000 ms
コード長 295 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 248 ms
コンパイル使用メモリ 85,684 KB
実行使用メモリ 53,892 KB
最終ジャッジ日時 2026-03-06 23:53:46
合計ジャッジ時間 1,986 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

x = int(input())

import sys
if x > 31:
    print(0,0)
    exit()
if x == 0:
    print(1,0)
    exit()
ans = 0
comb = 1
for i in range(x- 1):
    comb *= (30 - i)
for i in range(x - 1):
    comb //= (i + 1)
for i in range(31):
    ans += (1 << i) * comb
count = comb * 31 // x
print(count,ans)
0