結果
| 問題 | No.1092 modular arithmetic |
| ユーザー |
|
| 提出日時 | 2020-06-25 19:21:45 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 222 bytes |
| 記録 | |
| コンパイル時間 | 257 ms |
| コンパイル使用メモリ | 84,992 KB |
| 実行使用メモリ | 1,337,188 KB |
| 最終ジャッジ日時 | 2026-03-25 04:52:18 |
| 合計ジャッジ時間 | 4,455 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 4 MLE * 3 -- * 25 |
ソースコード
p,n=map(int,input().split())
a=input().split()[::-1]
t=a.pop()
op=list(input())[::-1]
while op:
x=op.pop()
if x=='/':
t*=pow(int(a.pop()),p-2,p)
else:
t=eval(str(t)+x+a.pop())
t%=p
print(t)