QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#368204 | #3916. A Bishop's Journey | KLPP# | WA | 11ms | 10136kb | Python3 | 146b | 2024-03-26 21:59:53 | 2024-03-26 21:59:53 |
Judging History
answer
n,m=map(int,input().split(" "))
import math
g=math.gcd(n-1,m-1)
A=(n-1)//g
B=(m-1)//g
ans=((A+1)*(B+1)//2)
ans*=g
print(ans%(pow(10,18)+9))
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 11ms
memory: 10096kb
input:
15 22
output:
42
result:
ok 1 number(s): "42"
Test #2:
score: 0
Accepted
time: 10ms
memory: 10132kb
input:
5 4
output:
10
result:
ok 1 number(s): "10"
Test #3:
score: 0
Accepted
time: 7ms
memory: 10032kb
input:
2 4
output:
4
result:
ok 1 number(s): "4"
Test #4:
score: 0
Accepted
time: 5ms
memory: 9916kb
input:
4 3
output:
6
result:
ok 1 number(s): "6"
Test #5:
score: 0
Accepted
time: 6ms
memory: 10032kb
input:
6 9
output:
27
result:
ok 1 number(s): "27"
Test #6:
score: 0
Accepted
time: 7ms
memory: 10044kb
input:
719952 868634
output:
312687392784
result:
ok 1 number(s): "312687392784"
Test #7:
score: -100
Wrong Answer
time: 10ms
memory: 10136kb
input:
289481 581103
output:
42054787032
result:
wrong answer 1st numbers differ - expected: '63081745256', found: '42054787032'