結果
| 問題 |
No.147 試験監督(2)
|
| コンテスト | |
| ユーザー |
ytft
|
| 提出日時 | 2021-03-16 15:58:50 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 502 bytes |
| コンパイル時間 | 177 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 1,077,996 KB |
| 最終ジャッジ日時 | 2024-11-08 01:47:54 |
| 合計ジャッジ時間 | 7,515 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | MLE * 1 -- * 3 |
ソースコード
def paw(a,b):
ret=1
i=b
temp=a
while i>0:
if i%2:
ret=(ret*temp)%MOD
i=i//2
temp=(temp**2)%MOD
return ret
N=int(input())
ans=1
MOD=10**9+7
C=[]
D=[]
m=0
for i in range(N):
p,q=map(int,input().split())
C.append(p)
D.append(q)
m=max(m,p)
dp=[[1],[0]]
for i in range(m):
dp[0].append((dp[0][i]+dp[1][i])%MOD)
dp[1].append(dp[0][i]%MOD)
for i in range(N):
ans=(ans*paw((dp[0][C[i]]+dp[1][C[i]])%MOD,D[i]))%MOD
print(ans)
ytft