QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#368212#3916. A Bishop's JourneyKLPP#WA 12ms9564kbPython3160b2024-03-26 22:03:522024-03-26 22:03:52

Judging History

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

  • [2024-03-26 22:03:52]
  • 评测
  • 测评结果:WA
  • 用时:12ms
  • 内存:9564kb
  • [2024-03-26 22:03:52]
  • 提交

answer

n,m=map(int,input().split(" "))
import math
g=math.gcd(n-1,m-1)
L=math.lcm(n-1,m-1)+1
A=(n-1)//g
B=(m-1)//g
cuts=((A+1)*(B+1))//2-A*B-1
L+=cuts
print(L)

詳細信息

Test #1:

score: 100
Accepted
time: 12ms
memory: 9496kb

input:

15 22

output:

42

result:

ok 1 number(s): "42"

Test #2:

score: 0
Accepted
time: 6ms
memory: 9540kb

input:

5 4

output:

10

result:

ok 1 number(s): "10"

Test #3:

score: 0
Accepted
time: 10ms
memory: 9440kb

input:

2 4

output:

4

result:

ok 1 number(s): "4"

Test #4:

score: 0
Accepted
time: 2ms
memory: 9456kb

input:

4 3

output:

6

result:

ok 1 number(s): "6"

Test #5:

score: 0
Accepted
time: 9ms
memory: 9392kb

input:

6 9

output:

27

result:

ok 1 number(s): "27"

Test #6:

score: 0
Accepted
time: 3ms
memory: 9388kb

input:

719952 868634

output:

312687392784

result:

ok 1 number(s): "312687392784"

Test #7:

score: 0
Accepted
time: 6ms
memory: 9392kb

input:

289481 581103

output:

63081745256

result:

ok 1 number(s): "63081745256"

Test #8:

score: 0
Accepted
time: 4ms
memory: 9444kb

input:

834830 721237

output:

301055142355

result:

ok 1 number(s): "301055142355"

Test #9:

score: 0
Accepted
time: 5ms
memory: 9436kb

input:

142083 732026

output:

52004225079

result:

ok 1 number(s): "52004225079"

Test #10:

score: 0
Accepted
time: 7ms
memory: 9452kb

input:

764577 965379

output:

276789751137

result:

ok 1 number(s): "276789751137"

Test #11:

score: 0
Accepted
time: 9ms
memory: 9556kb

input:

107977 631183

output:

10412250263

result:

ok 1 number(s): "10412250263"

Test #12:

score: 0
Accepted
time: 0ms
memory: 9452kb

input:

971644 348920

output:

169513012240

result:

ok 1 number(s): "169513012240"

Test #13:

score: 0
Accepted
time: 7ms
memory: 9448kb

input:

251570 13601

output:

1710801785

result:

ok 1 number(s): "1710801785"

Test #14:

score: 0
Accepted
time: 7ms
memory: 9468kb

input:

553935 194838

output:

53963793765

result:

ok 1 number(s): "53963793765"

Test #15:

score: 0
Accepted
time: 9ms
memory: 9544kb

input:

765258 548232

output:

209769461928

result:

ok 1 number(s): "209769461928"

Test #16:

score: 0
Accepted
time: 5ms
memory: 9544kb

input:

531168 494514

output:

131335006176

result:

ok 1 number(s): "131335006176"

Test #17:

score: 0
Accepted
time: 9ms
memory: 9556kb

input:

165735 605402

output:

50168150235

result:

ok 1 number(s): "50168150235"

Test #18:

score: 0
Accepted
time: 7ms
memory: 9392kb

input:

954662 656166

output:

313208372946

result:

ok 1 number(s): "313208372946"

Test #19:

score: 0
Accepted
time: 5ms
memory: 9408kb

input:

398962 17554

output:

1945336762

result:

ok 1 number(s): "1945336762"

Test #20:

score: 0
Accepted
time: 6ms
memory: 9556kb

input:

978970 885591

output:

433483510635

result:

ok 1 number(s): "433483510635"

Test #21:

score: 0
Accepted
time: 5ms
memory: 9456kb

input:

900826 2

output:

900826

result:

ok 1 number(s): "900826"

Test #22:

score: 0
Accepted
time: 9ms
memory: 9556kb

input:

812274 976493

output:

68829584666

result:

ok 1 number(s): "68829584666"

Test #23:

score: 0
Accepted
time: 9ms
memory: 9452kb

input:

23679 999261

output:

8872935090

result:

ok 1 number(s): "8872935090"

Test #24:

score: 0
Accepted
time: 7ms
memory: 9392kb

input:

975088 925001

output:

450978687544

result:

ok 1 number(s): "450978687544"

Test #25:

score: 0
Accepted
time: 6ms
memory: 9432kb

input:

103310 994063

output:

51348324265

result:

ok 1 number(s): "51348324265"

Test #26:

score: 0
Accepted
time: 3ms
memory: 9384kb

input:

991729 988811

output:

367736956515

result:

ok 1 number(s): "367736956515"

Test #27:

score: 0
Accepted
time: 0ms
memory: 9452kb

input:

160545 912490

output:

73247853525

result:

ok 1 number(s): "73247853525"

Test #28:

score: 0
Accepted
time: 6ms
memory: 9388kb

input:

999275 984486

output:

491886123825

result:

ok 1 number(s): "491886123825"

Test #29:

score: 0
Accepted
time: 9ms
memory: 9452kb

input:

160 920052

output:

73604160

result:

ok 1 number(s): "73604160"

Test #30:

score: 0
Accepted
time: 0ms
memory: 9556kb

input:

976884 377024

output:

184154356608

result:

ok 1 number(s): "184154356608"

Test #31:

score: 0
Accepted
time: 9ms
memory: 9440kb

input:

999977 177586

output:

88790957761

result:

ok 1 number(s): "88790957761"

Test #32:

score: 0
Accepted
time: 6ms
memory: 9380kb

input:

432701 995507

output:

161533649377

result:

ok 1 number(s): "161533649377"

Test #33:

score: 0
Accepted
time: 9ms
memory: 9452kb

input:

981962 58597

output:

28770013657

result:

ok 1 number(s): "28770013657"

Test #34:

score: 0
Accepted
time: 9ms
memory: 9456kb

input:

975928 995560

output:

269887247524

result:

ok 1 number(s): "269887247524"

Test #35:

score: 0
Accepted
time: 10ms
memory: 9436kb

input:

936309 50406

output:

23597795727

result:

ok 1 number(s): "23597795727"

Test #36:

score: 0
Accepted
time: 0ms
memory: 9448kb

input:

996783 974118

output:

485492131197

result:

ok 1 number(s): "485492131197"

Test #37:

score: 0
Accepted
time: 10ms
memory: 9564kb

input:

126 923149

output:

58158387

result:

ok 1 number(s): "58158387"

Test #38:

score: -100
Wrong Answer
time: 9ms
memory: 9560kb

input:

242944687192960505 985657710243272091

output:

89797614035393040419993190019883159

result:

wrong output format Expected integer, but "89797614035393040419993190019883159" found