結果

問題 No.492 IOI数列
ユーザー convexineqconvexineq
提出日時 2021-02-09 06:56:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 73 ms / 1,000 ms
コード長 220 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 87,176 KB
実行使用メモリ 71,668 KB
最終ジャッジ日時 2023-09-20 17:43:00
合計ジャッジ時間 3,064 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,632 KB
testcase_01 AC 73 ms
71,388 KB
testcase_02 AC 72 ms
71,552 KB
testcase_03 AC 71 ms
71,228 KB
testcase_04 AC 73 ms
71,208 KB
testcase_05 AC 73 ms
71,572 KB
testcase_06 AC 73 ms
71,444 KB
testcase_07 AC 70 ms
71,636 KB
testcase_08 AC 71 ms
71,668 KB
testcase_09 AC 72 ms
71,340 KB
testcase_10 AC 71 ms
71,628 KB
testcase_11 AC 71 ms
71,436 KB
testcase_12 AC 72 ms
71,624 KB
testcase_13 AC 72 ms
71,428 KB
testcase_14 AC 72 ms
71,324 KB
testcase_15 AC 73 ms
71,296 KB
testcase_16 AC 72 ms
71,352 KB
testcase_17 AC 71 ms
71,396 KB
testcase_18 AC 70 ms
71,188 KB
testcase_19 AC 71 ms
71,636 KB
testcase_20 AC 71 ms
71,328 KB
testcase_21 AC 73 ms
71,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(a,b,n,MOD):
    if n==0: return 1
    if n%2: return (a*f(a,b,n-1,MOD)+b)%MOD
    a,b = a*a%MOD,(a*b+b)%MOD
    return f(a,b,n//2,MOD)
n = int(input())-1
print(f(100,1,n,10**9+7))
print(f(100,1,n,int("10"*10+"1")))
0