結果
問題 | No.1140 EXPotentiaLLL! |
ユーザー | DrDrpilot |
提出日時 | 2022-03-03 16:00:40 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,572 ms / 2,000 ms |
コード長 | 513 bytes |
コンパイル時間 | 585 ms |
コンパイル使用メモリ | 86,164 KB |
実行使用メモリ | 196,736 KB |
最終ジャッジ日時 | 2023-09-24 11:29:16 |
合計ジャッジ時間 | 17,215 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1,477 ms
196,532 KB |
testcase_01 | AC | 1,407 ms
196,384 KB |
testcase_02 | AC | 1,446 ms
196,324 KB |
testcase_03 | AC | 1,286 ms
196,628 KB |
testcase_04 | AC | 1,086 ms
196,612 KB |
testcase_05 | AC | 1,450 ms
196,736 KB |
testcase_06 | AC | 1,438 ms
196,720 KB |
testcase_07 | AC | 1,572 ms
196,144 KB |
testcase_08 | AC | 366 ms
194,640 KB |
testcase_09 | AC | 343 ms
194,688 KB |
testcase_10 | AC | 340 ms
194,700 KB |
testcase_11 | AC | 349 ms
194,468 KB |
testcase_12 | AC | 350 ms
194,644 KB |
ソースコード
def Eratosthenes(n): is_prime=[True] * (n+1) is_prime[0]=False is_prime[1]=False for i in range(2,int(n**0.5)+1): if not is_prime[i]: continue for j in range(i*2,n+1,i): is_prime[j]=False return [i for i in range(n+1) if is_prime[i]] T=set(Eratosthenes(5*10**6+1)) t=int(input()) for _ in range(t): a,p=map(int,input().split()) if p not in T: print(-1) else: if a%p==0: print(0) else: print(1)