結果
| 問題 | No.1092 modular arithmetic |
| ユーザー |
|
| 提出日時 | 2020-06-25 19:23:10 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 736 ms / 2,000 ms |
| コード長 | 237 bytes |
| 記録 | |
| コンパイル時間 | 240 ms |
| コンパイル使用メモリ | 85,376 KB |
| 実行使用メモリ | 119,156 KB |
| 最終ジャッジ日時 | 2026-03-25 04:52:44 |
| 合計ジャッジ時間 | 14,113 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 32 |
ソースコード
p,n=map(int,input().split())
a=list(map(int,input().split()))[::-1]
t=a.pop()
op=list(input())[::-1]
while op:
x=op.pop()
if x=='/':
t*=pow(a.pop(),p-2,p)
else:
t=eval(str(t)+x+str(a.pop()))
t%=p
print(t)