problem_id stringlengths 6 6 | user_id stringlengths 10 10 | time_limit float64 1k 8k | memory_limit float64 262k 1.05M | problem_description stringlengths 48 1.55k | codes stringlengths 35 98.9k | status stringlengths 28 1.7k | submission_ids stringlengths 28 1.41k | memories stringlengths 13 808 | cpu_times stringlengths 11 610 | code_sizes stringlengths 7 505 |
|---|---|---|---|---|---|---|---|---|---|---|
p02995 | u094191970 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['import math\na,b,c,d = map(int, input().split())\nlcm = (c*d)//math.gcd(c,d)\nprint(lcm)\nsum = b-a+1\nx = (b//c) - ((a-1)//c)\ny = (b//d) - ((a-1)//d)\nz = (b//lcm) - ((a-1)//lcm)\nn_i = x+y-z\nprint(int(sum-n_i))', 'from sys import stdin\nnii=lambda:map(int,stdin.readline().split())\nlnii=lambda:list(map(int,stdin.... | ['Runtime Error', 'Accepted'] | ['s803657190', 's674559576'] | [3064.0, 9120.0] | [17.0, 25.0] | [205, 301] |
p02995 | u096616343 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['def cnt(A, B, X):\n A1 = -(-A // X)\n B1 = B // X\n return B1 - A1 + 1\n\nA, B, C, D = map(int,input().split())\nprint((B - A + 1) - cnt(A, B, C) - cnt(A, B, D) - cnt(A, B, C * D))', 'def cnt(A, B, X):\n A1 = -(-A // X)\n B1 = B // X\n return B1 - A1 + 1\n\ndef gcd(A, B):\n mul = A * B\n if A ... | ['Wrong Answer', 'Accepted'] | ['s305630737', 's759453111'] | [3060.0, 3064.0] | [18.0, 18.0] | [183, 311] |
p02995 | u102275718 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['\na, b, c, d = map(int, input().split())\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\ndiv1 = b//c - a//c\n\ndiv2 = b//d - a//d\n\ne = lcm(c,d)\ndiv3 = b//e - a//e\nans = b-a+1 - div1 - div2 + div3\nprint(ans)\n', '\na, b, c, d = map(int, in... | ['Wrong Answer', 'Accepted'] | ['s429205427', 's156013944'] | [3060.0, 3064.0] | [17.0, 17.0] | [270, 346] |
p02995 | u102305348 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['A, B, C, D = map(int, input().split())\nans = set()\nfor i in range(A//C + 1, B //C + 1):\n ans.add(i*C)\n\nfor i in range(A//D + 1, B //D + 1):\n ans.add(i*D)\n \n\n\nprint(B - A + 1 - len(ans))', 'A, B, C, D = map(int, input().split())\nans = set(list(range(A, B+1)))\n\n\nfor i in range(A//C + 1, B //C + 1... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s609873785', 's691485661', 's880912746'] | [671696.0, 3060.0, 3064.0] | [2130.0, 18.0, 17.0] | [194, 255, 420] |
p02995 | u116233709 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['a,b,c,d=map(int,input().split())\ndef gcd(x,y):\n if x%y==0:\n print(y)\n else:\n gcd(x%y,y)\n \nr=gcd(c,d) \ns=(b//c)-((a-1)//c)\nt=(b//d)-((a-1)//d)\nu=(b//r)-((a-1)//r)\n\nprint(b-a+1-s-t+u)', 'a,b,c,d=map(int,input().split())\ndef gcd(x,y):\n if x%y==0:\n return y\n else:\n return gcd(x%y,y)... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s036753386', 's375810925', 's556163542', 's609275124', 's750180673'] | [3872.0, 3872.0, 3864.0, 3060.0, 3060.0] | [73.0, 74.0, 74.0, 17.0, 17.0] | [195, 214, 203, 203, 216] |
p02995 | u116722061 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['A, B, C, D = map(int, input().split())\nmin = min(C, D)\nmax = max(C, D)\nc=0\nd=0\ne=0\n\ndef gcd(max, min):\n while min:\n max, min = min, max%min\n return max\nlcm = max*min//gcd(max,min)\nif A>=C:\n c = B//C-(-(-A//C))+1\nif A>=D:\n d = B//D-(-(-A//D))+1\nif B>=lcm:\n e = B//lcm-(-(-A//lcm))+1\nprint(c)\n... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s501875626', 's527097973', 's016523170'] | [3064.0, 3064.0, 3064.0] | [17.0, 18.0, 17.0] | [339, 320, 342] |
p02995 | u133566678 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['def saidaikouyaku(a, b):\n if b > a:\n a, b = b, a\n\n while b != 0:\n a, b = b, (a % b)\n return a\n\nA, B, C, D = map(int, input().split())\namari1 = 0\namari2 = 0\namari3 = 0\nhani = B - A + 1\nif B > C:\n amari1 = A % C\nF = hani - amari1\nCnum = int(F / C) + 1\nif B > D:\n amari2 = A... | ['Wrong Answer', 'Accepted'] | ['s936180738', 's987983892'] | [3064.0, 3060.0] | [17.0, 18.0] | [616, 429] |
p02995 | u135116520 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['import fractions\nA,B,C,D=map(int,input().split())\n\ne=fractions.gcd(C,D)\na_c=(A-1)//C \nb_c=B//C \na_d=(A-1)//D\nb_d=B//D\na_cd=A//e\nb_cd=B//e\ns=A-1-(a_c+a_d-a_cd)\u3000#A-1以下の数字のうちCでもDでも割り切れないものの個数\nt=B-(b_c+b_d-b_cd)\u3000\nu=t-s\nprint(u)', 'A,B,C,D=map(int,input().split())\ns=0\nfor i in range(A,B+1):\n if... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s077429085', 's117267174', 's269232626', 's293236000', 's538489359', 's555945322', 's911838455', 's651733780'] | [2940.0, 2940.0, 3060.0, 3064.0, 5048.0, 3064.0, 5300.0, 3064.0] | [17.0, 17.0, 17.0, 17.0, 35.0, 17.0, 39.0, 17.0] | [420, 101, 183, 282, 438, 286, 431, 231] |
p02995 | u136811344 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['A,B,C,D=map(int, input().split())\n\ndef gcd(a,b):\n while b:\n a, b = b, a%b\n return a\n\ndef lcm(x,y):\n return x/gcd(x,y)*y\n \nans = (B - B//C - B//D + B//lcm(C,D) ) - ( (A-1) - (A-1)//C - (A-1)//D + (A-1)//lcm(C,D) )\nprint(ans)', 'def gcd(a,b):\n while b:\n a, b = b, a%b\n return a\n\ndef lcm(a,b):... | ['Wrong Answer', 'Accepted'] | ['s927966183', 's648466441'] | [3060.0, 3060.0] | [17.0, 17.0] | [230, 208] |
p02995 | u138537142 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ["from fractions import gcd\ndef floor(a, b):\n return int((a - a%b)/b)\n\n# while a % b != 0:\n# a, b = b, a % b\n# return a\ndef lcm(a, b):\n return floor((a * b), gcd(a, b))\ninput = list(map(int, input().split(' ')))\ntotal_count = input[1] + 1 - input[0]\ndiv_c = floor(input[1], input[2]) - floor(input... | ['Wrong Answer', 'Accepted'] | ['s174552311', 's322621550'] | [5076.0, 3064.0] | [35.0, 18.0] | [547, 337] |
p02995 | u145145077 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['a,b,c,d=map(int,input().split())\n\ndef calc_div_num(a,b,x):\n return b//x - (a-1)//x\n\nnum_c = b//c - (a-1)//c\nnum_d = b//d - (a-1)//d\n\nimport numpy as np\nlcd = np.lcd(c,d)\nnum_lcd = b//lcd - (a-1)//lcd\n\nresult = b-a+1 - (num_c+num_d-num_lcd)\nprint(result)', 'a,b,c,d=map(int,input().split())\n\nnum_c = b//... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s143822988', 's275104974', 's901401518', 's015644529'] | [27156.0, 27112.0, 27120.0, 9216.0] | [110.0, 115.0, 120.0, 32.0] | [254, 192, 308, 262] |
p02995 | u151503168 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['def GCD(s, t):\n if s < t:\n s, t = t, s\n if t == 0:\n return s\n else:\n return GCD(t,s%t)\n\nA, B, C, D = map(int, input().split())\nE = C*D // GCD(C,D)\nx = B // C - A // C\ny = B // D - A // D\nz = B // E - A // E\nprint(B-A-x-y+z+1)', 'def GCD(s, t):\n if s < t:\n s, t = ... | ['Wrong Answer', 'Accepted'] | ['s025053456', 's247328045'] | [3064.0, 3064.0] | [17.0, 17.0] | [255, 267] |
p02995 | u157232135 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['import fractions as math\n\ndef main():\n a,b,c,d = map(int, input().split())\n al = b-a+1\n x = al // c\n y = al // d\n z = al // (c/math.gcd(c,d)*d)\n an = x+y-z\n #print(al, an)\n print(int(al-an))\n \nif __name__ == "__main__":\n main()', 'import math\ndef main():\n a,b,c,d = map(... | ['Wrong Answer', 'Accepted'] | ['s226495605', 's538358932'] | [5048.0, 9196.0] | [36.0, 32.0] | [257, 333] |
p02995 | u163501259 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ["import sys\ninput = sys.stdin.readline\ndef main():\n A, B, C, D = map(int, input().split())\n N = B-A+1\n NC = (N+C-1)//C\n ND = (N+D-1)//D\n NCD = (N+C*D+1)//(C*D)\n ans = N - NC - ND + NCD\n\n print(ans)\n\nif __name__ == '__main__':\n main()", "import sys\ninput = sys.stdin.readline\ndef m... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s852073743', 's877972797', 's498357959'] | [3060.0, 3064.0, 3064.0] | [17.0, 17.0, 18.0] | [256, 281, 380] |
p02995 | u166340293 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['def gcd(a,b):\n while b:\n a,b=b,a%b\n return a\nA,B,C,D=map(int,input().split())\nc=C*D/gcd(C,D)\nb=B//C+B//D-B//c\na=(A-1)//C+(A-1)//D-(A-1)//c\nprint((B-b)-(A-1-a))', 'def gcd(a,b):\n while b:\n a,b=b,a%b\n return a\nA,B,C,D=map(int,input().split())\nc=int(C*D/gcd(C,D))\nb=int(B//C)+int(B//D)-int(B//c)\n... | ['Wrong Answer', 'Accepted'] | ['s972893907', 's425313105'] | [3060.0, 3064.0] | [17.0, 18.0] | [164, 204] |
p02995 | u188827677 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['from fractions import gcd\nfrom math import ceil\na,b,c,d = map(int, input().split())\n\nnums = b-a+1\nt1 = ceil(b/c - a/c)\nt2 = ceil(b/d - a/d)\n\nlcm = (c*d)//gcd(c,d)\nt3 = b//lcm - a//lcm\nprint(nums-t1-t2+t3)', 'from fractions import gcd\na,b,c,d = map(int, input().split())\n\nnums = b-a+1\nt1 = b//c - a//c\nt2... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s117051302', 's427728402', 's969276294'] | [5076.0, 5048.0, 9052.0] | [35.0, 35.0, 23.0] | [204, 174, 178] |
p02995 | u189513668 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['\nA, B, C, D = map(int, input().split())\n\ndef gcd(c, d):\n if c < d:\n return gcd(d, c)\n \n while d != 0:\n s = c % d\n c = d\n d = s\n \n return c\n \ndef lcm(c, d):\n return c * d // gcd(c, d)\n \nprint(gcd(C, D))\nprint(lcm(C, D))\n\nc = B // C - A // C if... | ['Wrong Answer', 'Accepted'] | ['s737717250', 's813766458'] | [3064.0, 3064.0] | [18.0, 17.0] | [561, 525] |
p02995 | u189594456 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['def gcd(x, y): \n\twhile(y): \n \t\tx, y = y, x % y \n\treturn x \na,b,c,d=map(int,input().split())\nm=((c*d)//(gcd(c,d)))\ndi=b-a+1\nif a%c==0:\n c1=(b//c-a//c)+1\nelse:\n c1=(b//c-a//c)\nif a%d==0:\n c2=(b//d-a//d)+1\nelse:\n c2=(b//d-a//d)\nif a%m==0 and m!=a or m!=b:\n c3=(b//m-a//m)+1\nelse:\n c3=(b//m-a... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s404446061', 's652754235', 's959008282', 's832904295'] | [3064.0, 3064.0, 3064.0, 3064.0] | [17.0, 17.0, 20.0, 17.0] | [324, 325, 310, 307] |
p02995 | u191680842 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['a, b, c, d = map(int,input().split())\nli = [i for i in range(a, b+1)]\nprint(li)\ncf = [True if i%c != 0 else False for i in li]\nprint(cf)\ndf = [True if i%d != 0 else False for i in li]\nprint(df)\nn = 0\nfor i in range(len(cf)):\n if cf[i] and df[i]:\n n+=1\nprint(n)', 'A, B, C, D = map(int, input().spl... | ['Wrong Answer', 'Accepted'] | ['s981623829', 's158447583'] | [2004248.0, 3060.0] | [2234.0, 17.0] | [270, 222] |
p02995 | u193841608 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['import math\na,b,c,d=map(int,input().split())\nlcm=(c*d)//math.gcd(c,d)\nans=(b-a)-((b//c-a//c)+(b//d-a//d)-(b//lcm-a//lcm))+1\nprint(ans)', 'import math\na,b,c,d=map(int,input().split())\nlcm=(c*d)//math.gcd(c,d)\nans=(b-a)-((b//c-(a-1)//c)+(b//d-(a-1)//d)-(b//lcm-(a-1)//lcm))+1\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s181663846', 's630112956'] | [9168.0, 9096.0] | [26.0, 27.0] | [134, 146] |
p02995 | u194894739 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['A, B, C, D = map(int, input().split())\nnumC = B//C - A//C\nnumD = B//D - A//D\n\ndef gcd(a, b):\n a, b = max(a, b), min(a, b)\n if a % b == 0:\n return b\n return gcd(b, a%b)\n\nCD = C * D // gcd(C, D)\n\nnumCD = B//CD - A//CD\nnumAll = B - A + 1\nprint(numAll - numC - numD + numCD)\n', 'A, B, C, D =... | ['Wrong Answer', 'Accepted'] | ['s698165248', 's705405572'] | [3060.0, 3060.0] | [19.0, 17.0] | [287, 300] |
p02995 | u196675341 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['import math\n\na, b, c, d = list(map(int,input().split(" ")))\n\nac_r = a % c\nad_r = a % d\nlcm = (c*d) // math.gcd(c, d)\nacd_r = a % lcm\nn = b - a + 1\n\nif (ac_r == 0 and n % c == 1) or ((ac_r == 0 and n % c == 2) or (ac_r == 2 and n % c == 2)) :\n n_c = n // c + 1\nelse:\n n_c = n // c\n \nif (ad_r ==... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s180253281', 's219128534', 's810935987', 's679279051'] | [3064.0, 3064.0, 3064.0, 3064.0] | [17.0, 17.0, 17.0, 17.0] | [655, 655, 648, 274] |
p02995 | u200916944 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['import sys\nimport math\nfrom fractions import gcd\n\ndef lcm(a, b):\n return (a * b) // gcd(a, b)\n\na,b,c,d = [int(x) for x in sys.stdin.readline().rstrip().split(" ")]\ne = b - a + 1\nf = int(b / c) - int((a - 1) / c)\ng = int(b / d) - int((a - 1) / d)\ncd = lcm(c, d) \nh = int(b / cd) - int((a - 1) / cd)\nn = e ... | ['Wrong Answer', 'Accepted'] | ['s829873192', 's903741051'] | [5048.0, 3064.0] | [35.0, 18.0] | [327, 455] |
p02995 | u201856486 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['# coding: utf-8\nimport sys\n\n# import math\n# import numpy as np\n# from fractions import gcd\n\n"""Template"""\n\n\nclass IP:\n \n def __init__(self):\n self.input = sys.stdin.readline\n\n def I(self):\n \n return int(self.input())\n\n def S(self):\n \n return self.in... | ['Wrong Answer', 'Accepted'] | ['s974297158', 's202451008'] | [3192.0, 3192.0] | [18.0, 18.0] | [5103, 5176] |
p02995 | u203383537 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['import math\n\ndef lcm(x,y):\n return (x*y)//math.gcd(x,y)\n\na,b,c,d=map(int,input().split())\nd1=math.floor(b/c)\nd2=math.floor(b/d)\nd3=math.floor(b/lcm(c,d))\n\nd4=math.floor((a-1)/c)\nd5=math.floor((a-1)/d)\nd6=math.floor((a-1)/lcm(c,d))\n\nansb=b-(d1+d2-d3)\nansa=a-1-(d1+d2-d3)\nprint(ansb-ansa)', 'def gcd(x... | ['Runtime Error', 'Accepted'] | ['s810056535', 's971089599'] | [3064.0, 9152.0] | [17.0, 28.0] | [289, 339] |
p02995 | u207464563 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['import math\n\nA,B,C,D = map(int,input().split())\ncount = 0\n\nQC = 0 \nQD = 0 \nQCD = 0 \n\nCD = int(C * D / math.gcd(C, D)) \nprint(CD)\n\n\nQC = (B // C) - (A // C)\nif A % C == 0:\n QC += 1\n\nQD = (B // D) - (A // D)\nif A % D == 0:\n QD += 1\n\nQCD = (B // CD) - (A // CD)\nif A % CD == 0:\n ... | ['Runtime Error', 'Accepted'] | ['s504197447', 's912432897'] | [3064.0, 3064.0] | [17.0, 17.0] | [456, 527] |
p02995 | u209275335 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['import fractions\na,b,c,d = map(int,input().split())\ne,f,g,h,i,j = b//c,b//d,(a-1)//c,(a-1)//d,b//((c*d)/fractions.gcd(c,d)),(a-1)//((c*d)/fractions.gcd(c,d))\nprint(int(b-(e+f-i)-(a-1-(g+h-j))))', 'import math\na,b,c,d = map(int,input().split())\nlcm = c*d//(math.gcd(c,d))\ne,f,g = b//c - (a-1)//c,b//d - (a-1)//d,b... | ['Wrong Answer', 'Accepted'] | ['s651955899', 's317320469'] | [5052.0, 9188.0] | [35.0, 29.0] | [193, 156] |
p02995 | u211236379 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['import fractions\nA,B,C,D = map(int,input().split())\n\ndef lcm(x, y):\n return (x * y) // fractions.gcd(x, y)\n\nCD = lcm(C,D)\nc_div = 0\nd_div = 0\ncd_div = 0\nans = 0\n\nif A % C == 0:\n first_C = A\nelse:\n first_C = A + C -(A%C)\nlast_C = B -(B%C)\nc_div = (last_C - first_C)//C + 1\n\nif A % D == 0:\n ... | ['Runtime Error', 'Accepted'] | ['s473802390', 's230662636'] | [5076.0, 3064.0] | [36.0, 17.0] | [580, 606] |
p02995 | u213580455 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['def gcd(a, b):\n a, b = sorted([a, b])\n while(b != 0):\n a, b = (b, a%b)\n return b\n\ndef getMultiCount(start, end, times):\n if end < times: return 0\n s = start-(start%times)\n if s != start: s += times\n e = end-(end%times)\n if s > e: return 0\n return ((e-s)//times)+1\n \nd... | ['Runtime Error', 'Accepted'] | ['s442174314', 's550365785'] | [3064.0, 3064.0] | [18.0, 17.0] | [560, 574] |
p02995 | u217582166 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['a, b, c, d = map(int, input().split())\ncount = 0\nab = a * b\ntarget = b - a + 1\nif (a % c == 0 or b % c == 0) or (a % d == 0 or b % d == 0):\n count += int(target // c) + 1\n count += int(target // d) + 1\n tmp_cou = 0\n while d <= c:\n d = d / ab\n tmp_cou += 1\n count -= tmp_cou\nelse:\n count += int... | ['Wrong Answer', 'Accepted'] | ['s505304829', 's156809582'] | [3064.0, 3064.0] | [2104.0, 17.0] | [449, 281] |
p02995 | u218838821 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['import math\nA,B,C,D = map(int,input().split())\n\nprint(B-B//C-B//D+B//(C*D//math.gcd(C,D))-(A-A//C-A//D+A//(C*D//math.gcd(C,D)))+1)', 'from math import gcd\nA, B, C, D = map(int,input().split())\n \nlcm = C*D // gcd(C,D)\na = (A-1)//C + (A-1)//D - (A-1)//lcm\nb = B//C + B//D - B//lcm\n \nprint(B-A+1-b+a)'] | ['Wrong Answer', 'Accepted'] | ['s554954941', 's639109900'] | [9168.0, 9180.0] | [27.0, 30.0] | [130, 163] |
p02995 | u224554402 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['from math\na,b,c,d=list(map(int,input().split()))\na-=1\ndef calculation(x,c,d):\n\tx=x-(x//c)-(x//d)+(x//((c*d)//math.gcd(c,d)))\n\treturn x\n\t\nprint(calculation(b,c,d)-calculation(a,c,d))', 'import math\na,b,c,d=list(map(int,input().split()))\na-=1\ndef calculation(x,c,d):\n\tx=x-(x//c)-(x//d)+(x//((c*d)//math.gc... | ['Runtime Error', 'Accepted'] | ['s754280663', 's737602654'] | [9000.0, 9180.0] | [30.0, 32.0] | [181, 183] |
p02995 | u225577738 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['L, R = map(int, input().split())\n\nans = 2019\nfor i in range(L, R):\n f = False\n for j in range(i, R):\n if ((i*j) % 2019) == 0:\n print(0)\n break\n ans = min(ans, (i*j)%2019)\n if f:\n break\nprint(ans)', 'import math\n\nA, B, C, D = map(int, input().split())\... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s103591851', 's169464629', 's707539723'] | [3060.0, 3064.0, 3064.0] | [17.0, 19.0, 17.0] | [248, 226, 419] |
p02995 | u228134140 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['a, b, c, d = map(int, input().split())\nN = list(range(a, b+1, 1))\nt = 0\nfor n in N:\n if n % c == 0 and n % d == 0:\n t += 1\nprint(t)', 'import math\na, b, c, d = map(int, input().split())\n\ns1 = (a-1) // c\ns2 = (a-1) // d\ns3 = (a-1) // (c*d//math.gcd(c,d))\nS = (a-1) - (s1 + s2 -s3)\n\nl1 = b // c\nl2 = b... | ['Runtime Error', 'Accepted'] | ['s509039825', 's353039851'] | [9164.0, 9108.0] | [24.0, 31.0] | [135, 235] |
p02995 | u241159583 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['a,b,c,d = map(int, input().split())\n\nc1, d1, cd1 = b // c, b // d, b // (c*d)\nc2, d2, cd2 = (a-1) // c, (a-1) // d, a // (c*d)\nans = (c1+d1-cd1) - (c2+d2-cd2)\nprint(ans)\nprint((b-a+1) - ans)', 'from fractions import gcd\na,b,c,d = map(int, input().split())\nx = (c*d) // gcd(c,d)\nc1, d1, cd1 = b // c, b // d, b... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s005503024', 's112394989', 's514978100'] | [3060.0, 5076.0, 8992.0] | [17.0, 35.0, 27.0] | [190, 214, 159] |
p02995 | u242598232 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['def euclid(a,b):\n\tc=0\n\tif (a-b)<0:\n\t\tc=a\n\t\ta=b\n\t\tb=c\n\tr=-1\n\twhile r!=0:\n\t\tr=a%b\n\t\ta=b\n\t\tb=r\n\treturn a\n\nA,B,C,D=map(int,input().split())\nc1=A//C\nd1=A//D\nc2=B//C\nd2=B//D\nk=euclid(C,D)\nCD=C*D//k\ncd1=A//CD\ncd2=B//CD\nc3=c2-c1\nd3=d2-d1\ncd3=cd2-cd1\nprint(B-A+1-c3-d3+cd3)', 'def eucl... | ['Wrong Answer', 'Accepted'] | ['s978667062', 's884895541'] | [3064.0, 3064.0] | [17.0, 17.0] | [264, 276] |
p02995 | u244033183 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['\ndef euclid_gcd(a,b):\n while b:\n a, b = b, a%b\n return a\n\n\ndef euclid_lcm(a, b):\n return a * b // euclid_gcd(a, b)\n \nA,B,C,D = map(int,input().split())\n\nX = euclid_lcm(C,D)\nA = A-1\n\nY = A//C + A//D - A//X\nZ = B//C + B//D - B//X\n \nprint(B-Z - (A-Y)', '\ndef euclid_gcd(a,b):\n wh... | ['Runtime Error', 'Accepted'] | ['s225009744', 's404292338'] | [2940.0, 3060.0] | [17.0, 17.0] | [362, 365] |
p02995 | u244416763 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['a,b,c,d = map(int, input().split())\ne = int((b-a)/c)\nf = int((b-a)/d)\nr = e+f\nprint((b-a)-(r)+1)', 'def gcd(a,b):\n if b == 0:\n return a\n else:\n return gcd(b,a%b)\n\ndef lcm(a,b):\n return a*b // gcd(a,b)\n\na,b,c,d = map(int,input().split())\na -= 1\nA = a-((a//c) + (a//d) - a//lcm(c,d)... | ['Wrong Answer', 'Accepted'] | ['s541545254', 's736702142'] | [2940.0, 9096.0] | [17.0, 33.0] | [96, 253] |
p02995 | u256868077 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['import math\n\ndef gcd(x,y):\n M=max(x,y)\n m=min(x,y)\n while(M%m!=0):\n r=M%m\n M=m\n m=r\n return m\n\n\n\ndef f(x,y):\n z=x//y\n return z\n\n\na,b,c,d=map(int,input().split())\ng=gcd(c,d)\np=a-f(a,c)-f(a,d)+f(a,c*d/g)\nq=b-f(b,c)-f(b,d)+f(b,c*d/g)\nif(a%c!=0 and a%d!=0):\n print(q-p+1)\nelse... | ['Wrong Answer', 'Accepted'] | ['s409199931', 's125977741'] | [3064.0, 3064.0] | [17.0, 17.0] | [308, 323] |
p02995 | u259861571 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['def gcd(x, y): \n if y == 0:\n return x\n else:\n return gcd(y, x % y)\n\n\ndef lcm(x, y):\n return x*y // (gcd(x, y))\n\n\ndef num(n, c, d):\n c = n // c\n d = n // d\n cd = n // (lcm(c, d))\n return n - c - d + cd\n\n\na, b, c, d = map(int, input().split())\nprint(int(num(b, c, d... | ['Runtime Error', 'Accepted'] | ['s263411953', 's701740623'] | [3064.0, 3064.0] | [17.0, 18.0] | [351, 314] |
p02995 | u260009060 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['# coding=utf-8\n\n###\n\n###\n\nimport sys\nimport math\nimport array\n\n# math class\nclass mymath:\n ### pi\n pi = 3.14159265358979323846264338\n\n \n def pnum_eratosthenes(self, n):\n ptable = [0 for i in range(n+1)]\n plist = []\n\n for i in range(2, n+1):\n if ptable[i... | ['Wrong Answer', 'Accepted'] | ['s615090359', 's893548938'] | [917692.0, 3188.0] | [2160.0, 18.0] | [2553, 2764] |
p02995 | u266964556 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['def lcm(x, y):\n return (x * y) // math.gcd(x, y)\n\n\na,b,c,d = map(int,input().split())\nc_i=a//c\nd_i=a//d\ncd_i=a//(lcm(c,d))\nif not a%c==0:\n c_i+=1\nif not a%d==0:\n d_i+=1\nif not a%(lcm(c,d))==0:\n cd_i+=1\n\nc_f=b//c\nd_f=b//d\ncd_f=b//(lcm(c,d))\n\nprint(b-a-(c_f+d_f-cd_f-c_i-d_i+cd_i+1)+1)\n',... | ['Runtime Error', 'Accepted'] | ['s382859096', 's383929238'] | [3064.0, 3064.0] | [17.0, 17.0] | [296, 487] |
p02995 | u268241742 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['def warikire(warare,waru):\n if warare%waru==0:\n return True\n return False\n\na,b,c,d=map(int,input().split())\ncnt1=0\ncnt2=0\ncnt3=0\nswi=0\nans1=0\nans2=0\nans3=0\n\nfor i in range(a,b+1):\n if swi==1:\n break\n if warikire(i,c):\n cnt1=i\n swi=1\nswi=0\nfor i in range(a,b... | ['Wrong Answer', 'Accepted'] | ['s906696554', 's767401380'] | [3188.0, 3064.0] | [2103.0, 17.0] | [644, 337] |
p02995 | u271198157 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['def gcd(a, b):\n\twhile b:\n\t\ta, b = b, a % b\n\treturn a\ninputs = [int(s) for s in input().split()]\na = inputs[0]\nb = inputs[1]\nc = inputs[2]\nd = inputs[3]\ncount = 0\nminCD = min(c, d)\nmaxCD = max(c, d)\n\nx0 = b-a+1\nx1 = b//minCD - (a-1)//minCD\nx2 = b//maxCD - (a-1)//maxCD\nlcm = minCD * maxCD // gcd(min... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s348076808', 's585953070', 's895804522'] | [3064.0, 3064.0, 3064.0] | [17.0, 17.0, 17.0] | [426, 391, 404] |
p02995 | u273540356 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['# -*- coding: utf-8 -*-\n"""\nCreated on Sat Jun 22 21:34:54 2019\n\n@author: owner\n"""\n# import math\n# import fractions\nimport numpy as np\n\n# def gcd_strategy():\n# return math.gcd if hasattr(math, "gcd") else fractions.gcd\n# \n\n\ndef gcd(a,b):\n while b!=0:\n a,b=b,a%b\n return a\n\ndef lcm(x, y):\... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s001948120', 's419094514', 's454737802', 's455703201', 's526839656', 's550225706', 's647940739', 's688099299', 's713149129', 's719389688', 's408260811'] | [12504.0, 13524.0, 12504.0, 13552.0, 13556.0, 12512.0, 13564.0, 12504.0, 13520.0, 13552.0, 12416.0] | [149.0, 155.0, 151.0, 155.0, 156.0, 157.0, 156.0, 149.0, 159.0, 160.0, 151.0] | [631, 668, 518, 741, 605, 409, 665, 516, 733, 660, 441] |
p02995 | u282652245 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['import fractions\n\nABCD = list(map(int, input().split()))\n\nA = ABCD[0]\nB = ABCD[1]\nC = ABCD[2]\nD = ABCD[3]\n\n\ndef lcm(x, y):\n return (x * y) // fractions.gcd(x, y)\n\nAB = B-A\ncount = 0\n\n\n\nfirstC = int((A-1)/C)\nfirstD = int((A-1)/D)\nfirstCD = int((A-1)/lcm(C,D))\n\n\n# if A%lcm(C,D) ==0 and firstCD... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s011642284', 's044393037', 's067571337', 's147895104', 's260831322', 's531165023', 's616560634', 's630027972', 's668647696', 's956235209', 's970187683', 's625453263'] | [5076.0, 5076.0, 5072.0, 5076.0, 5756.0, 5116.0, 5076.0, 5076.0, 5108.0, 5076.0, 5076.0, 5076.0] | [35.0, 35.0, 35.0, 35.0, 57.0, 36.0, 37.0, 35.0, 36.0, 37.0, 35.0, 35.0] | [573, 594, 624, 549, 643, 640, 632, 508, 486, 948, 510, 830] |
p02995 | u284363684 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['# input\nA, B, C, D = int(input())\n\n\nans = len([1 for i in range(A, B + 1) if i % C != 0 and i % D != 0])\n\nprint(ans)\n', '\n\ndef gcd(m, n):\n x = max(m, n)\n y = min(m, n)\n z = None\n if x % y == 0:\n return y\n else:\n while x % y != 0:\n z = x % y\n x = y\n... | ['Runtime Error', 'Accepted'] | ['s697574799', 's903855524'] | [2940.0, 3064.0] | [18.0, 18.0] | [124, 642] |
p02995 | u287500079 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ["\nimport math\ndef lcm(x, y):\n return (x * y) // math.gcd(x, y)\n\na,b,c,d = [int(i) for i in input().split()]\nC = 0\nD = 0\nE = 0\n'''\nfor i in range(int(a / max(c,d,lcm(c,d))),b-a):\n print(i)\n if c * i >= a and c * i <= b and C == 0:\n C = c * i\n if d * i >= a and d * i <= b and D == 0:\n ... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s666663359', 's717025394', 's735786610', 's969884527', 's384304670'] | [3064.0, 5048.0, 5060.0, 3064.0, 3060.0] | [17.0, 36.0, 35.0, 18.0, 18.0] | [1208, 1927, 1887, 1328, 340] |
p02995 | u295178043 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['A,B,C,D = map(int, input().split())\n\ndef gcd(a, b):\n while b > 0:\n a,b = b, a%b\n return a\n\ndef count(n):\n c = n//C\n d = n//D\n g = gcd(C, D)\n l = C*D//gcd\n return n -c -d +n//l\n\nprint(count(B) - count(A-1))\n', 'A,B,C,D = map(int, input().split())\n\ndef gcd(a, b):\n while ... | ['Runtime Error', 'Accepted'] | ['s344403837', 's992845177'] | [3056.0, 2940.0] | [17.0, 17.0] | [234, 232] |
p02995 | u295585689 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['import math\nA,B,C,D=map(int ,input().split())\na = B//C-A//C\nb = B//D-A//D\nc = math.gcd(C,D)\nd = B//c-A//c\ne = B - A - a -b + d \nprint(e)', 'def gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\nA,B,C,D=map(int ,input().split())\na = B//C-(A-1... | ['Runtime Error', 'Accepted'] | ['s440022146', 's937286603'] | [2940.0, 3060.0] | [18.0, 18.0] | [137, 248] |
p02995 | u295656477 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ["# C\ndef gcd(a,b):\n if a<b: a,b = b,a\n r = a % b\n while(r!=0):\n a,b = b,r\n return b\n\n\ndef nonDivided(n,s,t):\n if not n > 0:\n return 0\n else:\n return n-int(n/s)-int(n/t)+int(n*gcd(s,t)/(s*t))\n\nif __name__=='__main__':\n a,b,c,d = map(int,input().split())\n pri... | ['Wrong Answer', 'Accepted'] | ['s067124906', 's418383344'] | [3064.0, 3064.0] | [2104.0, 20.0] | [379, 366] |
p02995 | u298945776 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['import math\nA, B, C, D = map(int, input().split(" "))\nans = 0\nBc = B // C\nBd = B // D\n\nck = math.gcd(C, D)\nasb = C*D/ck\nBs = B//asb\n\nnewb = B - Bc - Bd + Bs\n\nAc = (A-1) // C\nAd = (A-1) // D\nAs = (A-1)//asb\n\nnewa = (A-1)-Ac-Ad+As\n\nprint(newb-newa)', 'def gcd(a,b):\n while b!=0:\n ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s080928235', 's655451865', 's075492653'] | [3064.0, 3064.0, 3064.0] | [17.0, 17.0, 17.0] | [246, 305, 311] |
p02995 | u309120194 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['import math\nA, B, C, D = map(int, input().split())\n \n\nlcm = C*D // math.gcd(C, D)\na = B-A+1\n\nif A % C != 0 and B % C != 0: b = a // C\nelse: b = a // C + 1\nif A % D != 0 and B % D != 0: c = a // D\nelse: c = a // D + 1\nif A % lcm != 0 and B % lcm != 0: d = a // lcm\nelse: d = a // lcm + 1\n\nprint(a-b-c+d)\n... | ['Wrong Answer', 'Accepted'] | ['s604119861', 's315504862'] | [9196.0, 9120.0] | [26.0, 28.0] | [435, 512] |
p02995 | u309710010 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['a,b,c,d = map(int,input().split())import math\nwarareru = b-a+1\nx = warareru//c\ny = warareru//d\ndef gcd(a, b):\n\twhile b:\n\t\ta, b = b, a % b\n\treturn a\n\n \ndef lcm(a,b):\n return a*b//gcd(a,b)\nz = warareru//lcm(c,d)\nprint(warareru-(x+y-z))', 'a,b,c,d = map(int,input().split())\nimport math\n\ndef gcd(a,... | ['Runtime Error', 'Accepted'] | ['s721926388', 's410611282'] | [2940.0, 3064.0] | [17.0, 18.0] | [252, 282] |
p02995 | u310381103 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['A,B,C,D=list(map(int,input().split()))\nx=max(C,D)\ny=min(C,D)\nif x%y==0:\n gcd=C*D//y\nelse:\n while x%y!=0:\n z=x%y\n x=y\n y=z\n gcd=C*D//z\nprint(B-A+1)', 'A,B,C,D=list(map(int,input().split()))\nx=max(C,D)\ny=min(C,D)\nif x%y==0:\n gcd=C*D//y\nelse:\n while x%y!=0:\n z... | ['Wrong Answer', 'Accepted'] | ['s008771463', 's951045806'] | [3060.0, 3064.0] | [17.0, 17.0] | [176, 224] |
p02995 | u311636831 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['def gcd(a,b):\n while b!=0:\n a,b=b,a%b\n return a\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\nA,B,C,D = map(int, input().split())\n\nAC=int(A/C)\nAD=int(A/D)\nBC=int(B/C)\nBD=int(B/D)\nACD=int(A/lcm(C,D))\nBCD=int(B/lcm(C,D))\nA_=AC+AD-ACD\nB_=BC+BD-BCD\n\nprint(B-A+1-BC-BD+BCD+AC+AD-ACD)\n', ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s301671170', 's448408426', 's661982249', 's218962664'] | [3064.0, 3060.0, 3064.0, 3060.0] | [18.0, 18.0, 17.0, 17.0] | [295, 246, 246, 225] |
p02995 | u318740143 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['import math\nA,B,C,D = map(int,input().split())\ncount = 0\na = (B/C)-(A/C)\nb = (B/D)-(A/D)\nc = (B/(C*D))-(A/(C*D))\n\nif a > 1:\n a = math.ceil(a)\nelse:\n a = 0\nif b > 1:\n b = math.ceil(b)\nelse:\n b = 0\nif c > 1:\n c = math.ceil(c)\nelse:\n c = 0\nif A%C == 0 and B%C == 0:\n a += 1\nif A%D == 0 and B%D... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s377367378', 's681828060', 's582154229'] | [3064.0, 3064.0, 3064.0] | [17.0, 18.0, 17.0] | [388, 248, 279] |
p02995 | u325704929 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['import math\nimport fractions\n\n\ndef count_multiple(A, B, x):\n min_value = math.ceil(A / x)\n max_value = B // x\n \n return max_value - min_value + 1\n\n\nA, B, C, D = [int(i) for i in input().split()]\n\nlcm = C * D // fractions.gcd(C, D)\ncnt = 0\nfor i, x in enumerate([C, D, lcm]):\n if i < 2:\n... | ['Wrong Answer', 'Accepted'] | ['s729845835', 's022528809'] | [5340.0, 3064.0] | [42.0, 18.0] | [436, 606] |
p02995 | u326552320 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# FileName: \tC_fix\n# CreatedDate: 2020-09-03 20:30:23 +0900\n# LastModified: 2020-09-03 20:48:14 +0900\n#\n\n\nimport os\nimport sys\n# import numpy as np\n\n\n\ndef gcd(a, b):\n while a % b != 0:\n r = a % b\n a = b\n b = r\n return b\n... | ['Wrong Answer', 'Accepted'] | ['s672500815', 's711365396'] | [9184.0, 9044.0] | [32.0, 31.0] | [778, 944] |
p02995 | u327162583 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['A,B,C,D = (int(i) for i in input().split())\n\nhogeb = B // D\nhogec = B // C\nhogebc = B // (D * C)\n\nhoge = hogeb + hogec -hogebc\n\nononb = A // D\nononc = A // C\nononbc = A // (D * C)\n\nonon = ononb + ononc - ononbc\n\nprint(hoge-onon)', 'def gcd(a,b):\n while b!=0:\n a,b=b,a%b\n return a\n\ndef lcm(a,b):... | ['Wrong Answer', 'Accepted'] | ['s880386354', 's052113889'] | [3060.0, 3064.0] | [17.0, 17.0] | [228, 344] |
p02995 | u328259252 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | [' while b!=0:\n a,b=b,a%b\n return a\n\nA,B,C,D=map(int,input().split())\n\nc1=B//C\nc2=(A-1)//C\n\ncd1=B//((C*D)/gcd(C,D))\ncd2=(A-1)//((C*D)/gcd(C,D))\n\nd1=B//D\nd2=(A-1)//D\n\n\nprint(int(B-A+1-(c1-c2)-(d1-d2)+(cd1-cd2)))\n', 'def gcd(a,b):\n while b!=0:\n a,b=b,a%b\n return a\n\nA,B,C,D=map(int,input().... | ['Runtime Error', 'Accepted'] | ['s370703442', 's020336195'] | [2940.0, 3064.0] | [17.0, 17.0] | [214, 234] |
p02995 | u332906195 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['A, B, C, D = map(int, input().split())\n\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\n\ndef lcm(a, b):\n return a * b // gcd(a, b)\n\n\nans = B - A + 1\nans -= (B // C + B // D) - (A // C + A // D)\nE = lcm(C, D)\nans += B // E - A // E\n\nprint(ans)\n', 'A, B, C, D = map(int, input().... | ['Wrong Answer', 'Accepted'] | ['s656551085', 's790617238'] | [2940.0, 3060.0] | [17.0, 17.0] | [265, 283] |
p02995 | u333134020 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['def gcd(x,y):\n if(y==0):\n \treturn x\n if(x<y):\n x,y=y,x\n return gcd(y,x % y)\ndef lllen(a,b,c):\n at=a//c\n at=at*c\n b=b//c *c\n ansc=0\n while(at<a):\n at+=c\n ansc=b-at\n if ansc<0 :\n \tansc=0\n else:\n \tansc=ansc//c + 1\n \treturn ansc\n\na,b,c,d=map(int , input().strip().split() )\ntl... | ['Runtime Error', 'Accepted'] | ['s055523173', 's440801477'] | [3064.0, 3064.0] | [18.0, 17.0] | [427, 427] |
p02995 | u334399681 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['import math\ninput = list(map(int,input().split()))\nA = input[0]\nB = input[1]\nC = input[2]\nD = input[3]\n\nbetweenAandB = B-A+1\n\ncA = math.ceil(A/C)\ncB = int(B/C)\ncDiv = cB - cA + 1\n\ndA = math.ceil(A/D)\ndB = int(B/D)\ndDiv = dB - dA + 1\n\nGCD = math.gcd(C,D)\nLCM = C*D/GCD\n\nlcmA = math.ceil(A/LCM)\nlcmB... | ['Runtime Error', 'Accepted'] | ['s061195608', 's662096865'] | [3064.0, 3064.0] | [17.0, 17.0] | [470, 363] |
p02995 | u335830383 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['a,b,c,d=map(int,input().split())\n\ne = c*d//gcd(c,d)\n\nb_c = b//c\nb_d = b//d\nb_e = b//e\na_c = (a-1)//c\na_d = (a-1)//d\na_e = (a-1)//e\n\nprint(b-a+1 - (b_c - a_c) - (b_d - a_d) + (b_e - a_e))', 'def gcd(a,b):\n a,b = max(a,b),min(a,b)\n while a%b!=0:\n a,b = b,a%b\n return b\n\na,b,c,d=map(int,i... | ['Runtime Error', 'Accepted'] | ['s900510225', 's083742508'] | [3064.0, 3064.0] | [17.0, 18.0] | [186, 281] |
p02995 | u344030307 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['import math\n\na,b,c,d = map(int, input().split())\n\nlcm = c*d / math.gcd(c,d)\n\ndef num(i):\n ans = b//i - a//i\n if a % i == 0:\n ans +=1\n return ans\n\nlcm_num = num(lcm)\n\ncd_num = num(c) + num(d)\n\nnum = cd_num - lcm_num\n\nprint(b-a+1-num)', 'import math\n\na,b,c,d = map(int, input().split())\n\nlcm... | ['Wrong Answer', 'Accepted'] | ['s053017624', 's420881595'] | [9120.0, 9184.0] | [33.0, 26.0] | [239, 244] |
p02995 | u346308892 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['def acinput():\n return list(map(int,input().split(" ")))\n\n\ndef gcd(a, b):\n if a < b:\n a, b = b, a\n if b == 0:\n return a\n c = a % b\n return gcd(b, c)\n \n\ndef lcm(x,y):\n return math.floor(x*y /gcd(x, y))\n\na,b,c,d=acinput()\n\n\nl=lcm(c,d)\nn_CandD=int(b/l)-int((a-1)/l)\nn_... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s286461699', 's345355191', 's295841236'] | [3064.0, 3064.0, 3064.0] | [17.0, 17.0, 18.0] | [384, 317, 308] |
p02995 | u350093546 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['from math import gcd\na,b,c,d=map(int,input().split())\ne=c*d//gcd(c,d)\nprint((a-1)//c-b//c+(a-1)//d-b//d+b//e-(a-1)//e)', 'import math\na,b,c,d=map(int,input().split())\nx=b-b//c-b//d+b//(c*d//math.gcd(c*d))\ny=(a-1)-(a-1)//c-(a-1)//d+(a-1)//(c*d//math.gcd(c*d))\nprint(x-y)\n', 'n,l=map(int,input().split())\na=l\nb... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s168495353', 's196465625', 's471340724', 's561441856'] | [3060.0, 9104.0, 2940.0, 9088.0] | [17.0, 24.0, 17.0, 31.0] | [118, 148, 128, 147] |
p02995 | u353895424 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['from fractions import gcd\n\ndef x(k, c, d):\n rl1 = k\n lcm = c*d / math.gcd(c,d)\n ccount = int(rl1 // c)\n dcount = int(rl1 // d)\n if lcm != 0:\n cdcount = int(rl1 // lcm)\n else:\n cdcount = 0\n\n return int(rl1 - ccount - dcount + cdcount)\n\na, b, C, D = map(int, input().spli... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s091091692', 's623604463', 's739124807', 's861810416', 's120073235'] | [5048.0, 5432.0, 5304.0, 5048.0, 9088.0] | [35.0, 45.0, 40.0, 37.0, 27.0] | [341, 337, 337, 355, 279] |
p02995 | u357751375 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['a,b,c,d = map(int,input().split())\na1 = a // c\na2 = b // c\nb1 = b // c\nb2 = b // d\ne = c\nwhile c % d != 0:\n c += e\na3 = a // c\nb3 = b // c\nprint((b - b1 - b2 + b3) - (a - a1 - a2 + a3))', 'import math\na,b,c,d = map(int,input().split())\ne = c*d / math.gcd(c,d)\n\ndef div(z):\n p = (z//c) + (z//d) - (... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s372776225', 's497609972', 's970224553'] | [9184.0, 9192.0, 9144.0] | [2205.0, 25.0, 27.0] | [188, 175, 187] |
p02995 | u361841553 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['def gcd(a, b):\n if b == 0:\n return a\n else:\n return gcd(b, a%b)\n \n \ndef lcd(a, b):\n return a*b // gcd(a, b)\n \na, b, c, d = map(int, input().split())\nsum1 = (a - 1) // c + (a - 1) // d + (a - 1) // lcd(c, d)\nsum2 = b // c + b // d + b // lcd(c, d)\nprint(sum2 - sum1)', 'def gcd(a, b... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s071103842', 's146844724', 's701711236'] | [3060.0, 3060.0, 3188.0] | [17.0, 17.0, 20.0] | [289, 304, 304] |
p02995 | u362563655 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['def gcd(a,b):\n while b:\n a, b = b, a%b\n return a\n\ndef lcm(a,b):\n return a * b // gcd(a,b)\n\n\n\nA,B,C,D = map(int,input().split())\n\nif A % C ==0:\n c = (B//C) - (A//C) +1\nelse:\n c = (B//C) - (A//C)\n\nif A % D ==0:\n d = (B//D) - (A//D) +1\nelse:\n d = (B//D) - (A//D)\n\nE = lcm... | ['Wrong Answer', 'Accepted'] | ['s300456383', 's662306311'] | [3064.0, 3064.0] | [17.0, 17.0] | [406, 393] |
p02995 | u364774090 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['A, B, C, D = list(map(int, input().split()))\nnans = 0\nimport math\ncs = A if A % C == 0 else math.ceil(A / C) * C\nds = A if A % D == 0 else math.ceil(A / D) * D\nE = (C * D) // math.gcd(C, D)\nprint(E)\nes = A if A % E == 0 else math.ceil(A / E) * E\n\nce = B // C * C\nde = B // D * D\nee = B // E * E\n\nnans = (c... | ['Wrong Answer', 'Accepted'] | ['s318034832', 's559065799'] | [9172.0, 9148.0] | [28.0, 29.0] | [390, 226] |
p02995 | u372102441 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['\nimport math\n\nS = input().split()\nA = int(S[0])\nB = int(S[1])\nC = int(S[2])\nD = int(S[3])\n\nE = C * D / math.gcd(C, D)\nX = (B//C)-(A//C)\nY = (B//D)-(A//D)\nZ = (B//(E))-(A//(E))+1\n\nprint(int(B-A-X-Y+Z))\n', 'S = input().split()\nA = int(S[0])\nB = int(S[1])\nC = int(S[2])\nD = int(S[3])\n\nX = (B/C)-(A/C)... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s268462292', 's341958740', 's358528371', 's414986649', 's491900263', 's516427580', 's620178677', 's638042590', 's441045444'] | [3060.0, 3060.0, 3060.0, 3060.0, 3064.0, 3060.0, 3444.0, 3064.0, 3064.0] | [17.0, 17.0, 17.0, 18.0, 19.0, 17.0, 22.0, 17.0, 17.0] | [201, 156, 179, 198, 211, 204, 306, 213, 330] |
p02995 | u374829922 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['a,b,c,d = map(int, input().split())\ncount = 0\n\n\ndef gcd(a,b):\n while b!=0:\n a,b = b,a%b\n return a\n \ndef lcm(a,b):\n return a*b // gcd(a,b)\n\ngcd_num = lcm(c,d)\n\n#a\na_count = a // c\na_count = a_count + (a//d)\na_count = a_count - (a//gcd_num)\na_count = a-a_count\n\n#b\nb_count = b // c\n... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s097460173', 's172167262', 's363793484', 's667676722'] | [3064.0, 3064.0, 3064.0, 3064.0] | [17.0, 17.0, 18.0, 17.0] | [441, 501, 521, 454] |
p02995 | u374974389 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['a,b,c,d = map(int,input().split())\ncount = 0\nd = (a + b) // 2\nfor i in range(a,d):\n print(i)\n if(i % c != 0 and i % d != 2):\n count += 1\nfor i in range(d,b + 1):\n print(i) \n if(i % c != 0 and i % d != 2):\n count += 1\n\nprint(count) ', 'def gcd(c, d):\n if (d == 0): return c\n ... | ['Wrong Answer', 'Accepted'] | ['s433887626', 's417148298'] | [51316.0, 3060.0] | [2104.0, 17.0] | [257, 282] |
p02995 | u375542418 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['def gcd(a, b):\n\twhile b:\n\t\ta, b = b, a % b\n\treturn a\n \ndef lcm(a, b):\n\treturn a * b // gcd (a, b)\n \nA,B,C,D=map(int, input().split())\ndivC = B//C - A//C\ndivD = B//D - A//D\nCD = lcm(C,D)\ndivCD = B//CD - A//CD\ndivsum=divC+divD-divCD\nanswer=B-A+1-divsum\n\nprint(answer)\n', 'def gcd(a, b):\n\twhile ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s021997930', 's460061120', 's262275438'] | [3060.0, 3064.0, 3060.0] | [17.0, 17.0, 17.0] | [268, 283, 280] |
p02995 | u375695365 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['import fractions\na,b,c,d=map(int,input().split())\n\nx1=b//c-a//c\nx2=b//d-a//d\nsks=c * d // fractions.gcd(c,d)\nx3=b//sks-a//sks\nans=b-a-(x1+x2-x3)\nprint (ans)\n', '\nimport fractions\na,b,c,d=map(int,input().split())\nx1=b//c-(a-1)//c \nx2=b//d-(a-1)//d\u3000\nsks=c * d // fractions.gcd(c,d)\nx3=b//sks-(a-1)//s... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s030715138', 's031100715', 's724047628', 's426286234'] | [5048.0, 3188.0, 2940.0, 9144.0] | [35.0, 18.0, 17.0, 26.0] | [157, 303, 143, 237] |
p02995 | u391731808 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['A,B,C,D = map(int,input().split())\ndef f(B,n):\n return B//n\ndef gcd(a,b):\n if b==0:return a\n return gcd(b,a%b)\nE = C*D/gcd(C,D)\nprint(B - f(B,C) - f(B,D) + f(B,E) - (A-1 - f(A-1,C) - f(A-1,D) + f(A-1,E)))', 'A,B,C,D = map(int,input().split())\ndef f(B,n):\n return B//n\ndef gcd(a,b):\n if b==0:return a\n ... | ['Wrong Answer', 'Accepted'] | ['s760128280', 's649193183'] | [3064.0, 3064.0] | [17.0, 17.0] | [207, 208] |
p02995 | u391819434 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['A,B,C,D=map(int,input().split())\nprint(A,B,C,D)\n\nfrom math import*\nupto_B=B-(B//C+B//D-B//(C*D//gcd(C,D)))\nupto_A=A-1-((A-1)//C+(A-1)//D-(A-1)//(C*D//gcd(C,D)))\n\nprint(upto_B-upto_A*(A>2))', 'A,B,C,D=map(int,input().split())\nprint(A,B,C,D)\n\nfrom fractions import*\nupto_B=B-(B//C+B//D-B//(C*D//gcd(C,D)))\nup... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s043958608', 's613561810', 's156819701'] | [9116.0, 10496.0, 9136.0] | [26.0, 40.0, 28.0] | [188, 193, 173] |
p02995 | u393512980 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['def gcd(x, y):\n if y == 0:\n return x\n return gcd(y, x % y)\n\na, b, c, d = map(int, input().split())\nx2 = b // c\nx1 = (a - 1) // c\ny2 = b // d\ny1 = (a - 1) // d\nt = c * d // gcd(c, d)\nz2 = b // t\nz1 = (a - 1) // t\nprint(x2, x1, y2, y1, z2, z1)\nprint(b - a + 1 - (x2 - x1) - (y2 - y1) + (z2 - z... | ['Wrong Answer', 'Accepted'] | ['s601309950', 's545550247'] | [3064.0, 3064.0] | [18.0, 17.0] | [307, 277] |
p02995 | u395202850 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['import math\nimport fractions\n\n\ndef calc(x):\n aa = math.ceil(a/x)*x\n bb = math.floor(b/x)*x\n return int((bb - aa) // x + 1)\n\n\na, b, c, d = map(int, input().split())\ncd = c * d / fractions.gcd(c, d)\n# print(b - a + 1, calc(cd), calc(c), calc(d))\nprint(int(b - a + 1 + calc(cd) - calc(c) - calc(d)))... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s142720993', 's149343570', 's170627009', 's796837848', 's874912865', 's032343704'] | [5304.0, 5432.0, 5856.0, 5088.0, 5216.0, 9004.0] | [39.0, 48.0, 57.0, 36.0, 38.0, 32.0] | [306, 259, 293, 259, 419, 169] |
p02995 | u408375121 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['def gcd(c, d):\n if c <= d:\n c, d = d, c\n while c % d:\n c, d = d, c % d\n return d\ndef lcm(c, d):\n return c*d // gcd(c, d)\n\nA, B, C, D = map(int, input().split())\nc_or_d = (B//C - A//C) + (B // D - A // D) -(B // lcm(C, D) - A // lcm(C, D))\nprint(B - A + 1 - c_or_d)', 'def gcd(c, d):\n if c <= d:\... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s244574110', 's694678499', 's704616124', 's544083342'] | [3064.0, 3060.0, 3060.0, 3060.0] | [17.0, 17.0, 17.0, 17.0] | [274, 283, 296, 314] |
p02995 | u410269178 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['A, B, C, D = list(map(int, input().split()))\n\ndef gcd(x, y):\n while y:\n x, y = y, x % y\n return x\n\ndef f(X, C, D):\n return int(X // C) + int(X // D) - int(X // ((C * D ) / gcd(C, D)))\n\nans = int((B - A + 1)) - int(f(B, C, D)) + int(f(A, C, D))\n\nprint(ans)', 'A, B, C, D = list(map(int, inpu... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s037724080', 's046759532', 's254506471', 's919282966', 's591677959'] | [3064.0, 3064.0, 3060.0, 3060.0, 9112.0] | [17.0, 20.0, 17.0, 18.0, 31.0] | [271, 261, 213, 231, 201] |
p02995 | u411302151 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['from math import ceil\n\nA, B, C, D = map(int, input().split())\n\n\nCdiff = ceil(B/C) - ceil((A-1)/C)\nDdiff = ceil(B/D) - ceil((A-1)/D)\n\nCDdiff = ceil(B/(C*D) ) - ceil((A-1)/(C*D))\n\nres = Cdiff+Ddiff-CDdiff\nprint((B-A)-res)', 'from math import floor\n\ndef gcd(a,b):\n while b:\n a, b = b , a%b\n r... | ['Wrong Answer', 'Accepted'] | ['s179812471', 's424712767'] | [3060.0, 3060.0] | [17.0, 17.0] | [219, 287] |
p02995 | u419951680 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['def gcd(a,b):\n while b:\n a,b=b,a%b\n return a\n \ndef lcm(x,y):\n return int(x*y/gcd(x,y))\n\nA,B,C,D=map(int,input().split())\n\nS=B-A+1\nif(A%C==0):\n n_C=B//C-A//C+1\nelse:\n n_C=B//C-A//C\n\nif(A%D==0):\n n_D=B//D-A//D+1\nelse:\n n_D=B//D-A//D\n\nif(A%lcm(C,D)==0):\n n_CD=... | ['Wrong Answer', 'Accepted'] | ['s245358853', 's684623773'] | [3064.0, 3064.0] | [17.0, 18.0] | [387, 490] |
p02995 | u425834921 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['i = list(map(int,input().split()))\na = i[0]\nb = i[1]\nc = i[2]\nd = i[3]\n \nn = 0\nm = 0\nnm = 0\n \n \nfor i in range(a,b):\n if i % c == 0:\n n =+ 1\n \n \nfor j in range(a,b):\n if j % d == 0:\n m =+ 1\n \n \nfor k in range(a,b):\n if (k % c == 0) and (k%d == 0):\n nm =+ 1\n \n \nA = ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answe... | ['s032110548', 's138910550', 's152797799', 's154653731', 's283114635', 's283618222', 's315247886', 's321444789', 's344384705', 's350259073', 's352888384', 's428898827', 's487628025', 's507643781', 's587707331', 's654271811', 's700022501', 's715007512', 's765858768', 's797402366', 's874401198', 's919630369', 's953441522... | [3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3316.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3060.0, 3064.0, 3064.0, 3064.0] | [2104.0, 17.0, 17.0, 17.0, 2104.0, 18.0, 2104.0, 17.0, 17.0, 18.0, 17.0, 21.0, 17.0, 17.0, 17.0, 17.0, 2104.0, 17.0, 2104.0, 2104.0, 2104.0, 17.0, 17.0, 17.0, 17.0] | [327, 277, 274, 282, 329, 262, 329, 278, 302, 274, 274, 307, 308, 313, 274, 301, 311, 280, 327, 328, 317, 175, 278, 301, 308] |
p02995 | u429319815 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['A, B, C, D = map(int, input().split())\n\nif A%C==0:\n c_num = B//C - A//C + 1\nelse:\n c_num = B//C - A//C\n\nif A%D==0:\n d_num = B//D - A//D + 1\nelse:\n d_num = B//D - A//D\n\nprint(B - A + 1 - c_num - d_num + cd_num)', '\ndef gcd(a, b):\n while b:\n a, b = b, a%b\n return a\n\n\ndef lcm(... | ['Runtime Error', 'Accepted'] | ['s228085031', 's806300198'] | [3060.0, 3064.0] | [18.0, 17.0] | [221, 334] |
p02995 | u434872492 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['A, B, C, D = map(int,input().split())\nans = 0\nx1c = B // C\nx1d = B // D\nx2c = (A-1) // C\nx2d = (A-1) // D\ndef gcd(x,y):\n while y != 0:\n x, y = y, x%y\n return x\ng = gcd(C,D)\nl = (C*D) / g\nx1cd = B // l\nx2cd = (A-1) // l\nans_B = B - (x1c+x1d-x1cd)\nans_A = (A-1) - (x2c+x2d-x2cd)\nans = ans_B ... | ['Wrong Answer', 'Accepted'] | ['s159809649', 's099323592'] | [3064.0, 3064.0] | [17.0, 18.0] | [320, 392] |
p02995 | u437215432 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['# ABC131C\n\ndef euclid(m, n):\n m0 = m = abs(m)\n n0 = n = abs(n)\n while n != 0:\n m, n = n, m % n\n qm = m0 // m\n lcm = qm * n0\n return lcm\n\n\ndef check(a, b, c):\n x = a // c\n y = b // c\n if x * c < a:\n x += 1\n return y - x + 1\n\na, b, c, d = map(int, input().s... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s212285432', 's491411980', 's510558193', 's314707867'] | [3064.0, 3316.0, 3064.0, 3064.0] | [17.0, 21.0, 17.0, 17.0] | [410, 261, 413, 413] |
p02995 | u439312138 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['A,B,C,D = map(int,input().split())\n \ndef gcd(a,b):\n while b!=0:\n a,b=b,a%b\n return a\n \nctr = 0\n \ntmp1 = A // C\ntmp2 = A // D\ntmp3 = B // (C * D / gcd(C,D))\ntmp4 = B // C\ntmp5 = B // D\n \nprint(int(tmp4 + tmp5 - tmp3 - tmp1 -tmp2))\n ', 'A,B,C,D = map(int,input().split())\n \ndef gcd( x, y ):\n w... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s046065558', 's730477740', 's870917287', 's958727669', 's185438933'] | [3060.0, 3064.0, 2940.0, 3060.0, 3060.0] | [17.0, 18.0, 18.0, 17.0, 17.0] | [236, 232, 249, 229, 267] |
p02995 | u440975163 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['def gcd(a, b):\n \n while b != 0:\n a, b = b, a % b\n\n return(a)\ndef lcm(a, b):\n \n return a * b // gcd(a, b)\n\nA, B, C, D = list(map(int, input().split()))\n \nlcmCD = lcm(C, D)\n \ndivB = (B // C) + (B // D) - (B // lcmCD)\ndivA_1 = ((A - 1) // C) + ((A - 1) // D) - ((A - 1) // lcmCD)\... | ['Wrong Answer', 'Accepted'] | ['s560303805', 's941644209'] | [3064.0, 3064.0] | [18.0, 17.0] | [444, 441] |
p02995 | u450983668 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['a,b,c,d=map(int, input().split())\ntc = b//c-a//c\ntd = b//d-a//d\ntcd = b//(c*d)-a//(c*d)\nprint(b-a+1-tc-td+tcd)', 'a,b,c,d=map(int, input().split())\ntc = b//c-a//c\ntd = b//d-a//d\ntcd = b//(c*d)-a//(c*d)\nprint(b-a+1-tc-tc+tcd)', 'import fractions\na,b,c,d=map(int, input().split())\ncdlcm= a*b//fractions.gcd(a,b... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s221648954', 's601717365', 's674473204', 's366931057'] | [3060.0, 2940.0, 5304.0, 3064.0] | [17.0, 17.0, 37.0, 17.0] | [110, 110, 163, 244] |
p02995 | u453623947 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['a,b,c,d = map(int,input().split())\n\nbc = b//c\nbd = b//d\n\nimport math\nbcd = c*d/math.gcd(c,d)\n\nac = (a-1)//c\nad = (a-1)//d\nacd = c*d//math.gcd(c,d)\n\nans = (b-(bc+bd-bcd))-((a-1)-(ac+ad-acd))\n\nprint(int(ans))\n', 'a,b,c,d = map(int,input().split())\n\nbc = b//c\nbd = b//d\n\nimport math\nbcd = c*d//math.g... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s095538315', 's950316330', 's983971147', 's807229872'] | [9188.0, 9124.0, 9256.0, 9128.0] | [28.0, 26.0, 31.0, 27.0] | [207, 203, 215, 213] |
p02995 | u459798349 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['a,b,c,d=map(int,input().split())\n\nif c!=d:\n \n \n sma=min(c,d)\n big=max(c,d)\n \n while sma!=0 :\n cal=big%sma\n big=sma\n sma=cal\n \n euc=big\n ggg=c*d//euc\n \n #print(euc,ggg)\n \n def cnt(n,ggg,c,d):\n exc=ggg//c + ggg//d\n if c<ggg o... | ['Wrong Answer', 'Accepted'] | ['s348908065', 's662799257'] | [3064.0, 3064.0] | [17.0, 17.0] | [667, 668] |
p02995 | u460386402 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['a,b,c,d=map(int,input().split())\nzen=int(b-a)\nc=int(zen//c)\nd=int(zen//d)\nkasa=int(zen/(c*d))\n\nans=zen-c-d+kasa\n\nprint(ans)', 'import math\na,b,c,d=map(int,input().split())\ncount=b-a+1\nacou=((a-1)//c)+((a-1)//d)-int(((a-1)//(c*d//math.gcd(c,d))))\nbcou=(b//c)+(b//d)-int((b//(c*d//math.gcd(c,d))))\nprint(cou... | ['Runtime Error', 'Accepted'] | ['s464997466', 's703521166'] | [3060.0, 9096.0] | [17.0, 27.0] | [123, 194] |
p02995 | u463775490 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['import fraction\na,b,c,d = map(int,input().split())\nlcm = c*d // fraction.gcd(c,d)\nA = ((a-1) // c) + ((a-1) // d) - ((a-1) // lcm)\nB = (b // c) + (b // d) - (b // lcm)\ntotal = B - A\nprint(b - a + 1 - total)\n', 'a,b,c,d = map(int,input().split())\nans = b - a + 1\nx = c * d\ne = c\nf = d\nif e < f:\n e = f\n... | ['Runtime Error', 'Accepted'] | ['s465196775', 's974675527'] | [2940.0, 3064.0] | [18.0, 17.0] | [207, 255] |
p02995 | u471212175 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['from fractions import gcd \n\nl = list(map(int,input().split()))\nA = l[0]\nB = l[1]\nC = l[2]\nD = l[3]\n\nE = C * D //math.gcd(C,D)\n\nf = B//C - (A-1)//C\nf = f+(B//D - (A-1)//D)\nans = B-A+1-f + B//E-(A-1)//E\nprint(ans)\n', 'import fractions\n\nl = list(map(int,input().split()))\nA = l[0]\nB = l[1]\nC = l[2]\nD ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s162664017', 's560993927', 's366413037'] | [5052.0, 5052.0, 3064.0] | [36.0, 36.0, 17.0] | [212, 202, 334] |
p02995 | u473092610 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['\n#include<string>\n\n#include<algorithm>\n#include<numeric>\n#include<cmath>\n#include<stdio.h>\n//#include<array>\n\n#define rep(i,n) for(int i=0;i<(n);i++)\n#define LL long long int\n\n\nusing namespace std;\n\nint main(void){\n LL a,b,c,d;\n cin >> a>>b>>c>>d;\n\n LL ans=0;\n /* \n for(int i =a; i<... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s427307528', 's727115314', 's779734961', 's552586832'] | [2940.0, 2940.0, 3188.0, 3064.0] | [17.0, 17.0, 18.0, 17.0] | [905, 910, 173, 270] |
p02995 | u476435125 | 2,000 | 1,048,576 | You are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D. | ['def gcd(a,b):\n if a<b:\n a,b=b,a\n c=a%b\n if c==0:\n return b\n return gcd(b,c)\nA,B,C,D=map(int,input().split())\nif A%C==0:\n #nc=int(B/C)-int(A/C)+1\n nc=B//C-A//C+1\nelse:\n #nc=int(B/C)-int(A/C)\n nc=B//C-A//C\nif A%D==0:\n #nd=int(B/C)-int(A/C)+1\n #nd=int(B/D)-int(... | ['Wrong Answer', 'Accepted'] | ['s944896603', 's828625340'] | [3064.0, 3060.0] | [17.0, 17.0] | [600, 268] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.