結果
| 問題 | No.1140 EXPotentiaLLL! |
| コンテスト | |
| ユーザー |
paruf4
|
| 提出日時 | 2020-07-31 23:16:17 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 374 bytes |
| 記録 | |
| コンパイル時間 | 193 ms |
| コンパイル使用メモリ | 84,736 KB |
| 実行使用メモリ | 94,208 KB |
| 最終ジャッジ日時 | 2026-03-28 11:31:09 |
| 合計ジャッジ時間 | 7,185 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 1 |
| other | TLE * 1 -- * 11 |
ソースコード
def isPrime(x):
if x < 2:
return False
for i in range(2, int(x**0.5)+1):
if x % i == 0:
return False
return True
t = int(input())
for i in range(t):
a,p = map(int,input().split())
if isPrime(p):
if ((p-1)//2)%2==1:
print(pow(a,0,p))
else:
print(pow(a,1,p))
else:
print(-1)
paruf4