結果
問題 |
No.1140 EXPotentiaLLL!
|
ユーザー |
|
提出日時 | 2020-12-06 12:49:03 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 392 bytes |
コンパイル時間 | 156 ms |
コンパイル使用メモリ | 82,168 KB |
実行使用メモリ | 273,072 KB |
最終ジャッジ日時 | 2024-09-17 11:55:26 |
合計ジャッジ時間 | 8,834 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 1 |
other | TLE * 1 -- * 11 |
ソースコード
from math import sqrt from itertools import accumulate N = 5*(10**6)+1 l = [i for i in range(N)] al = list(accumulate(l)) T = int(input()) for _ in range(T): A,P = map(int,input().split()) flg = False for i in range(2,int(sqrt(P)+1)): if P%i == 0: flg = True break if flg: print(-1) else: ans = A**al[P]%P print(ans)