結果

問題 No.1092 modular arithmetic
ユーザー KeroruKeroru
提出日時 2020-06-25 19:21:45
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 222 bytes
コンパイル時間 245 ms
コンパイル使用メモリ 87,152 KB
実行使用メモリ 843,496 KB
最終ジャッジ日時 2023-09-16 22:54:54
合計ジャッジ時間 7,515 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,128 KB
testcase_01 AC 1,049 ms
119,104 KB
testcase_02 AC 66 ms
71,144 KB
testcase_03 MLE -
testcase_04 AC 967 ms
104,792 KB
testcase_05 AC 830 ms
106,220 KB
testcase_06 MLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0