QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#424390 | #7585. TDL | kangkunma | AC ✓ | 120ms | 10780kb | Python3 | 314b | 2024-05-29 09:10:21 | 2024-05-29 09:10:22 |
Judging History
answer
from math import *
def s(k,m):
n=10**19
for i in range(1,700):
s=i^k;t=c=0
if not s:continue
while t!=m:c+=1;t+=(gcd(c,s)==1)
if c==i:n=min(s,n)
if n==10**19: return -1
else:return n
for _ in range(int(input())):k,m=map(int,input().split());print(s(k,m))
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 22ms
memory: 10760kb
input:
2 3 5 6 100
output:
5 -1
result:
ok 2 number(s): "5 -1"
Test #2:
score: 0
Accepted
time: 120ms
memory: 10780kb
input:
10 525775438567843653 99 682312746347646949 100 928247462368723598 89 389467864734767741 77 734712353456789580 91 928574865348354786 95 56042586089579521 93 614889782588491751 60 614889782588490923 90 614889782588491001 100
output:
-1 682312746347646754 928247462368723467 389467864734767645 734712353456789527 928574865348354669 56042586089579704 614889782588491410 614889782588490776 614889782588490814
result:
ok 10 numbers