結果
問題 |
No.1140 EXPotentiaLLL!
|
ユーザー |
|
提出日時 | 2020-08-05 23:42:07 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 293 bytes |
コンパイル時間 | 168 ms |
コンパイル使用メモリ | 82,492 KB |
実行使用メモリ | 240,872 KB |
最終ジャッジ日時 | 2024-09-17 21:41:37 |
合計ジャッジ時間 | 9,393 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 2 WA * 3 TLE * 7 |
ソースコード
MA = 5*10**6+1 s = [0]*(MA) s[1] = 2 cum = [0,1] for i in range(2,MA): for j in range(i,MA,i): s[j] += 1 cum.append(cum[-1]+i) t = int(input()) for _ in range(t): a,p = map(int,input().split()) if s[p] == 1: print(pow(a,cum[p],p)) else: print(-1)