message stringlengths 2 22.8k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 16 109k | cluster float64 1 1 | __index_level_0__ int64 32 217k |
|---|---|---|---|---|---|
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The pandemic is upon us, and the world is in shortage of the most important resource: toilet paper. As one of the best prepared nations for this crisis, BubbleLand promised to help all other wor... | instruction | 0 | 66,650 | 1 | 133,300 |
No | output | 1 | 66,650 | 1 | 133,301 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The pandemic is upon us, and the world is in shortage of the most important resource: toilet paper. As one of the best prepared nations for this crisis, BubbleLand promised to help all other wor... | instruction | 0 | 66,651 | 1 | 133,302 |
No | output | 1 | 66,651 | 1 | 133,303 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There is a bus stop near the university. The lessons are over, and n students come to the stop. The i-th student will appear at the bus stop at time ti (all ti's are distinct).
We shall assume that the stop is located on the coordinate axis... | instruction | 0 | 66,687 | 1 | 133,374 |
Tags: *special, implementation, sortings
Correct Solution:
```
import sys
from heapq import *
def solve():
n,m = map(int, input().split())
waiting = []
for i in range(n):
ti, xi = map(int, input().split())
heappush(waiting, (ti, xi, i))
res = [None] * n
curtime, curloc = 0, 0
whi... | output | 1 | 66,687 | 1 | 133,375 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There is a bus stop near the university. The lessons are over, and n students come to the stop. The i-th student will appear at the bus stop at time ti (all ti's are distinct).
We shall assume that the stop is located on the coordinate axis... | instruction | 0 | 66,688 | 1 | 133,376 |
Tags: *special, implementation, sortings
Correct Solution:
```
import sys
from heapq import *
def solve():
n,m = map(int, input().split())
waiting = []
for i in range(n):
ti, xi = map(int, input().split())
heappush(waiting, (ti, xi, i))
res = [None] * n
curtime, curloc = 0, 0
whi... | output | 1 | 66,688 | 1 | 133,377 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There is a bus stop near the university. The lessons are over, and n students come to the stop. The i-th student will appear at the bus stop at time ti (all ti's are distinct).
We shall assume that the stop is located on the coordinate axis... | instruction | 0 | 66,689 | 1 | 133,378 |
Tags: *special, implementation, sortings
Correct Solution:
```
from collections import Counter
n,m=map(int,input().split())
arr=[]
tt=0
lstx=[]
while(n>0):
if(tt!=0):
tt+=lstx[-1]
cap = 0
lstt = []
lstx = []
while(cap<m and n>0):
t,x=map(int,input().split())
lstt.append(t)
... | output | 1 | 66,689 | 1 | 133,379 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There is a bus stop near the university. The lessons are over, and n students come to the stop. The i-th student will appear at the bus stop at time ti (all ti's are distinct).
We shall assume that the stop is located on the coordinate axis... | instruction | 0 | 66,690 | 1 | 133,380 |
Tags: *special, implementation, sortings
Correct Solution:
```
from collections import defaultdict
n, m = map(int, input().split())
r, p = [0] * n, defaultdict(list)
i = d = 0
while i < n - m:
for j in range(i, i + m):
t, x = map(int, input().split())
p[x].append(j)
d = max(t, d)
y = sorted(... | output | 1 | 66,690 | 1 | 133,381 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a bus stop near the university. The lessons are over, and n students come to the stop. The i-th student will appear at the bus stop at time ti (all ti's are distinct).
We shall assume ... | instruction | 0 | 66,691 | 1 | 133,382 |
No | output | 1 | 66,691 | 1 | 133,383 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a bus stop near the university. The lessons are over, and n students come to the stop. The i-th student will appear at the bus stop at time ti (all ti's are distinct).
We shall assume ... | instruction | 0 | 66,692 | 1 | 133,384 |
No | output | 1 | 66,692 | 1 | 133,385 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a bus stop near the university. The lessons are over, and n students come to the stop. The i-th student will appear at the bus stop at time ti (all ti's are distinct).
We shall assume ... | instruction | 0 | 66,693 | 1 | 133,386 |
No | output | 1 | 66,693 | 1 | 133,387 |
Provide tags and a correct Python 3 solution for this coding contest problem.
In the capital city of Berland, Bertown, demonstrations are against the recent election of the King of Berland. Berland opposition, led by Mr. Ovalny, believes that the elections were not fair enough and wants to organize a demonstration at ... | instruction | 0 | 66,694 | 1 | 133,388 |
Tags: greedy
Correct Solution:
```
from sys import stdin, stdout
n, k = map(int, stdin.readline().split())
value = int(stdin.readline())
prices = list(map(int, stdin.readline().split()))
used = {}
challengers = prices[:-1]
for i in range(n - 1):
challengers[i] = (challengers[i], i)
challengers.sort(reverse = Tr... | output | 1 | 66,694 | 1 | 133,389 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In the capital city of Berland, Bertown, demonstrations are against the recent election of the King of Berland. Berland opposition, led by Mr. Ovalny, believes that the elections were not fair e... | instruction | 0 | 66,695 | 1 | 133,390 |
No | output | 1 | 66,695 | 1 | 133,391 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Arkady likes to walk around his kitchen. His labyrinthine kitchen consists of several important places connected with passages. Unfortunately it happens that these passages are flooded with milk... | instruction | 0 | 66,917 | 1 | 133,834 |
No | output | 1 | 66,917 | 1 | 133,835 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Arkady likes to walk around his kitchen. His labyrinthine kitchen consists of several important places connected with passages. Unfortunately it happens that these passages are flooded with milk... | instruction | 0 | 66,918 | 1 | 133,836 |
No | output | 1 | 66,918 | 1 | 133,837 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Arkady likes to walk around his kitchen. His labyrinthine kitchen consists of several important places connected with passages. Unfortunately it happens that these passages are flooded with milk... | instruction | 0 | 66,919 | 1 | 133,838 |
No | output | 1 | 66,919 | 1 | 133,839 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Arkady likes to walk around his kitchen. His labyrinthine kitchen consists of several important places connected with passages. Unfortunately it happens that these passages are flooded with milk... | instruction | 0 | 66,920 | 1 | 133,840 |
No | output | 1 | 66,920 | 1 | 133,841 |
Provide a correct Python 3 solution for this coding contest problem.
Convenience store Deven Eleven is planning to open its first store in Aizuwakamatsu City to expand its business. There are already many other convenience stores in Aizuwakamatsu, so the place to open a new store is likely to be the key to success. Un... | instruction | 0 | 67,156 | 1 | 134,312 |
"Correct Solution:
```
import sys
def generate_next_hexes(x, y):
hexes = list()
hexes.append((x, y - 1))
hexes.append((x, y + 1))
hexes.append((x - 1, y))
hexes.append((x + 1, y))
if y % 2:
hexes.append((x - 1, y - 1))
hexes.append((x - 1, y + 1))
else:
hexes.append(... | output | 1 | 67,156 | 1 | 134,313 |
Provide a correct Python 3 solution for this coding contest problem.
Convenience store Deven Eleven is planning to open its first store in Aizuwakamatsu City to expand its business. There are already many other convenience stores in Aizuwakamatsu, so the place to open a new store is likely to be the key to success. Un... | instruction | 0 | 67,157 | 1 | 134,314 |
"Correct Solution:
```
import sys
def generate_next_hexes(x, y):
hexes = [(x, y - 1), (x, y + 1), (x - 1, y), (x + 1, y)]
if y % 2:
hexes += [(x - 1, y - 1), (x - 1, y + 1)]
else:
hexes += [(x + 1, y - 1), (x + 1, y + 1)]
return hexes
def update_map(hex_map, hexes):
num_updated_hex... | output | 1 | 67,157 | 1 | 134,315 |
Provide a correct Python 3 solution for this coding contest problem.
Convenience store Deven Eleven is planning to open its first store in Aizuwakamatsu City to expand its business. There are already many other convenience stores in Aizuwakamatsu, so the place to open a new store is likely to be the key to success. Un... | instruction | 0 | 67,158 | 1 | 134,316 |
"Correct Solution:
```
import sys
def generate_next_hexes(x, y):
hexes = [(x, y - 1), (x, y + 1), (x - 1, y), (x + 1, y)]
if y % 2:
hexes += [(x - 1, y - 1), (x - 1, y + 1)]
else:
hexes += [(x + 1, y - 1), (x + 1, y + 1)]
return hexes
def update_map(hex_map, hexes):
num_updated_hex... | output | 1 | 67,158 | 1 | 134,317 |
Provide a correct Python 3 solution for this coding contest problem.
Convenience store Deven Eleven is planning to open its first store in Aizuwakamatsu City to expand its business. There are already many other convenience stores in Aizuwakamatsu, so the place to open a new store is likely to be the key to success. Un... | instruction | 0 | 67,159 | 1 | 134,318 |
"Correct Solution:
```
from collections import deque
dd0 = ((-1, -1), (0, -1), (1, 0), (0, 1), (-1, 1), (-1, 0))
dd1 = ((0, -1), (1, -1), (1, 0), (1, 1), (0, 1), (-1, 0))
def solve(S, p, q):
INF = 10**9
L = [[0]*M for i in range(N)]
D = [[INF]*M for i in range(N)]
que = deque()
for i, (x, y) in enu... | output | 1 | 67,159 | 1 | 134,319 |
Provide a correct Python 3 solution for this coding contest problem.
Convenience store Deven Eleven is planning to open its first store in Aizuwakamatsu City to expand its business. There are already many other convenience stores in Aizuwakamatsu, so the place to open a new store is likely to be the key to success. Un... | instruction | 0 | 67,160 | 1 | 134,320 |
"Correct Solution:
```
from collections import deque
INF = 10 ** 5
direct1 = ((-1, 0), (1, 0), (0, -1), (0, 1), (1, -1), (1, 1))
direct2 = ((-1, -1), (0, -1), (1, 0), (0, 1), (-1, 1), (-1, 0))
def search(p, mp):
que = deque()
que.append((0, p))
visited = [[False] * (m + 2) for _ in range(n + 2)]
visited[p[1]]... | output | 1 | 67,160 | 1 | 134,321 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Convenience store Deven Eleven is planning to open its first store in Aizuwakamatsu City to expand its business. There are already many other convenience stores in Aizuwakamatsu, so the place to... | instruction | 0 | 67,161 | 1 | 134,322 |
No | output | 1 | 67,161 | 1 | 134,323 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Consider a tunnel on a one-way road. During a particular day, n cars numbered from 1 to n entered and exited the tunnel exactly once. All the cars passed through the tunnel at constant speeds.
A traffic enforcement camera is mounted at the ... | instruction | 0 | 67,373 | 1 | 134,746 |
Tags: data structures, sortings, two pointers
Correct Solution:
```
from sys import stdin
# noinspection PyShadowingBuiltins
input = lambda: stdin.readline().rstrip("\r\n")
input_a = lambda fun: map(fun, stdin.readline().split())
def read():
n = int(input())
a = list(input_a(int))
b = list(input_a(int))
... | output | 1 | 67,373 | 1 | 134,747 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Consider a tunnel on a one-way road. During a particular day, n cars numbered from 1 to n entered and exited the tunnel exactly once. All the cars passed through the tunnel at constant speeds.
A traffic enforcement camera is mounted at the ... | instruction | 0 | 67,374 | 1 | 134,748 |
Tags: data structures, sortings, two pointers
Correct Solution:
```
import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
d = {}
for i in range(n):
d[b[i]] = i+1
x = 0
ans = n
for i in range(n):
if d[a[i]]>x:
x = d[a[i]]
ans -= 1
print (ans)
`... | output | 1 | 67,374 | 1 | 134,749 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Consider a tunnel on a one-way road. During a particular day, n cars numbered from 1 to n entered and exited the tunnel exactly once. All the cars passed through the tunnel at constant speeds.
A traffic enforcement camera is mounted at the ... | instruction | 0 | 67,375 | 1 | 134,750 |
Tags: data structures, sortings, two pointers
Correct Solution:
```
n = int(input())
entering = list(map(int, input().split()))
exiting = list(map(int, input().split()))
i = 0
j = 0
fined = set()
while(n > 0):
if(entering[i] in fined):
i += 1
continue
if(j == len(exiting) - 1):
if(enteri... | output | 1 | 67,375 | 1 | 134,751 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Consider a tunnel on a one-way road. During a particular day, n cars numbered from 1 to n entered and exited the tunnel exactly once. All the cars passed through the tunnel at constant speeds.
A traffic enforcement camera is mounted at the ... | instruction | 0 | 67,376 | 1 | 134,752 |
Tags: data structures, sortings, two pointers
Correct Solution:
```
n = int(input())
entry = list(map(int, input().split()))
exit = list(map(int, input().split()))
temp = [0]*1000000
i = j = 0
flag = cnt = 0
for k in range(2*n):
# print('hii')
if (i == n) or (j == n):
# print(i, j)
break
if temp[entry[i]] == 1:
... | output | 1 | 67,376 | 1 | 134,753 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Consider a tunnel on a one-way road. During a particular day, n cars numbered from 1 to n entered and exited the tunnel exactly once. All the cars passed through the tunnel at constant speeds.
A traffic enforcement camera is mounted at the ... | instruction | 0 | 67,377 | 1 | 134,754 |
Tags: data structures, sortings, two pointers
Correct Solution:
```
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
memo = {}
for i in range(n):
memo[a[i]] = i
ans = [0] * n
for i in range(n):
ans[i] = memo[b[i]]
min_num = 10**9
cnt = 0
for i in range(n)[::-1]:
i... | output | 1 | 67,377 | 1 | 134,755 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Consider a tunnel on a one-way road. During a particular day, n cars numbered from 1 to n entered and exited the tunnel exactly once. All the cars passed through the tunnel at constant speeds.
A traffic enforcement camera is mounted at the ... | instruction | 0 | 67,378 | 1 | 134,756 |
Tags: data structures, sortings, two pointers
Correct Solution:
```
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
A.reverse()
B.reverse()
stack = A
ans = 0
was = set()
i = n - 1
while stack:
if stack[-1] not in was:
if stack[-1] == B[i]:
stack.pop()
... | output | 1 | 67,378 | 1 | 134,757 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Consider a tunnel on a one-way road. During a particular day, n cars numbered from 1 to n entered and exited the tunnel exactly once. All the cars passed through the tunnel at constant speeds.
A traffic enforcement camera is mounted at the ... | instruction | 0 | 67,379 | 1 | 134,758 |
Tags: data structures, sortings, two pointers
Correct Solution:
```
def fastio():
import sys
from io import StringIO
from atexit import register
global input
sys.stdin = StringIO(sys.stdin.read())
input = lambda : sys.stdin.readline().rstrip('\r\n')
sys.stdout = StringIO()
register(lambda : sys.__stdout__.writ... | output | 1 | 67,379 | 1 | 134,759 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Consider a tunnel on a one-way road. During a particular day, n cars numbered from 1 to n entered and exited the tunnel exactly once. All the cars passed through the tunnel at constant speeds.
A traffic enforcement camera is mounted at the ... | instruction | 0 | 67,380 | 1 | 134,760 |
Tags: data structures, sortings, two pointers
Correct Solution:
```
n = int(input())
t = [0]*(n+1)
*l, = map(int, input().split())
*m, = map(int, input().split())
i = 0
j = 0
c = 0
while i < n and j < n:
if t[l[i]]:
i += 1
continue
if l[i] != m[j]:
t[m[j]] = 1
c += 1
else:
i += 1
j += 1
prin... | output | 1 | 67,380 | 1 | 134,761 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Consider a tunnel on a one-way road. During a particular day, n cars numbered from 1 to n entered and exited the tunnel exactly once. All the cars passed through the tunnel at constant speeds.
... | instruction | 0 | 67,381 | 1 | 134,762 |
Yes | output | 1 | 67,381 | 1 | 134,763 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Consider a tunnel on a one-way road. During a particular day, n cars numbered from 1 to n entered and exited the tunnel exactly once. All the cars passed through the tunnel at constant speeds.
... | instruction | 0 | 67,382 | 1 | 134,764 |
Yes | output | 1 | 67,382 | 1 | 134,765 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Consider a tunnel on a one-way road. During a particular day, n cars numbered from 1 to n entered and exited the tunnel exactly once. All the cars passed through the tunnel at constant speeds.
... | instruction | 0 | 67,383 | 1 | 134,766 |
Yes | output | 1 | 67,383 | 1 | 134,767 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Consider a tunnel on a one-way road. During a particular day, n cars numbered from 1 to n entered and exited the tunnel exactly once. All the cars passed through the tunnel at constant speeds.
... | instruction | 0 | 67,384 | 1 | 134,768 |
Yes | output | 1 | 67,384 | 1 | 134,769 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Consider a tunnel on a one-way road. During a particular day, n cars numbered from 1 to n entered and exited the tunnel exactly once. All the cars passed through the tunnel at constant speeds.
... | instruction | 0 | 67,385 | 1 | 134,770 |
No | output | 1 | 67,385 | 1 | 134,771 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Consider a tunnel on a one-way road. During a particular day, n cars numbered from 1 to n entered and exited the tunnel exactly once. All the cars passed through the tunnel at constant speeds.
... | instruction | 0 | 67,386 | 1 | 134,772 |
No | output | 1 | 67,386 | 1 | 134,773 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Consider a tunnel on a one-way road. During a particular day, n cars numbered from 1 to n entered and exited the tunnel exactly once. All the cars passed through the tunnel at constant speeds.
... | instruction | 0 | 67,387 | 1 | 134,774 |
No | output | 1 | 67,387 | 1 | 134,775 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Consider a tunnel on a one-way road. During a particular day, n cars numbered from 1 to n entered and exited the tunnel exactly once. All the cars passed through the tunnel at constant speeds.
... | instruction | 0 | 67,388 | 1 | 134,776 |
No | output | 1 | 67,388 | 1 | 134,777 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Andrew plays a game called "Civilization". Dima helps him.
The game has n cities and m bidirectional roads. The cities are numbered from 1 to n. Between any pair of cities there either is a sin... | instruction | 0 | 67,622 | 1 | 135,244 |
No | output | 1 | 67,622 | 1 | 135,245 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Andrew plays a game called "Civilization". Dima helps him.
The game has n cities and m bidirectional roads. The cities are numbered from 1 to n. Between any pair of cities there either is a sin... | instruction | 0 | 67,623 | 1 | 135,246 |
No | output | 1 | 67,623 | 1 | 135,247 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Andrew plays a game called "Civilization". Dima helps him.
The game has n cities and m bidirectional roads. The cities are numbered from 1 to n. Between any pair of cities there either is a sin... | instruction | 0 | 67,624 | 1 | 135,248 |
No | output | 1 | 67,624 | 1 | 135,249 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Andrew plays a game called "Civilization". Dima helps him.
The game has n cities and m bidirectional roads. The cities are numbered from 1 to n. Between any pair of cities there either is a sin... | instruction | 0 | 67,625 | 1 | 135,250 |
No | output | 1 | 67,625 | 1 | 135,251 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The competitors of Bubble Cup X gathered after the competition and discussed what is the best way to get to know the host country and its cities.
After exploring the map of Serbia for a while, ... | instruction | 0 | 67,829 | 1 | 135,658 |
No | output | 1 | 67,829 | 1 | 135,659 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The competitors of Bubble Cup X gathered after the competition and discussed what is the best way to get to know the host country and its cities.
After exploring the map of Serbia for a while, ... | instruction | 0 | 67,830 | 1 | 135,660 |
No | output | 1 | 67,830 | 1 | 135,661 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The competitors of Bubble Cup X gathered after the competition and discussed what is the best way to get to know the host country and its cities.
After exploring the map of Serbia for a while, ... | instruction | 0 | 67,831 | 1 | 135,662 |
No | output | 1 | 67,831 | 1 | 135,663 |
Provide a correct Python 3 solution for this coding contest problem.
A brave princess in a poor country's tomboy is married to another country for a political marriage. However, a villain who is trying to kill the princess is releasing a thug on the way to his wife.
You have already decided on a safe route to safely ... | instruction | 0 | 68,086 | 1 | 136,172 |
"Correct Solution:
```
from heapq import heappush, heappop
import sys
def solve(readline=sys.stdin.readline, write=sys.stdout.write):
N, M, L = map(int, readline().split())
if N == 0:
return 0
G = [[] for i in range(N)]
for i in range(M):
a, b, d, e = map(int, readline().split())
... | output | 1 | 68,086 | 1 | 136,173 |
Provide a correct Python 3 solution for this coding contest problem.
A brave princess in a poor country's tomboy is married to another country for a political marriage. However, a villain who is trying to kill the princess is releasing a thug on the way to his wife.
You have already decided on a safe route to safely ... | instruction | 0 | 68,087 | 1 | 136,174 |
"Correct Solution:
```
from heapq import heappop, heappush
from collections import defaultdict
def inpl(): return list(map(int, input().split()))
N, M, L = inpl()
while N:
G = [[] for _ in range(N+1)]
for _ in range(M):
a, b, d, e = inpl()
G[a].append([b, d, e])
G[b].append([a, d, e])
... | output | 1 | 68,087 | 1 | 136,175 |
Provide a correct Python 3 solution for this coding contest problem.
A brave princess in a poor country's tomboy is married to another country for a political marriage. However, a villain who is trying to kill the princess is releasing a thug on the way to his wife.
You have already decided on a safe route to safely ... | instruction | 0 | 68,088 | 1 | 136,176 |
"Correct Solution:
```
from heapq import heappush, heappop
INF = 10 ** 20
while True:
n, m, l = map(int, input().split())
if n == 0:
break
edges = [[] for _ in range(n * (l + 1))]
for _ in range(m):
a, b, d, e = map(int, input().split())
a -= 1
b -= 1
for i in range(d, l + 1):
edges[... | output | 1 | 68,088 | 1 | 136,177 |
Provide a correct Python 3 solution for this coding contest problem.
A brave princess in a poor country's tomboy is married to another country for a political marriage. However, a villain who is trying to kill the princess is releasing a thug on the way to his wife.
You have already decided on a safe route to safely ... | instruction | 0 | 68,089 | 1 | 136,178 |
"Correct Solution:
```
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
def LI(): return [int... | output | 1 | 68,089 | 1 | 136,179 |
Provide a correct Python 3 solution for this coding contest problem.
A brave princess in a poor country's tomboy is married to another country for a political marriage. However, a villain who is trying to kill the princess is releasing a thug on the way to his wife.
You have already decided on a safe route to safely ... | instruction | 0 | 68,090 | 1 | 136,180 |
"Correct Solution:
```
from collections import defaultdict
import heapq
while True:
N, M, L = map(int, input().split())
if N==M==L==0:
break
E = defaultdict(lambda: defaultdict(lambda: float("inf")))
for _ in range(M):
A, B, D, E_ = map(int, input().split())
E[A][B] = (D, E_) #... | output | 1 | 68,090 | 1 | 136,181 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A brave princess in a poor country's tomboy is married to another country for a political marriage. However, a villain who is trying to kill the princess is releasing a thug on the way to his wi... | instruction | 0 | 68,091 | 1 | 136,182 |
No | output | 1 | 68,091 | 1 | 136,183 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.