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 |
|---|---|---|---|---|---|
Provide a correct Python 3 solution for this coding contest problem.
M-kun is a brilliant air traffic controller.
On the display of his radar, there are N airplanes numbered 1, 2, ..., N, all flying at the same altitude.
Each of the airplanes flies at a constant speed of 0.1 per second in a constant direction. The cu... | instruction | 0 | 88,143 | 3 | 176,286 |
"Correct Solution:
```
from collections import defaultdict
from collections import deque
from collections import Counter
import itertools
import math
def readInt():
return int(input())
def readInts():
return list(map(int, input().split()))
def readChar():
return input()
def readChars():
return input().split()
n =... | output | 1 | 88,143 | 3 | 176,287 |
Provide a correct Python 3 solution for this coding contest problem.
M-kun is a brilliant air traffic controller.
On the display of his radar, there are N airplanes numbered 1, 2, ..., N, all flying at the same altitude.
Each of the airplanes flies at a constant speed of 0.1 per second in a constant direction. The cu... | instruction | 0 | 88,144 | 3 | 176,288 |
"Correct Solution:
```
from collections import defaultdict
n = int(input())
x = [0] * n
y = [0] * n
dir = [0] * n
INF = 10**8
def g(v):
v.sort(key=lambda x: x[0])
ret = INF
for i in range(1, len(v)):
if v[i - 1][1] == 0 and v[i][1] != 0:
ret = min(ret, v[i][0] - v[i - 1][0])
return... | output | 1 | 88,144 | 3 | 176,289 |
Provide a correct Python 3 solution for this coding contest problem.
M-kun is a brilliant air traffic controller.
On the display of his radar, there are N airplanes numbered 1, 2, ..., N, all flying at the same altitude.
Each of the airplanes flies at a constant speed of 0.1 per second in a constant direction. The cu... | instruction | 0 | 88,145 | 3 | 176,290 |
"Correct Solution:
```
#!/usr/bin/env python3
import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import ... | output | 1 | 88,145 | 3 | 176,291 |
Provide a correct Python 3 solution for this coding contest problem.
M-kun is a brilliant air traffic controller.
On the display of his radar, there are N airplanes numbered 1, 2, ..., N, all flying at the same altitude.
Each of the airplanes flies at a constant speed of 0.1 per second in a constant direction. The cu... | instruction | 0 | 88,146 | 3 | 176,292 |
"Correct Solution:
```
N = int(input())
L = {'U':[], 'R':[], 'D':[], 'L':[]}
for _ in range(N):
x, y, u = input().split()
L[u].append((int(x), int(y)))
ans = 10 ** 7
def solve(A):
global ans
A.sort()
s = - 10 ** 6
t = - 10 ** 6
for p, q, r in A:
if p != s:
if r == 1:
... | output | 1 | 88,146 | 3 | 176,293 |
Provide a correct Python 3 solution for this coding contest problem.
M-kun is a brilliant air traffic controller.
On the display of his radar, there are N airplanes numbered 1, 2, ..., N, all flying at the same altitude.
Each of the airplanes flies at a constant speed of 0.1 per second in a constant direction. The cu... | instruction | 0 | 88,147 | 3 | 176,294 |
"Correct Solution:
```
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS... | output | 1 | 88,147 | 3 | 176,295 |
Provide a correct Python 3 solution for this coding contest problem.
M-kun is a brilliant air traffic controller.
On the display of his radar, there are N airplanes numbered 1, 2, ..., N, all flying at the same altitude.
Each of the airplanes flies at a constant speed of 0.1 per second in a constant direction. The cu... | instruction | 0 | 88,148 | 3 | 176,296 |
"Correct Solution:
```
# from #15490827
import bisect
def solve(deg1, deg2, lis, magnification):
tmpAns = 10 ** 10
for dx in lis[deg1].keys():
if dx not in lis[deg2].keys():
continue
for dy in lis[deg1][dx]:
t = bisect.bisect_left(lis[deg2][dx], dy)
if t < le... | output | 1 | 88,148 | 3 | 176,297 |
Provide a correct Python 3 solution for this coding contest problem.
M-kun is a brilliant air traffic controller.
On the display of his radar, there are N airplanes numbered 1, 2, ..., N, all flying at the same altitude.
Each of the airplanes flies at a constant speed of 0.1 per second in a constant direction. The cu... | instruction | 0 | 88,149 | 3 | 176,298 |
"Correct Solution:
```
from collections import defaultdict
n = int(input())
line = defaultdict(list)
row = defaultdict(list)
A = defaultdict(list) # U,R
B = defaultdict(list) # L,D
C = defaultdict(list) # U,L
D = defaultdict(list) # R,D
for i in range(n):
x, y, u = input().split()
x = int(x)
y = int(y... | output | 1 | 88,149 | 3 | 176,299 |
Provide a correct Python 3 solution for this coding contest problem.
M-kun is a brilliant air traffic controller.
On the display of his radar, there are N airplanes numbered 1, 2, ..., N, all flying at the same altitude.
Each of the airplanes flies at a constant speed of 0.1 per second in a constant direction. The cu... | instruction | 0 | 88,150 | 3 | 176,300 |
"Correct Solution:
```
n = int(input())
b = 2000001
u = []; r = []; d = []; l = []
for i in range(n):
A = list(input().split())
a = [int(A[0]), int(A[1])]
if A[2] == "U":
u.append(a)
elif A[2] == "R":
r.append(a)
elif A[2] == "D":
d.append(a)
else:
l.append(a)
u1 ... | output | 1 | 88,150 | 3 | 176,301 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
M-kun is a brilliant air traffic controller.
On the display of his radar, there are N airplanes numbered 1, 2, ..., N, all flying at the same altitude.
Each of the airplanes flies at a constant... | instruction | 0 | 88,151 | 3 | 176,302 |
Yes | output | 1 | 88,151 | 3 | 176,303 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
M-kun is a brilliant air traffic controller.
On the display of his radar, there are N airplanes numbered 1, 2, ..., N, all flying at the same altitude.
Each of the airplanes flies at a constant... | instruction | 0 | 88,152 | 3 | 176,304 |
Yes | output | 1 | 88,152 | 3 | 176,305 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
M-kun is a brilliant air traffic controller.
On the display of his radar, there are N airplanes numbered 1, 2, ..., N, all flying at the same altitude.
Each of the airplanes flies at a constant... | instruction | 0 | 88,153 | 3 | 176,306 |
Yes | output | 1 | 88,153 | 3 | 176,307 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
M-kun is a brilliant air traffic controller.
On the display of his radar, there are N airplanes numbered 1, 2, ..., N, all flying at the same altitude.
Each of the airplanes flies at a constant... | instruction | 0 | 88,154 | 3 | 176,308 |
Yes | output | 1 | 88,154 | 3 | 176,309 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
M-kun is a brilliant air traffic controller.
On the display of his radar, there are N airplanes numbered 1, 2, ..., N, all flying at the same altitude.
Each of the airplanes flies at a constant... | instruction | 0 | 88,155 | 3 | 176,310 |
No | output | 1 | 88,155 | 3 | 176,311 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
M-kun is a brilliant air traffic controller.
On the display of his radar, there are N airplanes numbered 1, 2, ..., N, all flying at the same altitude.
Each of the airplanes flies at a constant... | instruction | 0 | 88,156 | 3 | 176,312 |
No | output | 1 | 88,156 | 3 | 176,313 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
M-kun is a brilliant air traffic controller.
On the display of his radar, there are N airplanes numbered 1, 2, ..., N, all flying at the same altitude.
Each of the airplanes flies at a constant... | instruction | 0 | 88,157 | 3 | 176,314 |
No | output | 1 | 88,157 | 3 | 176,315 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
M-kun is a brilliant air traffic controller.
On the display of his radar, there are N airplanes numbered 1, 2, ..., N, all flying at the same altitude.
Each of the airplanes flies at a constant... | instruction | 0 | 88,158 | 3 | 176,316 |
No | output | 1 | 88,158 | 3 | 176,317 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In a two-dimensional plane, there is a square frame whose vertices are at coordinates (0,0), (N,0), (0,N), and (N,N). The frame is made of mirror glass. A ray of light striking an edge of the fr... | instruction | 0 | 88,175 | 3 | 176,350 |
No | output | 1 | 88,175 | 3 | 176,351 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In a two-dimensional plane, there is a square frame whose vertices are at coordinates (0,0), (N,0), (0,N), and (N,N). The frame is made of mirror glass. A ray of light striking an edge of the fr... | instruction | 0 | 88,176 | 3 | 176,352 |
No | output | 1 | 88,176 | 3 | 176,353 |
Provide a correct Python 3 solution for this coding contest problem.
The cloth coasters produced and sold by Aizu Takada City are known for their symmetrical design and great beauty. As part of quality control, Aizu Takada City has installed cameras on the production line to automatically verify that the images obtain... | instruction | 0 | 88,293 | 3 | 176,586 |
"Correct Solution:
```
def main():
C, n = map(int, input().split())
mp = [input() for _ in range(n)]
diff_dic = {}
def change(x, y):
if (x, y) in diff_dic:
diff_dic.pop((x, y))
else:
diff_dic[(x, y)] = True
for y in range(n // 2):
for x in range(n // 2):
base = mp[y][x]
i... | output | 1 | 88,293 | 3 | 176,587 |
Provide a correct Python 3 solution for this coding contest problem.
The cloth coasters produced and sold by Aizu Takada City are known for their symmetrical design and great beauty. As part of quality control, Aizu Takada City has installed cameras on the production line to automatically verify that the images obtain... | instruction | 0 | 88,294 | 3 | 176,588 |
"Correct Solution:
```
c, n = map(int, input().split())
P = [list(map(int, input())) for i in range(n)]
S = [[0]*n for i in range(n)]
T = [[0]*n for i in range(n)]
dS = dT = 0
for i in range(n):
for j in range(n//2):
S[i][j] = P[i][j] ^ P[i][n-1-j]
dS += S[i][j]
for j in range(n):
for i in range... | output | 1 | 88,294 | 3 | 176,589 |
Provide a correct Python 3 solution for this coding contest problem.
The cloth coasters produced and sold by Aizu Takada City are known for their symmetrical design and great beauty. As part of quality control, Aizu Takada City has installed cameras on the production line to automatically verify that the images obtain... | instruction | 0 | 88,295 | 3 | 176,590 |
"Correct Solution:
```
C, n = map(int, input().split())
mp = [input() for _ in range(n)]
diff_dic = {}
def change(x, y):
global diff_dic
if (x, y) in diff_dic:
diff_dic.pop((x, y))
else:
diff_dic[(x, y)] = True
for y in range(n // 2):
for x in range(n // 2):
base = mp[y][x]
if mp[y][n - 1 - x] !... | output | 1 | 88,295 | 3 | 176,591 |
Provide a correct Python 3 solution for this coding contest problem.
The cloth coasters produced and sold by Aizu Takada City are known for their symmetrical design and great beauty. As part of quality control, Aizu Takada City has installed cameras on the production line to automatically verify that the images obtain... | instruction | 0 | 88,296 | 3 | 176,592 |
"Correct Solution:
```
def next(N, i):
return ((N-i-1)+N)%N
def getState(N, G, i, j):
return G[i][j] == G[i][next(N, j)] and G[i][j] == G[next(N, i)][j] and G[i][j] == G[next(N, i)][next(N, j)]
def getInit(N, G):
dcnt = 0
for i in range(N//2):
for j in range(N//2):
if not getStat... | output | 1 | 88,296 | 3 | 176,593 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The cloth coasters produced and sold by Aizu Takada City are known for their symmetrical design and great beauty. As part of quality control, Aizu Takada City has installed cameras on the produc... | instruction | 0 | 88,297 | 3 | 176,594 |
No | output | 1 | 88,297 | 3 | 176,595 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The cloth coasters produced and sold by Aizu Takada City are known for their symmetrical design and great beauty. As part of quality control, Aizu Takada City has installed cameras on the produc... | instruction | 0 | 88,298 | 3 | 176,596 |
No | output | 1 | 88,298 | 3 | 176,597 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The cloth coasters produced and sold by Aizu Takada City are known for their symmetrical design and great beauty. As part of quality control, Aizu Takada City has installed cameras on the produc... | instruction | 0 | 88,299 | 3 | 176,598 |
No | output | 1 | 88,299 | 3 | 176,599 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The cloth coasters produced and sold by Aizu Takada City are known for their symmetrical design and great beauty. As part of quality control, Aizu Takada City has installed cameras on the produc... | instruction | 0 | 88,300 | 3 | 176,600 |
No | output | 1 | 88,300 | 3 | 176,601 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bob is a duck. He wants to get to Alice's nest, so that those two can duck!
<image> Duck is the ultimate animal! (Image courtesy of See Bang)
The journey can be represented as a straight line, consisting of n segments. Bob is located to th... | instruction | 0 | 88,391 | 3 | 176,782 |
Tags: constructive algorithms, greedy
Correct Solution:
```
from heapq import heappush, heappop
n = int(input())
L = list(map(int, input().split()))
T = input()
# fly -> walk, time cost: +4s, stamina: +2
# walk in place, time cost: +5s, stamina: +1
#fly -> swim, time cost: +2s, stamina: +2
#swim in place, time cost: ... | output | 1 | 88,391 | 3 | 176,783 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bob is a duck. He wants to get to Alice's nest, so that those two can duck!
<image> Duck is the ultimate animal! (Image courtesy of See Bang)
The journey can be represented as a straight line, consisting of n segments. Bob is located to th... | instruction | 0 | 88,392 | 3 | 176,784 |
Tags: constructive algorithms, greedy
Correct Solution:
```
n = int(input())
dis = list(map(lambda x: int(x) << 1, input().split()))
ter = input()
st, ans = 0, 0
time = {'G': 5, 'W': 3, 'L': 1}
delta = {'G':1, 'W':1, 'L':-1}
hasWater = False
convert = 0
for i in range(n):
st += dis[i] * delta[ter[i]]
ans += dis[i] * ... | output | 1 | 88,392 | 3 | 176,785 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bob is a duck. He wants to get to Alice's nest, so that those two can duck!
<image> Duck is the ultimate animal! (Image courtesy of See Bang)
The journey can be represented as a straight line, consisting of n segments. Bob is located to th... | instruction | 0 | 88,393 | 3 | 176,786 |
Tags: constructive algorithms, greedy
Correct Solution:
```
def read(type = 1):
if type:
file = open("input.dat", "r")
n = int(file.readline())
a = list(map(int, file.readline().split()))
b = file.readline()
file.close()
else:
n = int(input().strip())
a = ... | output | 1 | 88,393 | 3 | 176,787 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bob is a duck. He wants to get to Alice's nest, so that those two can duck!
<image> Duck is the ultimate animal! (Image courtesy of See Bang)
The journey can be represented as a straight line, consisting of n segments. Bob is located to th... | instruction | 0 | 88,394 | 3 | 176,788 |
Tags: constructive algorithms, greedy
Correct Solution:
```
def read(type = 1):
if type:
file = open("input.dat", "r")
n = int(file.readline())
a = list(map(int, file.readline().split()))
b = file.readline()
file.close()
else:
n = int(input().strip())
a = ... | output | 1 | 88,394 | 3 | 176,789 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bob is a duck. He wants to get to Alice's nest, so that those two can duck!
<image> Duck is the ultimate animal! (Image courtesy of See Bang)
The journey can be represented as a straight line, consisting of n segments. Bob is located to th... | instruction | 0 | 88,395 | 3 | 176,790 |
Tags: constructive algorithms, greedy
Correct Solution:
```
n=int(input())
l=list(map(lambda x:int(x)*2,input().split(" ")))
t=list(map(lambda x:"GWL".index(x),input()))
mins=[0 for i in range(0,n+1)]
for i in range(n-1,-1,-1):
if t[i]!=2:mins[i]=max(mins[i+1]-l[i],0)
else:mins[i]=mins[i+1]+l[i]
curs=ans=st=0
for i i... | output | 1 | 88,395 | 3 | 176,791 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bob is a duck. He wants to get to Alice's nest, so that those two can duck!
<image> Duck is the ultimate animal! (Image courtesy of See Bang)
The journey can be represented as a straight line, consisting of n segments. Bob is located to th... | instruction | 0 | 88,396 | 3 | 176,792 |
Tags: constructive algorithms, greedy
Correct Solution:
```
n=int(input())
l=list(map(int,input().split()))
s=input()
water=0
grass=0
cgrass=0
time=0
seen=False
for i in range(n):
if s[i]=="G":
dist=l[i]
if water>=dist:
water-=dist
time+=2*dist
cgrass+=dist
... | output | 1 | 88,396 | 3 | 176,793 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bob is a duck. He wants to get to Alice's nest, so that those two can duck!
<image> Duck is the ultimate animal! (Image courtesy of See Bang)
The journey can be represented as a straight line,... | instruction | 0 | 88,397 | 3 | 176,794 |
No | output | 1 | 88,397 | 3 | 176,795 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bob is a duck. He wants to get to Alice's nest, so that those two can duck!
<image> Duck is the ultimate animal! (Image courtesy of See Bang)
The journey can be represented as a straight line,... | instruction | 0 | 88,398 | 3 | 176,796 |
No | output | 1 | 88,398 | 3 | 176,797 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bob is a duck. He wants to get to Alice's nest, so that those two can duck!
<image> Duck is the ultimate animal! (Image courtesy of See Bang)
The journey can be represented as a straight line,... | instruction | 0 | 88,399 | 3 | 176,798 |
No | output | 1 | 88,399 | 3 | 176,799 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bob is a duck. He wants to get to Alice's nest, so that those two can duck!
<image> Duck is the ultimate animal! (Image courtesy of See Bang)
The journey can be represented as a straight line,... | instruction | 0 | 88,400 | 3 | 176,800 |
No | output | 1 | 88,400 | 3 | 176,801 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n robots driving along an OX axis. There are also two walls: one is at coordinate 0 and one is at coordinate m.
The i-th robot starts at an integer coordinate x_i~(0 < x_i < m) and moves either left (towards the 0) or right with t... | instruction | 0 | 88,655 | 3 | 177,310 |
Tags: data structures, greedy, implementation, sortings
Correct Solution:
```
import sys
def task_c():
input = sys.stdin.readline
for _ in range(int(input())):
n, m = map(int, input().split())
pos = list(map(int, input().split()))
dir = list(map(str, input().split()))
robots = [... | output | 1 | 88,655 | 3 | 177,311 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n robots driving along an OX axis. There are also two walls: one is at coordinate 0 and one is at coordinate m.
The i-th robot starts at an integer coordinate x_i~(0 < x_i < m) and moves either left (towards the 0) or right with t... | instruction | 0 | 88,656 | 3 | 177,312 |
Tags: data structures, greedy, implementation, sortings
Correct Solution:
```
def solve(robot, m, res):
robot.sort()
stack = []
for x, dire, i in robot:
if dire=='L':
if not stack:
stack.append((i, -x))
else:
i2, x2 = stack[-1]
res[i] = res[i2] = (x-x2)//2
stack.pop()
else:
stack.appe... | output | 1 | 88,656 | 3 | 177,313 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n robots driving along an OX axis. There are also two walls: one is at coordinate 0 and one is at coordinate m.
The i-th robot starts at an integer coordinate x_i~(0 < x_i < m) and moves either left (towards the 0) or right with t... | instruction | 0 | 88,657 | 3 | 177,314 |
Tags: data structures, greedy, implementation, sortings
Correct Solution:
```
def solve(robots,ans,m):
robots.sort()
stack=[]
for x,dire,i in robots:
if dire=='L':
if not stack:
stack.append((i,-x))
else:
i1,x1=stack[-1]
stack.p... | output | 1 | 88,657 | 3 | 177,315 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n robots driving along an OX axis. There are also two walls: one is at coordinate 0 and one is at coordinate m.
The i-th robot starts at an integer coordinate x_i~(0 < x_i < m) and moves either left (towards the 0) or right with t... | instruction | 0 | 88,658 | 3 | 177,316 |
Tags: data structures, greedy, implementation, sortings
Correct Solution:
```
from sys import stdin, stdout
import heapq
from collections import defaultdict
import math
import bisect
import io, os
# for interactive problem
# n = int(stdin.readline())
# print(x, flush=True)
#input = io.BytesIO(os.read(0, os.fstat(0).s... | output | 1 | 88,658 | 3 | 177,317 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n robots driving along an OX axis. There are also two walls: one is at coordinate 0 and one is at coordinate m.
The i-th robot starts at an integer coordinate x_i~(0 < x_i < m) and moves either left (towards the 0) or right with t... | instruction | 0 | 88,659 | 3 | 177,318 |
Tags: data structures, greedy, implementation, sortings
Correct Solution:
```
def divisors(M):
d=[]
i=1
while M>=i**2:
if M%i==0:
d.append(i)
if i**2!=M:
d.append(M//i)
i=i+1
return d
def popcount(x):
x = x - ((x >> 1) & 0x55555555)
x = (... | output | 1 | 88,659 | 3 | 177,319 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n robots driving along an OX axis. There are also two walls: one is at coordinate 0 and one is at coordinate m.
The i-th robot starts at an integer coordinate x_i~(0 < x_i < m) and moves either left (towards the 0) or right with t... | instruction | 0 | 88,660 | 3 | 177,320 |
Tags: data structures, greedy, implementation, sortings
Correct Solution:
```
import sys
input = sys.stdin.readline
for _ in range(int(input())):
n,m = map(int,input().split())
time = [-1]*n # in sorted order
x = list(map(int,input().split()))
dir = input().split()
a = sorted(list(zip(x,dir,list(r... | output | 1 | 88,660 | 3 | 177,321 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n robots driving along an OX axis. There are also two walls: one is at coordinate 0 and one is at coordinate m.
The i-th robot starts at an integer coordinate x_i~(0 < x_i < m) and moves either left (towards the 0) or right with t... | instruction | 0 | 88,661 | 3 | 177,322 |
Tags: data structures, greedy, implementation, sortings
Correct Solution:
```
import sys
import math
#input = sys.stdin.readline
imp = 'IMPOSSIBLE'
t = int(input())
for test in range(t):
n, m = list(map(int, input().split(" ")))
xx = list(map(int, input().split(" ")))
sorx = sorted(enumerate(xx), key=lam... | output | 1 | 88,661 | 3 | 177,323 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n robots driving along an OX axis. There are also two walls: one is at coordinate 0 and one is at coordinate m.
The i-th robot starts at an integer coordinate x_i~(0 < x_i < m) and moves either left (towards the 0) or right with t... | instruction | 0 | 88,662 | 3 | 177,324 |
Tags: data structures, greedy, implementation, sortings
Correct Solution:
```
import sys, os
from io import BytesIO, IOBase
from math import floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque
from heapq import merge, heapify, heappop, heappush, nsmallest
from bisect impor... | output | 1 | 88,662 | 3 | 177,325 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n robots driving along an OX axis. There are also two walls: one is at coordinate 0 and one is at coordinate m.
The i-th robot starts at an integer coordinate x_i~(0 < x_i < m) and mo... | instruction | 0 | 88,663 | 3 | 177,326 |
Yes | output | 1 | 88,663 | 3 | 177,327 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n robots driving along an OX axis. There are also two walls: one is at coordinate 0 and one is at coordinate m.
The i-th robot starts at an integer coordinate x_i~(0 < x_i < m) and mo... | instruction | 0 | 88,664 | 3 | 177,328 |
Yes | output | 1 | 88,664 | 3 | 177,329 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n robots driving along an OX axis. There are also two walls: one is at coordinate 0 and one is at coordinate m.
The i-th robot starts at an integer coordinate x_i~(0 < x_i < m) and mo... | instruction | 0 | 88,665 | 3 | 177,330 |
Yes | output | 1 | 88,665 | 3 | 177,331 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n robots driving along an OX axis. There are also two walls: one is at coordinate 0 and one is at coordinate m.
The i-th robot starts at an integer coordinate x_i~(0 < x_i < m) and mo... | instruction | 0 | 88,666 | 3 | 177,332 |
Yes | output | 1 | 88,666 | 3 | 177,333 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n robots driving along an OX axis. There are also two walls: one is at coordinate 0 and one is at coordinate m.
The i-th robot starts at an integer coordinate x_i~(0 < x_i < m) and mo... | instruction | 0 | 88,667 | 3 | 177,334 |
No | output | 1 | 88,667 | 3 | 177,335 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n robots driving along an OX axis. There are also two walls: one is at coordinate 0 and one is at coordinate m.
The i-th robot starts at an integer coordinate x_i~(0 < x_i < m) and mo... | instruction | 0 | 88,668 | 3 | 177,336 |
No | output | 1 | 88,668 | 3 | 177,337 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.