結果

問題 No.523 LED
ユーザー chinchillachinchilla
提出日時 2020-02-25 02:15:03
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 1,911 ms / 2,000 ms
コード長 399 bytes
コンパイル時間 151 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 272,004 KB
最終ジャッジ日時 2024-10-12 22:34:50
合計ジャッジ時間 12,106 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import accumulate
m = 1000000007
n = int(input())
d = n*2
mm = lambda x, y: x*y%m
p1, p5 = (list(accumulate(range(r, d+1, 6), mm)) for r in [1, 5])
s, k = 0, n
while k: k//=2; s+=k
p = pow(2, s, m)
s, k = 0, d
while k: k//=3; s+=k
p = mm(p, pow(3, s, m))
k = d
while k:
	l = k
	while l:
		if l>=1: p = mm(p, p1[(l-1)//6])
		if l>=5: p = mm(p, p5[(l-5)//6])
		l //= 3
	k //= 2
print(p)
0