Submission #18243460


Source Code Expand

Copy
import math
from math import gcd,pi,sqrt
INF = float("inf")
MOD = 10**9 + 7

import sys
sys.setrecursionlimit(10**6)
import itertools
import bisect
import re
from collections import Counter,deque,defaultdict
def iinput(): return int(input())
def imap(): return map(int, input().split())
def ilist(): return list(imap())
def irow(N): return [iinput() for i in range(N)]
def sinput(): return input()
def smap(): return input().split()
def slist(): return list(smap())
def srow(N): return [sinput() for i in range(N)]


def main():
    n,m = imap()
    g = gcd(n,m)
    print(m-g)
    
    




if __name__=="__main__":
    main()

Submission Info

Submission Time
Task D - Bus Tour
User kenken0305
Language PyPy3 (7.3.0)
Score 300
Code Size 659 Byte
Status AC
Exec Time 88 ms
Memory 68820 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 28
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All sample_01.txt, sample_02.txt, sample_03.txt, subtask_1_1.txt, subtask_1_10.txt, subtask_1_11.txt, subtask_1_12.txt, subtask_1_13.txt, subtask_1_14.txt, subtask_1_15.txt, subtask_1_16.txt, subtask_1_17.txt, subtask_1_18.txt, subtask_1_19.txt, subtask_1_2.txt, subtask_1_20.txt, subtask_1_21.txt, subtask_1_22.txt, subtask_1_23.txt, subtask_1_24.txt, subtask_1_25.txt, subtask_1_3.txt, subtask_1_4.txt, subtask_1_5.txt, subtask_1_6.txt, subtask_1_7.txt, subtask_1_8.txt, subtask_1_9.txt
Case Name Status Exec Time Memory
sample_01.txt AC 88 ms 68708 KB
sample_02.txt AC 70 ms 68496 KB
sample_03.txt AC 71 ms 68164 KB
subtask_1_1.txt AC 69 ms 68256 KB
subtask_1_10.txt AC 68 ms 68404 KB
subtask_1_11.txt AC 70 ms 68720 KB
subtask_1_12.txt AC 68 ms 68244 KB
subtask_1_13.txt AC 66 ms 68264 KB
subtask_1_14.txt AC 70 ms 68524 KB
subtask_1_15.txt AC 67 ms 68216 KB
subtask_1_16.txt AC 69 ms 68444 KB
subtask_1_17.txt AC 69 ms 68340 KB
subtask_1_18.txt AC 70 ms 68820 KB
subtask_1_19.txt AC 68 ms 68732 KB
subtask_1_2.txt AC 66 ms 68800 KB
subtask_1_20.txt AC 71 ms 68488 KB
subtask_1_21.txt AC 71 ms 68568 KB
subtask_1_22.txt AC 68 ms 68804 KB
subtask_1_23.txt AC 71 ms 68236 KB
subtask_1_24.txt AC 68 ms 68212 KB
subtask_1_25.txt AC 69 ms 68480 KB
subtask_1_3.txt AC 69 ms 68484 KB
subtask_1_4.txt AC 67 ms 68196 KB
subtask_1_5.txt AC 68 ms 68220 KB
subtask_1_6.txt AC 69 ms 68172 KB
subtask_1_7.txt AC 69 ms 68516 KB
subtask_1_8.txt AC 69 ms 68672 KB
subtask_1_9.txt AC 70 ms 68676 KB