結果

問題 No.147 試験監督(2)
ユーザー kimiyukikimiyuki
提出日時 2016-02-27 10:54:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 342 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 11,960 KB
実行使用メモリ 229,484 KB
最終ジャッジ日時 2023-10-24 18:25:33
合計ジャッジ時間 6,852 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 MLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
mod = int(1e9+7)
def fib(n, memo = { 0: 1, 1: 1 }):
    if n not in memo:
        a, b = n//2, n-n//2
        memo[n] = (fib(a) * fib(b) + fib(a-1) * fib(b-1)) % mod
    return memo[n]
n = int(input())
ans = 1
for i in range(n):
    c, d = map(int,input().split())
    ans = ans * pow(fib(c+1), d, mod) % mod
print(ans)
0