結果

問題 No.523 LED
ユーザー chinchillachinchilla
提出日時 2020-02-25 02:15:03
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 1,466 ms / 2,000 ms
コード長 399 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 10,744 KB
実行使用メモリ 269,576 KB
最終ジャッジ日時 2023-08-03 00:26:26
合計ジャッジ時間 9,587 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,116 KB
testcase_01 AC 17 ms
8,268 KB
testcase_02 AC 32 ms
11,176 KB
testcase_03 AC 15 ms
8,192 KB
testcase_04 AC 15 ms
8,160 KB
testcase_05 AC 1,466 ms
269,576 KB
testcase_06 AC 15 ms
8,256 KB
testcase_07 AC 16 ms
8,188 KB
testcase_08 AC 16 ms
8,260 KB
testcase_09 AC 24 ms
9,748 KB
testcase_10 AC 14 ms
8,156 KB
testcase_11 AC 15 ms
8,240 KB
testcase_12 AC 15 ms
8,252 KB
testcase_13 AC 286 ms
58,216 KB
testcase_14 AC 15 ms
8,240 KB
testcase_15 AC 18 ms
8,336 KB
testcase_16 AC 15 ms
8,272 KB
testcase_17 AC 16 ms
8,524 KB
testcase_18 AC 1,453 ms
269,332 KB
testcase_19 AC 534 ms
101,112 KB
testcase_20 AC 476 ms
90,264 KB
testcase_21 AC 1,098 ms
203,516 KB
testcase_22 AC 1,239 ms
227,360 KB
testcase_23 AC 1,217 ms
227,244 KB
testcase_24 AC 40 ms
12,780 KB
権限があれば一括ダウンロードができます

ソースコード

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