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.
Tomash keeps wandering off and getting lost while he is walking along the streets of Berland. It's no surprise! In his home town, for any pair of intersections there is exactly one way to walk f... | instruction | 0 | 79,515 | 1 | 159,030 |
No | output | 1 | 79,515 | 1 | 159,031 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n cities and m bidirectional roads in the country. The roads in the country form an undirected weighted graph. The graph is not guaranteed to be connected. Each road has it's own parameter w. You can travel through the roads, but t... | instruction | 0 | 80,164 | 1 | 160,328 |
Tags: binary search, brute force, constructive algorithms, dp, flows, graphs, shortest paths
Correct Solution:
```
import sys, io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
read = lambda: map(int, input().split())
from heapq import heappush, heappop
inf = 1e10
n, m = read()
e = {}
for _ in range(... | output | 1 | 80,164 | 1 | 160,329 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n cities and m bidirectional roads in the country. The roads in the country form an undirected weighted graph. The graph is not guaranteed to be connected. Each road has it's own parameter w. You can travel through the roads, but t... | instruction | 0 | 80,165 | 1 | 160,330 |
Tags: binary search, brute force, constructive algorithms, dp, flows, graphs, shortest paths
Correct Solution:
```
import sys
input = sys.stdin.readline
import heapq
n,m=map(int,input().split())
E=[[] for i in range(n+1)]
for i in range(m):
x,y,w=map(int,input().split())
E[x].append((y,w))
E[y].append((x,... | output | 1 | 80,165 | 1 | 160,331 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n cities and m bidirectional roads in the country. The roads in the country form an undirected weighted graph. The graph is not guaranteed to be connected. Each road has it's own parameter w. You can travel through the roads, but t... | instruction | 0 | 80,166 | 1 | 160,332 |
Tags: binary search, brute force, constructive algorithms, dp, flows, graphs, shortest paths
Correct Solution:
```
import sys
input = sys.stdin.readline
import heapq
class Graph:
def __init__(self, N, M=-1):
self.V = N
if M>=0: self.E = M
self.edge = [[] for _ in range(self.V)]
self.edge_rev = [[] for... | output | 1 | 80,166 | 1 | 160,333 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n cities and m bidirectional roads in the country. The roads in the country form an undirected weighted graph. The graph is not guaranteed to be connected. Each road has it's own parameter w. You can travel through the roads, but t... | instruction | 0 | 80,167 | 1 | 160,334 |
Tags: binary search, brute force, constructive algorithms, dp, flows, graphs, shortest paths
Correct Solution:
```
import sys, math
import io, os
#data = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline
#from bisect import bisect_left as bl, bisect_right as br, insort
from heapq import heapify, heappush, heappop
fro... | output | 1 | 80,167 | 1 | 160,335 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n cities and m bidirectional roads in the country. The roads in the country form an undirected weighted graph. The graph is not guaranteed to be connected. Each road has it's own parameter w. You can travel through the roads, but t... | instruction | 0 | 80,168 | 1 | 160,336 |
Tags: binary search, brute force, constructive algorithms, dp, flows, graphs, shortest paths
Correct Solution:
```
import sys
input = sys.stdin.readline
from heapq import heappop, heappush
n, m = map(int, input().split())
G = [[] for _ in range(n)]
d = {}
k = 0
for _ in range(m):
a, b, w = map(int, input().split()... | output | 1 | 80,168 | 1 | 160,337 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n cities and m bidirectional roads in the country. The roads in the country form an undirected weighted graph. The graph is not guaranteed to be connected. Each road has it's own parameter w. You can travel through the roads, but t... | instruction | 0 | 80,169 | 1 | 160,338 |
Tags: binary search, brute force, constructive algorithms, dp, flows, graphs, shortest paths
Correct Solution:
```
import sys
input = sys.stdin.buffer.readline
from heapq import heappush, heappop
n,m = map(int,input().split())
adj = [[] for i in range(n+1)]
mx_dist = 10**9
dist = [mx_dist]*(51*(n+1))
dist[51*1] = 0
f... | output | 1 | 80,169 | 1 | 160,339 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n cities and m bidirectional roads in the country. The roads in the country form an undirected weighted graph. The graph is not guaranteed to be connected. Each road has it's own parameter w. You can travel through the roads, but t... | instruction | 0 | 80,170 | 1 | 160,340 |
Tags: binary search, brute force, constructive algorithms, dp, flows, graphs, shortest paths
Correct Solution:
```
# region fastio # from https://codeforces.com/contest/1333/submission/75948789
import sys, io, os
BUFSIZE = 8192
class FastIO(io.IOBase):
newlines = 0
def __init__(self, file):
self._f... | output | 1 | 80,170 | 1 | 160,341 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n cities and m bidirectional roads in the country. The roads in the country form an undirected weighted graph. The graph is not guaranteed to be connected. Each road has it's own parameter w. You can travel through the roads, but t... | instruction | 0 | 80,171 | 1 | 160,342 |
Tags: binary search, brute force, constructive algorithms, dp, flows, graphs, shortest paths
Correct Solution:
```
from heapq import heappush, heappop
n, m = map(int, input().split())
adj = [[] for i in range(n + 1)]
md = 10**9; dist = [md] * (51 * (n+1)); dist[51] = 0
for i in range(m): u, v, w = map(int, input().spli... | output | 1 | 80,171 | 1 | 160,343 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n cities and m bidirectional roads in the country. The roads in the country form an undirected weighted graph. The graph is not guaranteed to be connected. Each road has it's own param... | instruction | 0 | 80,172 | 1 | 160,344 |
Yes | output | 1 | 80,172 | 1 | 160,345 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n cities and m bidirectional roads in the country. The roads in the country form an undirected weighted graph. The graph is not guaranteed to be connected. Each road has it's own param... | instruction | 0 | 80,173 | 1 | 160,346 |
Yes | output | 1 | 80,173 | 1 | 160,347 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n cities and m bidirectional roads in the country. The roads in the country form an undirected weighted graph. The graph is not guaranteed to be connected. Each road has it's own param... | instruction | 0 | 80,174 | 1 | 160,348 |
Yes | output | 1 | 80,174 | 1 | 160,349 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n cities and m bidirectional roads in the country. The roads in the country form an undirected weighted graph. The graph is not guaranteed to be connected. Each road has it's own param... | instruction | 0 | 80,175 | 1 | 160,350 |
Yes | output | 1 | 80,175 | 1 | 160,351 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n cities and m bidirectional roads in the country. The roads in the country form an undirected weighted graph. The graph is not guaranteed to be connected. Each road has it's own param... | instruction | 0 | 80,176 | 1 | 160,352 |
No | output | 1 | 80,176 | 1 | 160,353 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n cities and m bidirectional roads in the country. The roads in the country form an undirected weighted graph. The graph is not guaranteed to be connected. Each road has it's own param... | instruction | 0 | 80,177 | 1 | 160,354 |
No | output | 1 | 80,177 | 1 | 160,355 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n cities and m bidirectional roads in the country. The roads in the country form an undirected weighted graph. The graph is not guaranteed to be connected. Each road has it's own param... | instruction | 0 | 80,178 | 1 | 160,356 |
No | output | 1 | 80,178 | 1 | 160,357 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n cities and m bidirectional roads in the country. The roads in the country form an undirected weighted graph. The graph is not guaranteed to be connected. Each road has it's own param... | instruction | 0 | 80,179 | 1 | 160,358 |
No | output | 1 | 80,179 | 1 | 160,359 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bajtek is learning to skate on ice. He's a beginner, so his only mode of transportation is pushing off from a snow drift to the north, east, south or west and sliding until he lands in another snow drift. He has noticed that in this way it's... | instruction | 0 | 81,066 | 1 | 162,132 |
Tags: brute force, dfs and similar, dsu, graphs
Correct Solution:
```
n=int(input())
M=[[0 for i in range(1001)] for i in range(1001)]
ans=n-1
T=[]
for i in range(n) :
a,b=map(int,input().split())
M[a][b]=1
T.append([a,b])
for i in range(n) :
r=T[i]
if M[r[0]][r[1]]!=-1 :
M[r[0]][r[1]]=-1
... | output | 1 | 81,066 | 1 | 162,133 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bajtek is learning to skate on ice. He's a beginner, so his only mode of transportation is pushing off from a snow drift to the north, east, south or west and sliding until he lands in another snow drift. He has noticed that in this way it's... | instruction | 0 | 81,070 | 1 | 162,140 |
Tags: brute force, dfs and similar, dsu, graphs
Correct Solution:
```
number = int(input())
contador = 0
array_x = []
array_y = []
visited = [0] * number
for e in range(number):
ax, ay = [int(a) for a in input().split()]
array_x.append(ax)
array_y.append(ay)
def aux(element):
visited[element] = 1
for index in... | output | 1 | 81,070 | 1 | 162,141 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bajtek is learning to skate on ice. He's a beginner, so his only mode of transportation is pushing off from a snow drift to the north, east, south or west and sliding until he lands in another s... | instruction | 0 | 81,076 | 1 | 162,152 |
Yes | output | 1 | 81,076 | 1 | 162,153 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Twilight Sparkle learnt that the evil Nightmare Moon would return during the upcoming Summer Sun Celebration after one thousand years of imprisonment on the moon. She tried to warn her mentor Princess Celestia, but the princess ignored her a... | instruction | 0 | 81,161 | 1 | 162,322 |
Tags: constructive algorithms, dfs and similar, graphs
Correct Solution:
```
"""
Codeforces Contest 259 Div 1 Problem C
Author : chaotic_iak
Language: Python 3.3.4
"""
def main():
n,m = read()
edges = [[] for _ in range(n+1)]
for i in range(m):
a,b = read()
edges[a].append(b)
edge... | output | 1 | 81,161 | 1 | 162,323 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Twilight Sparkle learnt that the evil Nightmare Moon would return during the upcoming Summer Sun Celebration after one thousand years of imprisonment on the moon. She tried to warn her mentor Princess Celestia, but the princess ignored her a... | instruction | 0 | 81,162 | 1 | 162,324 |
Tags: constructive algorithms, dfs and similar, graphs
Correct Solution:
```
import sys
readline = sys.stdin.readline
N, M = map(int, readline().split())
Edge = [[] for _ in range(N)]
for _ in range(M):
u, v = map(int, readline().split())
u -= 1
v -= 1
Edge[u].append(v)
Edge[v].append(u)
Pr = list(... | output | 1 | 81,162 | 1 | 162,325 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Twilight Sparkle learnt that the evil Nightmare Moon would return during the upcoming Summer Sun Celebration after one thousand years of imprisonment on the moon. She tried to warn her mentor Princess Celestia, but the princess ignored her a... | instruction | 0 | 81,163 | 1 | 162,326 |
Tags: constructive algorithms, dfs and similar, graphs
Correct Solution:
```
"""
Codeforces Contest 259 Div 1 Problem C
Author : chaotic_iak
Language: Python 3.3.4
"""
def main():
# Read N and M from problem statement.
n,m = read()
# Set up an adjacency list for each vertex.
edges = [[... | output | 1 | 81,163 | 1 | 162,327 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Twilight Sparkle learnt that the evil Nightmare Moon would return during the upcoming Summer Sun Celebration after one thousand years of imprisonment on the moon. She tried to warn her mentor Princess Celestia, but the princess ignored her a... | instruction | 0 | 81,164 | 1 | 162,328 |
Tags: constructive algorithms, dfs and similar, graphs
Correct Solution:
```
"""
Codeforces Contest 259 Div 1 Problem C
Author : chaotic_iak
Language: Python 3.3.4
"""
def main():
# Read N and M from problem statement.
n,m = read()
# Set up an adjacency list for each vertex.
edges = [[] for _ in ra... | output | 1 | 81,164 | 1 | 162,329 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Twilight Sparkle learnt that the evil Nightmare Moon would return during the upcoming Summer Sun Celebration after one thousand years of imprisonment on the moon. She tried to warn her mentor Princess Celestia, but the princess ignored her a... | instruction | 0 | 81,165 | 1 | 162,330 |
Tags: constructive algorithms, dfs and similar, graphs
Correct Solution:
```
import sys
input = sys.stdin.readline
def solve():
n, m = map(int, input().split())
g = [[] for i in range(n+1)]
for i in range(m):
u, v = map(int, input().split())
g[u].append(v)
g[v].append(u)
a = list(map(int, input().split()))
... | output | 1 | 81,165 | 1 | 162,331 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Twilight Sparkle learnt that the evil Nightmare Moon would return during the upcoming Summer Sun Celebration after one thousand years of imprisonment on the moon. She tried to warn her mentor Pr... | instruction | 0 | 81,166 | 1 | 162,332 |
No | output | 1 | 81,166 | 1 | 162,333 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Twilight Sparkle learnt that the evil Nightmare Moon would return during the upcoming Summer Sun Celebration after one thousand years of imprisonment on the moon. She tried to warn her mentor Pr... | instruction | 0 | 81,167 | 1 | 162,334 |
No | output | 1 | 81,167 | 1 | 162,335 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Twilight Sparkle learnt that the evil Nightmare Moon would return during the upcoming Summer Sun Celebration after one thousand years of imprisonment on the moon. She tried to warn her mentor Pr... | instruction | 0 | 81,168 | 1 | 162,336 |
No | output | 1 | 81,168 | 1 | 162,337 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Twilight Sparkle learnt that the evil Nightmare Moon would return during the upcoming Summer Sun Celebration after one thousand years of imprisonment on the moon. She tried to warn her mentor Pr... | instruction | 0 | 81,169 | 1 | 162,338 |
No | output | 1 | 81,169 | 1 | 162,339 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today Patrick waits for a visit from his friend Spongebob. To prepare for the visit, Patrick needs to buy some goodies in two stores located near his house. There is a d1 meter long road between his house and the first shop and a d2 meter lo... | instruction | 0 | 81,228 | 1 | 162,456 |
Tags: implementation
Correct Solution:
```
d1, d2, d3 = map(int, input().split())
print(min(2 * (d1 + d2), 2 * (d1 + d3), 2 * (d3 + d2), d1 + d2 + d3))
``` | output | 1 | 81,228 | 1 | 162,457 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today Patrick waits for a visit from his friend Spongebob. To prepare for the visit, Patrick needs to buy some goodies in two stores located near his house. There is a d1 meter long road between his house and the first shop and a d2 meter lo... | instruction | 0 | 81,229 | 1 | 162,458 |
Tags: implementation
Correct Solution:
```
numbers = list(map(int, input().split()))
location = 0 #0 is home, 1 is house 1, 2 is house 2
distance = min(numbers[0], numbers[1])
location = numbers.index(distance) + 1
distance += min(numbers[2], numbers[0] + numbers[1])
location = 3 - location
distance += min(numbers[loc... | output | 1 | 81,229 | 1 | 162,459 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today Patrick waits for a visit from his friend Spongebob. To prepare for the visit, Patrick needs to buy some goodies in two stores located near his house. There is a d1 meter long road between his house and the first shop and a d2 meter lo... | instruction | 0 | 81,230 | 1 | 162,460 |
Tags: implementation
Correct Solution:
```
def f(d1,d2,d3):
return min(d1,d2+d3)+min(d2,d1+d3)+min(d3,d1+d2)
d1,d2,d3 = map(int,input().split())
print(f(d1,d2,d3))
``` | output | 1 | 81,230 | 1 | 162,461 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today Patrick waits for a visit from his friend Spongebob. To prepare for the visit, Patrick needs to buy some goodies in two stores located near his house. There is a d1 meter long road between his house and the first shop and a d2 meter lo... | instruction | 0 | 81,231 | 1 | 162,462 |
Tags: implementation
Correct Solution:
```
a,b,c =map(int,input().split())
gza1=min(a,b)
gzaa=max(a,b)
gza2=min(gzaa,c)
x=2*(gza1+gza2)
print(min(x,a+b+c))
``` | output | 1 | 81,231 | 1 | 162,463 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today Patrick waits for a visit from his friend Spongebob. To prepare for the visit, Patrick needs to buy some goodies in two stores located near his house. There is a d1 meter long road between his house and the first shop and a d2 meter lo... | instruction | 0 | 81,232 | 1 | 162,464 |
Tags: implementation
Correct Solution:
```
d1,d2,d3= input().split()
d1= int(d1)
d2= int(d2)
d3= int(d3)
ans= min(2*d1 + 2*d2, d1+d2+d3, 2*d1 + 2*d3, 2*d2 + 2*d3)
print(ans)
``` | output | 1 | 81,232 | 1 | 162,465 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today Patrick waits for a visit from his friend Spongebob. To prepare for the visit, Patrick needs to buy some goodies in two stores located near his house. There is a d1 meter long road between his house and the first shop and a d2 meter lo... | instruction | 0 | 81,233 | 1 | 162,466 |
Tags: implementation
Correct Solution:
```
l = list(map(int, input().split()))
print(min((sum(l) - max(l))*2, sum(l)))
``` | output | 1 | 81,233 | 1 | 162,467 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today Patrick waits for a visit from his friend Spongebob. To prepare for the visit, Patrick needs to buy some goodies in two stores located near his house. There is a d1 meter long road between his house and the first shop and a d2 meter lo... | instruction | 0 | 81,234 | 1 | 162,468 |
Tags: implementation
Correct Solution:
```
a=input().split()
a[0]=int(a[0])
a[2]=int(a[2])
a[1]=int(a[1])
a.sort()
b=(a[0]+a[1])*2
c=a[0]+a[1]+a[2]
d=min(b,c)
print(d)
``` | output | 1 | 81,234 | 1 | 162,469 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today Patrick waits for a visit from his friend Spongebob. To prepare for the visit, Patrick needs to buy some goodies in two stores located near his house. There is a d1 meter long road between his house and the first shop and a d2 meter lo... | instruction | 0 | 81,235 | 1 | 162,470 |
Tags: implementation
Correct Solution:
```
d1,d2,d3 = list(map(int,input().split()))
print(min(2*d1+2*d2,d1+d2+d3,2*d1+2*d3,2*d2+2*d3))
``` | output | 1 | 81,235 | 1 | 162,471 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today Patrick waits for a visit from his friend Spongebob. To prepare for the visit, Patrick needs to buy some goodies in two stores located near his house. There is a d1 meter long road between... | instruction | 0 | 81,236 | 1 | 162,472 |
Yes | output | 1 | 81,236 | 1 | 162,473 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today Patrick waits for a visit from his friend Spongebob. To prepare for the visit, Patrick needs to buy some goodies in two stores located near his house. There is a d1 meter long road between... | instruction | 0 | 81,237 | 1 | 162,474 |
Yes | output | 1 | 81,237 | 1 | 162,475 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today Patrick waits for a visit from his friend Spongebob. To prepare for the visit, Patrick needs to buy some goodies in two stores located near his house. There is a d1 meter long road between... | instruction | 0 | 81,238 | 1 | 162,476 |
Yes | output | 1 | 81,238 | 1 | 162,477 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today Patrick waits for a visit from his friend Spongebob. To prepare for the visit, Patrick needs to buy some goodies in two stores located near his house. There is a d1 meter long road between... | instruction | 0 | 81,239 | 1 | 162,478 |
Yes | output | 1 | 81,239 | 1 | 162,479 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today Patrick waits for a visit from his friend Spongebob. To prepare for the visit, Patrick needs to buy some goodies in two stores located near his house. There is a d1 meter long road between... | instruction | 0 | 81,240 | 1 | 162,480 |
No | output | 1 | 81,240 | 1 | 162,481 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today Patrick waits for a visit from his friend Spongebob. To prepare for the visit, Patrick needs to buy some goodies in two stores located near his house. There is a d1 meter long road between... | instruction | 0 | 81,241 | 1 | 162,482 |
No | output | 1 | 81,241 | 1 | 162,483 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today Patrick waits for a visit from his friend Spongebob. To prepare for the visit, Patrick needs to buy some goodies in two stores located near his house. There is a d1 meter long road between... | instruction | 0 | 81,242 | 1 | 162,484 |
No | output | 1 | 81,242 | 1 | 162,485 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today Patrick waits for a visit from his friend Spongebob. To prepare for the visit, Patrick needs to buy some goodies in two stores located near his house. There is a d1 meter long road between... | instruction | 0 | 81,243 | 1 | 162,486 |
No | output | 1 | 81,243 | 1 | 162,487 |
Provide a correct Python 3 solution for this coding contest problem.
problem
The island where JOI lives has been invaded by zombies. JOI decided to escape to the shelter, which is set as the safest shelter on the island.
The island where JOI lives consists of N towns from town 1 to town N, and the towns are connecte... | instruction | 0 | 81,638 | 1 | 163,276 |
"Correct Solution:
```
from heapq import heappush, heappop
INF = 10 ** 20
n, m, k, s = map(int, input().split())
p, q = map(int, input().split())
z_dist = [INF] * n
que = []
for _ in range(k):
c = int(input()) - 1
z_dist[c] = 0
heappush(que, (0, c))
edges = [[] for _ in range(n)]
for _ in range(m):
a, b = map... | output | 1 | 81,638 | 1 | 163,277 |
Provide a correct Python 3 solution for this coding contest problem.
problem
The island where JOI lives has been invaded by zombies. JOI decided to escape to the shelter, which is set as the safest shelter on the island.
The island where JOI lives consists of N towns from town 1 to town N, and the towns are connecte... | instruction | 0 | 81,639 | 1 | 163,278 |
"Correct Solution:
```
from heapq import heappush, heappop
INF = 10 ** 20
n, m, k, s = map(int, input().split())
p, q = map(int, input().split())
z_dist = [INF] * n
que = []
for _ in range(k):
c = int(input()) - 1
z_dist[c] = 0
heappush(que, (0, c))
edges = [[] for _ in range(n)]
for _ in range(m):
a, b = map... | output | 1 | 81,639 | 1 | 163,279 |
Provide a correct Python 3 solution for this coding contest problem.
problem
The island where JOI lives has been invaded by zombies. JOI decided to escape to the shelter, which is set as the safest shelter on the island.
The island where JOI lives consists of N towns from town 1 to town N, and the towns are connecte... | instruction | 0 | 81,640 | 1 | 163,280 |
"Correct Solution:
```
from collections import deque
from heapq import heappush, heappop
N, M, K, S = map(int, input().split())
P, Q = map(int, input().split())
C = [int(input())-1 for i in range(K)]
G = [[] for i in range(N)]
for i in range(M):
a, b = map(int, input().split()); a -= 1; b -= 1
G[a].append(b)
... | output | 1 | 81,640 | 1 | 163,281 |
Provide a correct Python 3 solution for this coding contest problem.
problem
The island where JOI lives has been invaded by zombies. JOI decided to escape to the shelter, which is set as the safest shelter on the island.
The island where JOI lives consists of N towns from town 1 to town N, and the towns are connecte... | instruction | 0 | 81,641 | 1 | 163,282 |
"Correct Solution:
```
from collections import deque
from heapq import heappop,heappush
inf=float("INF")
dq=[]
n,m,k,s=map(int,input().split())
p,q=map(int,input().split())
c=[0]*k
z_dist=[inf]*n
for i in range(k):
c[i]=int(input())-1
z_dist[c[i]]=0
heappush(dq,(0,c[i]))
g=[[] for i in range(m)]
a=[0... | output | 1 | 81,641 | 1 | 163,283 |
Provide a correct Python 3 solution for this coding contest problem.
problem
The island where JOI lives has been invaded by zombies. JOI decided to escape to the shelter, which is set as the safest shelter on the island.
The island where JOI lives consists of N towns from town 1 to town N, and the towns are connecte... | instruction | 0 | 81,642 | 1 | 163,284 |
"Correct Solution:
```
from collections import deque
import heapq
N,M,K,S = map(int,input().split())
# - N nodes, M edges, K zombie nodes
# - S本以下の道路を使って到達できる街 = 危険な街
P,Q = map(int,input().split())
# - P: not dangerous
# - Q: dangerous
C = []
for _ in range(K):
C.append(int(input()))
# C[i] = zombie cities
# M ro... | output | 1 | 81,642 | 1 | 163,285 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.