QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#368203#3916. A Bishop's JourneyKLPP#WA 11ms10100kbPython3162b2024-03-26 21:59:102024-03-26 21:59:11

Judging History

你现在查看的是最新测评结果

  • [2024-03-26 21:59:11]
  • 评测
  • 测评结果:WA
  • 用时:11ms
  • 内存:10100kb
  • [2024-03-26 21:59:10]
  • 提交

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)

Details

Tip: Click on the bar to expand more detailed information

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'