QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#368203 | #3916. A Bishop's Journey | KLPP# | WA | 11ms | 10100kb | Python3 | 162b | 2024-03-26 21:59:10 | 2024-03-26 21:59:11 |
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
# print(A,B,((A+1)*(B+1))//2)
ans=((A+1)*(B+1)//2)
ans*=g
print(ans)
詳細信息
Test #1:
score: 100
Accepted
time: 4ms
memory: 10100kb
input:
15 22
output:
42
result:
ok 1 number(s): "42"
Test #2:
score: 0
Accepted
time: 2ms
memory: 10004kb
input:
5 4
output:
10
result:
ok 1 number(s): "10"
Test #3:
score: 0
Accepted
time: 7ms
memory: 10000kb
input:
2 4
output:
4
result:
ok 1 number(s): "4"
Test #4:
score: 0
Accepted
time: 6ms
memory: 10008kb
input:
4 3
output:
6
result:
ok 1 number(s): "6"
Test #5:
score: 0
Accepted
time: 11ms
memory: 10100kb
input:
6 9
output:
27
result:
ok 1 number(s): "27"
Test #6:
score: 0
Accepted
time: 4ms
memory: 9976kb
input:
719952 868634
output:
312687392784
result:
ok 1 number(s): "312687392784"
Test #7:
score: -100
Wrong Answer
time: 8ms
memory: 10036kb
input:
289481 581103
output:
42054787032
result:
wrong answer 1st numbers differ - expected: '63081745256', found: '42054787032'