message
stringlengths
2
45.8k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
254
108k
cluster
float64
3
3
__index_level_0__
int64
508
217k
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Lunar rover finally reached planet X. After landing, he met an obstacle, that contains permutation p of length n. Scientists found out, that to overcome an obstacle, the robot should make p an i...
instruction
0
69,166
3
138,332
Yes
output
1
69,166
3
138,333
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Lunar rover finally reached planet X. After landing, he met an obstacle, that contains permutation p of length n. Scientists found out, that to overcome an obstacle, the robot should make p an i...
instruction
0
69,167
3
138,334
No
output
1
69,167
3
138,335
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Lunar rover finally reached planet X. After landing, he met an obstacle, that contains permutation p of length n. Scientists found out, that to overcome an obstacle, the robot should make p an i...
instruction
0
69,168
3
138,336
No
output
1
69,168
3
138,337
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Lunar rover finally reached planet X. After landing, he met an obstacle, that contains permutation p of length n. Scientists found out, that to overcome an obstacle, the robot should make p an i...
instruction
0
69,169
3
138,338
No
output
1
69,169
3
138,339
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Lunar rover finally reached planet X. After landing, he met an obstacle, that contains permutation p of length n. Scientists found out, that to overcome an obstacle, the robot should make p an i...
instruction
0
69,170
3
138,340
No
output
1
69,170
3
138,341
Provide tags and a correct Python 3 solution for this coding contest problem. Among other things, Bob is keen on photography. Especially he likes to take pictures of sportsmen. That was the reason why he placed himself in position x0 of a long straight racetrack and got ready to take pictures. But the problem was that...
instruction
0
69,174
3
138,348
Tags: implementation Correct Solution: ``` n, x0 = map(int, input().split()) kiri = 0 kanan = 1000 for _ in range(n): a, b = map(int, input().split()) kiri = max(kiri, min(a, b)) kanan = min(kanan, max(a, b)) if kiri > kanan: print(-1) elif kiri <= x0 <= kanan: print(0) elif x0 < kiri: print(...
output
1
69,174
3
138,349
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Among other things, Bob is keen on photography. Especially he likes to take pictures of sportsmen. That was the reason why he placed himself in position x0 of a long straight racetrack and got r...
instruction
0
69,179
3
138,358
Yes
output
1
69,179
3
138,359
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Among other things, Bob is keen on photography. Especially he likes to take pictures of sportsmen. That was the reason why he placed himself in position x0 of a long straight racetrack and got r...
instruction
0
69,180
3
138,360
Yes
output
1
69,180
3
138,361
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Among other things, Bob is keen on photography. Especially he likes to take pictures of sportsmen. That was the reason why he placed himself in position x0 of a long straight racetrack and got r...
instruction
0
69,181
3
138,362
Yes
output
1
69,181
3
138,363
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Among other things, Bob is keen on photography. Especially he likes to take pictures of sportsmen. That was the reason why he placed himself in position x0 of a long straight racetrack and got r...
instruction
0
69,182
3
138,364
Yes
output
1
69,182
3
138,365
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Among other things, Bob is keen on photography. Especially he likes to take pictures of sportsmen. That was the reason why he placed himself in position x0 of a long straight racetrack and got r...
instruction
0
69,183
3
138,366
No
output
1
69,183
3
138,367
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Among other things, Bob is keen on photography. Especially he likes to take pictures of sportsmen. That was the reason why he placed himself in position x0 of a long straight racetrack and got r...
instruction
0
69,184
3
138,368
No
output
1
69,184
3
138,369
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Among other things, Bob is keen on photography. Especially he likes to take pictures of sportsmen. That was the reason why he placed himself in position x0 of a long straight racetrack and got r...
instruction
0
69,185
3
138,370
No
output
1
69,185
3
138,371
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Among other things, Bob is keen on photography. Especially he likes to take pictures of sportsmen. That was the reason why he placed himself in position x0 of a long straight racetrack and got r...
instruction
0
69,186
3
138,372
No
output
1
69,186
3
138,373
Provide tags and a correct Python 3 solution for this coding contest problem. The Smart Beaver from ABBYY plans a space travel on an ultramodern spaceship. During the voyage he plans to visit n planets. For planet i ai is the maximum number of suitcases that an alien tourist is allowed to bring to the planet, and bi i...
instruction
0
69,204
3
138,408
Tags: binary search Correct Solution: ``` n,c = map(int,input().split()) from sys import stdin lst,q,zero = [],0,0 for i in range(n): a,b = map(int,stdin.readline().split()) lst.append([a,b]) q=max(q,b*c) if a==0:zero+=1 def cout(x): res=n for i,item in enumerate(lst): y,z=item[0],item[1...
output
1
69,204
3
138,409
Provide tags and a correct Python 3 solution for this coding contest problem. The Smart Beaver from ABBYY plans a space travel on an ultramodern spaceship. During the voyage he plans to visit n planets. For planet i ai is the maximum number of suitcases that an alien tourist is allowed to bring to the planet, and bi i...
instruction
0
69,205
3
138,410
Tags: binary search Correct Solution: ``` # by the authority of GOD author: manhar singh sachdev # import os,sys from io import BytesIO, IOBase def check(a,b,tar,x): ans = 0 for i in range(len(a)): ans += (a[i]*x)//b[i] if ans == tar: return 0 elif ans > tar: return 1 els...
output
1
69,205
3
138,411
Provide tags and a correct Python 3 solution for this coding contest problem. The Smart Beaver from ABBYY plans a space travel on an ultramodern spaceship. During the voyage he plans to visit n planets. For planet i ai is the maximum number of suitcases that an alien tourist is allowed to bring to the planet, and bi i...
instruction
0
69,206
3
138,412
Tags: binary search Correct Solution: ``` def f(x, t): y = x while sum((y * a) // b for a, b in t) < c: y += 1000000 while y - x > 1: z = (x + y) // 2 d = sum((z * a) // b for a, b in t) if d < c: x = z else: y = z return y n, c = map(int, input().split()) c -= n t =...
output
1
69,206
3
138,413
Provide tags and a correct Python 3 solution for this coding contest problem. The Smart Beaver from ABBYY plans a space travel on an ultramodern spaceship. During the voyage he plans to visit n planets. For planet i ai is the maximum number of suitcases that an alien tourist is allowed to bring to the planet, and bi i...
instruction
0
69,207
3
138,414
Tags: binary search Correct Solution: ``` n, c = map(int, input().split()) a = [] b = [] for i in range(n): aa, bb = map(int, input().split()) a.append(aa) b.append(bb) def all_zero(): for aa in a: if aa > 0: return False return True def days(x): c = 0 for aa, bb in zip(a, b): ...
output
1
69,207
3
138,415
Provide tags and a correct Python 3 solution for this coding contest problem. The Smart Beaver from ABBYY plans a space travel on an ultramodern spaceship. During the voyage he plans to visit n planets. For planet i ai is the maximum number of suitcases that an alien tourist is allowed to bring to the planet, and bi i...
instruction
0
69,208
3
138,416
Tags: binary search Correct Solution: ``` I=lambda:map(int,input().split()) n,c=I() a,b=[],[] for _ in range(n):x,y=I();a.append(x);b.append(y) if max(a)==0:print([0,-1][n==c]);exit() def f(x): r=0 for i in range(n): r+=1+a[i]*x//b[i] if r>c:break return r l=-1 r=10**18 while l<r-1: m=(l+r)//2 if f(m)<c:l=m e...
output
1
69,208
3
138,417
Provide tags and a correct Python 3 solution for this coding contest problem. The Smart Beaver from ABBYY plans a space travel on an ultramodern spaceship. During the voyage he plans to visit n planets. For planet i ai is the maximum number of suitcases that an alien tourist is allowed to bring to the planet, and bi i...
instruction
0
69,209
3
138,418
Tags: binary search Correct Solution: ``` input=__import__('sys').stdin.readline def check(x): tmp=0 for i in range(n): tmp+=(1 + (lis[i][0]*x)//lis[i][1]) return tmp def zer(lis): for i in lis: if i[0]>0: return False return True n,c = map(int,input().split()) lis...
output
1
69,209
3
138,419
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The Smart Beaver from ABBYY plans a space travel on an ultramodern spaceship. During the voyage he plans to visit n planets. For planet i ai is the maximum number of suitcases that an alien tour...
instruction
0
69,210
3
138,420
No
output
1
69,210
3
138,421
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The Smart Beaver from ABBYY plans a space travel on an ultramodern spaceship. During the voyage he plans to visit n planets. For planet i ai is the maximum number of suitcases that an alien tour...
instruction
0
69,211
3
138,422
No
output
1
69,211
3
138,423
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The Smart Beaver from ABBYY plans a space travel on an ultramodern spaceship. During the voyage he plans to visit n planets. For planet i ai is the maximum number of suitcases that an alien tour...
instruction
0
69,212
3
138,424
No
output
1
69,212
3
138,425
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The Smart Beaver from ABBYY plans a space travel on an ultramodern spaceship. During the voyage he plans to visit n planets. For planet i ai is the maximum number of suitcases that an alien tour...
instruction
0
69,213
3
138,426
No
output
1
69,213
3
138,427
Provide tags and a correct Python 3 solution for this coding contest problem. There will be a launch of a new, powerful and unusual collider very soon, which located along a straight line. n particles will be launched inside it. All of them are located in a straight line and there can not be two or more particles loca...
instruction
0
69,443
3
138,886
Tags: implementation Correct Solution: ``` n = int(input()) s = input() a = list(map(int,input().split())) if "L" not in s: print(-1) exit(0) if "R" not in s: print(-1) exit(0) ans = [] f = 0 for i in range(n): if s[i] == "R": right = a[i] f = 1 elif f and s[i] == "L": ...
output
1
69,443
3
138,887
Provide tags and a correct Python 3 solution for this coding contest problem. There will be a launch of a new, powerful and unusual collider very soon, which located along a straight line. n particles will be launched inside it. All of them are located in a straight line and there can not be two or more particles loca...
instruction
0
69,444
3
138,888
Tags: implementation Correct Solution: ``` import sys n = int(input()) d = input() x = list(map(int, input().split())) r = 0 l = 0 m = sys.maxsize while True: r = d.find('R', l) if r == -1: break l = d.find('L', r + 1) if l == -1: break r = l - 1 if m > (x[l] - x[r]) // 2: m = (x[l] - x[r]) // 2 if m...
output
1
69,444
3
138,889
Provide tags and a correct Python 3 solution for this coding contest problem. There will be a launch of a new, powerful and unusual collider very soon, which located along a straight line. n particles will be launched inside it. All of them are located in a straight line and there can not be two or more particles loca...
instruction
0
69,445
3
138,890
Tags: implementation Correct Solution: ``` NONE = 10 ** 10 n = int(input()) direct = input() pos = [int(x) for x in input().split()] best = NONE for i,x in enumerate(pos): if i+1 == n: break if direct[i:i+2] != 'RL': continue best = min(best, pos[i+1] - x) if best == NONE: best = -1 ...
output
1
69,445
3
138,891
Provide tags and a correct Python 3 solution for this coding contest problem. There will be a launch of a new, powerful and unusual collider very soon, which located along a straight line. n particles will be launched inside it. All of them are located in a straight line and there can not be two or more particles loca...
instruction
0
69,446
3
138,892
Tags: implementation Correct Solution: ``` n = int(input()) direction = input() x = list(map(int,input().split())) ind = direction.find("RL") if ind == -1: print(ind) exit() minimum = (x[ind+1]-x[ind])//2 for i in range(n-1): if direction[i]+direction[i+1]=='RL': if minimum>(x[i+1]-x[i])//2: minimum=(x[i+1]-x[i...
output
1
69,446
3
138,893
Provide tags and a correct Python 3 solution for this coding contest problem. There will be a launch of a new, powerful and unusual collider very soon, which located along a straight line. n particles will be launched inside it. All of them are located in a straight line and there can not be two or more particles loca...
instruction
0
69,447
3
138,894
Tags: implementation Correct Solution: ``` n=int(input()) d=input() l=list(map(int,input().split())) m=0 r=10**9 for i in range(n-1): if d[i]=='R' and d[i+1]=='L': m=(l[i+1]-l[i])/2 if m<r: r=m if r==10**9: print(-1) else: print(int(r)) ```
output
1
69,447
3
138,895
Provide tags and a correct Python 3 solution for this coding contest problem. There will be a launch of a new, powerful and unusual collider very soon, which located along a straight line. n particles will be launched inside it. All of them are located in a straight line and there can not be two or more particles loca...
instruction
0
69,448
3
138,896
Tags: implementation Correct Solution: ``` def inp(): return(int(input())) def inlt(): return(list(map(int,input().split()))) def insr(): s = input() return(list(s[:len(s) - 1])) def invr(): return(map(int,input().split())) def loadinput(): n = int(input()) di = list(str(input())) vals...
output
1
69,448
3
138,897
Provide tags and a correct Python 3 solution for this coding contest problem. There will be a launch of a new, powerful and unusual collider very soon, which located along a straight line. n particles will be launched inside it. All of them are located in a straight line and there can not be two or more particles loca...
instruction
0
69,449
3
138,898
Tags: implementation Correct Solution: ``` n=int(input()) s=input() a=list(map(int,input().split())) d=[] for i in range(n-1): if s[i]=='R' and s[i+1]=='L': t=a[i+1]-a[i] t=t//2 d.append(t) if d==[]: print(-1) else: print(min(d)) ```
output
1
69,449
3
138,899
Provide tags and a correct Python 3 solution for this coding contest problem. There will be a launch of a new, powerful and unusual collider very soon, which located along a straight line. n particles will be launched inside it. All of them are located in a straight line and there can not be two or more particles loca...
instruction
0
69,450
3
138,900
Tags: implementation Correct Solution: ``` n = int(input()) st = input() lst = list(map(int, input().split())) minn = float("INF") yes = False for i in range(n-1): if st[i] == "R" and st[i+1] == "L": yes = True minn = min(minn, (lst[i+1] - lst[i])//2) if not yes: print(-1) else: print(minn...
output
1
69,450
3
138,901
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There will be a launch of a new, powerful and unusual collider very soon, which located along a straight line. n particles will be launched inside it. All of them are located in a straight line ...
instruction
0
69,451
3
138,902
Yes
output
1
69,451
3
138,903
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There will be a launch of a new, powerful and unusual collider very soon, which located along a straight line. n particles will be launched inside it. All of them are located in a straight line ...
instruction
0
69,452
3
138,904
Yes
output
1
69,452
3
138,905
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There will be a launch of a new, powerful and unusual collider very soon, which located along a straight line. n particles will be launched inside it. All of them are located in a straight line ...
instruction
0
69,453
3
138,906
Yes
output
1
69,453
3
138,907
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There will be a launch of a new, powerful and unusual collider very soon, which located along a straight line. n particles will be launched inside it. All of them are located in a straight line ...
instruction
0
69,454
3
138,908
Yes
output
1
69,454
3
138,909
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There will be a launch of a new, powerful and unusual collider very soon, which located along a straight line. n particles will be launched inside it. All of them are located in a straight line ...
instruction
0
69,455
3
138,910
No
output
1
69,455
3
138,911
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There will be a launch of a new, powerful and unusual collider very soon, which located along a straight line. n particles will be launched inside it. All of them are located in a straight line ...
instruction
0
69,456
3
138,912
No
output
1
69,456
3
138,913
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There will be a launch of a new, powerful and unusual collider very soon, which located along a straight line. n particles will be launched inside it. All of them are located in a straight line ...
instruction
0
69,457
3
138,914
No
output
1
69,457
3
138,915
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There will be a launch of a new, powerful and unusual collider very soon, which located along a straight line. n particles will be launched inside it. All of them are located in a straight line ...
instruction
0
69,458
3
138,916
No
output
1
69,458
3
138,917
Provide tags and a correct Python 3 solution for this coding contest problem. <image> Walking through the streets of Marshmallow City, Slastyona have spotted some merchants selling a kind of useless toy which is very popular nowadays – caramel spinner! Wanting to join the craze, she has immediately bought the strange...
instruction
0
69,512
3
139,024
Tags: implementation Correct Solution: ``` string = input() s = string[0] a = string[2] n = int(input()) b = n%4 if s == '>': if a == '^': if b == 1: print("ccw") else: print("cw") elif a =='v': if b == 3: print("ccw") else: print("...
output
1
69,512
3
139,025
Provide tags and a correct Python 3 solution for this coding contest problem. <image> Walking through the streets of Marshmallow City, Slastyona have spotted some merchants selling a kind of useless toy which is very popular nowadays – caramel spinner! Wanting to join the craze, she has immediately bought the strange...
instruction
0
69,513
3
139,026
Tags: implementation Correct Solution: ``` n,m = input().strip().split() #print(n,' ',m) t=int(input()) tr=t % 4 cww=[chr(118), '<',chr(94),'>'] cwww=[chr(118),'>',chr(94),'<'] p=cww.index(n) q=cwww.index(n) #print(p,' ',q) if cww[(p+tr)%4]==cwww[(q+tr)%4]: print('undefined') elif cww[(p+tr)%4]==m: print('cw') ...
output
1
69,513
3
139,027
Provide tags and a correct Python 3 solution for this coding contest problem. <image> Walking through the streets of Marshmallow City, Slastyona have spotted some merchants selling a kind of useless toy which is very popular nowadays – caramel spinner! Wanting to join the craze, she has immediately bought the strange...
instruction
0
69,514
3
139,028
Tags: implementation Correct Solution: ``` start_end = input().strip() time = int(input().strip()) start = start_end.split()[0] end = start_end.split()[1] start_dir = -1 end_dir = -1 if start == '<': start_dir = 0 elif start == '^': start_dir = 1 elif start == '>': start_dir = 2 elif start == 'v': sta...
output
1
69,514
3
139,029
Provide tags and a correct Python 3 solution for this coding contest problem. <image> Walking through the streets of Marshmallow City, Slastyona have spotted some merchants selling a kind of useless toy which is very popular nowadays – caramel spinner! Wanting to join the craze, she has immediately bought the strange...
instruction
0
69,515
3
139,030
Tags: implementation Correct Solution: ``` st, en = map(str, input().split()) n = int(input()) n %= 4 m = {"^":1, ">":2, "v":3, "<":4} if (m[st] + m[en]) % 4 == 2 or (m[st] + m[en]) % 4 == 0: print("undefined") elif (m[st] + n) % 4 == m[en] or (m[st] + n) == m[en]: print("cw") else: print("ccw") ```
output
1
69,515
3
139,031
Provide tags and a correct Python 3 solution for this coding contest problem. <image> Walking through the streets of Marshmallow City, Slastyona have spotted some merchants selling a kind of useless toy which is very popular nowadays – caramel spinner! Wanting to join the craze, she has immediately bought the strange...
instruction
0
69,516
3
139,032
Tags: implementation Correct Solution: ``` initial,final = input().split() cw_res, ccw_res = initial,initial n = int(input()) n = n%4 ccw = { '<': 'v', '>': '^', 'v': '>', '^': '<' } cc = { '<': '^', '>': 'v', '^': '>', 'v': '<' } for i in range(n): cw_res = cc[ cw_res ] ccw_re...
output
1
69,516
3
139,033
Provide tags and a correct Python 3 solution for this coding contest problem. <image> Walking through the streets of Marshmallow City, Slastyona have spotted some merchants selling a kind of useless toy which is very popular nowadays – caramel spinner! Wanting to join the craze, she has immediately bought the strange...
instruction
0
69,517
3
139,034
Tags: implementation Correct Solution: ``` a = ['v', '<', '^', '>'] s, e = input().split() n = int(input()) l = a.index(s) r = l n = n % 4 for i in range(n): if l == 0: l = 3 else: l -= 1 if r == 3: r = 0 else: r += 1 if a[l] == e and a[r] == e: print('undefined') elif a[l] == e: print('ccw') el...
output
1
69,517
3
139,035
Provide tags and a correct Python 3 solution for this coding contest problem. <image> Walking through the streets of Marshmallow City, Slastyona have spotted some merchants selling a kind of useless toy which is very popular nowadays – caramel spinner! Wanting to join the craze, she has immediately bought the strange...
instruction
0
69,518
3
139,036
Tags: implementation Correct Solution: ``` s = input() n = int(input()) if not(n%2): print("undefined") elif ("^>v<".find(s[0])+n)%4 == "^>v<".find(s[2]): print("cw") else: print("ccw") ```
output
1
69,518
3
139,037
Provide tags and a correct Python 3 solution for this coding contest problem. <image> Walking through the streets of Marshmallow City, Slastyona have spotted some merchants selling a kind of useless toy which is very popular nowadays – caramel spinner! Wanting to join the craze, she has immediately bought the strange...
instruction
0
69,519
3
139,038
Tags: implementation Correct Solution: ``` elem = ['v', '<', '^', '>'] a, b = map(elem.index, input().split()) n = int(input()) diff = (b - a + 4) % 4 if (diff == 0 or diff == 2): print('undefined') elif (diff == n % 4): print('cw') else: print('ccw') ```
output
1
69,519
3
139,039
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. <image> Walking through the streets of Marshmallow City, Slastyona have spotted some merchants selling a kind of useless toy which is very popular nowadays – caramel spinner! Wanting to join th...
instruction
0
69,520
3
139,040
Yes
output
1
69,520
3
139,041
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. <image> Walking through the streets of Marshmallow City, Slastyona have spotted some merchants selling a kind of useless toy which is very popular nowadays – caramel spinner! Wanting to join th...
instruction
0
69,521
3
139,042
Yes
output
1
69,521
3
139,043