message stringlengths 2 49.9k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 446 108k | cluster float64 13 13 | __index_level_0__ int64 892 217k |
|---|---|---|---|---|---|
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Requirements
* All inputs are of non-negative integer value.
* T_{\text{max}} = 10000
* 200 \leq |V| \leq 400
* 1.5 |V| \leq |E| \leq 2 |V|
* 1 \leq u_{i}, v_{i} \leq |V| (1 \leq i \leq |E|)
* ... | instruction | 0 | 2,269 | 13 | 4,538 |
No | output | 1 | 2,269 | 13 | 4,539 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree consisting of n vertices. A tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a color assigned to it (a_v = 1 if the vertex v is white and 0 if the vertex v is black).
You have to solve... | instruction | 0 | 3,483 | 13 | 6,966 |
Tags: dfs and similar, dp, graphs, trees
Correct Solution:
```
import sys
sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().sp... | output | 1 | 3,483 | 13 | 6,967 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree consisting of n vertices. A tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a color assigned to it (a_v = 1 if the vertex v is white and 0 if the vertex v is black).
You have to solve... | instruction | 0 | 3,484 | 13 | 6,968 |
Tags: dfs and similar, dp, graphs, trees
Correct Solution:
```
import sys
input = sys.stdin.readline
getint = lambda: int(input())
getints = lambda: [int(a) for a in input().split()]
if __name__ == "__main__":
n = getint()
colors = [(i*2-1) for i in getints()]
tree = [[] for i in range(n)]
for i in ran... | output | 1 | 3,484 | 13 | 6,969 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree consisting of n vertices. A tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a color assigned to it (a_v = 1 if the vertex v is white and 0 if the vertex v is black).
You have to solve... | instruction | 0 | 3,485 | 13 | 6,970 |
Tags: dfs and similar, dp, graphs, trees
Correct Solution:
```
from types import GeneratorType
def bootstrap(f, stack=[]):
def wrappedfunc(*args, **kwargs):
if stack:
return f(*args, **kwargs)
else:
to = f(*args, **kwargs)
while True:
if type(to) i... | output | 1 | 3,485 | 13 | 6,971 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree consisting of n vertices. A tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a color assigned to it (a_v = 1 if the vertex v is white and 0 if the vertex v is black).
You have to solve... | instruction | 0 | 3,486 | 13 | 6,972 |
Tags: dfs and similar, dp, graphs, trees
Correct Solution:
```
import os
import sys
from io import BytesIO, IOBase
from types import GeneratorType
from collections import defaultdict
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._fd = file.fileno()
self.buf... | output | 1 | 3,486 | 13 | 6,973 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree consisting of n vertices. A tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a color assigned to it (a_v = 1 if the vertex v is white and 0 if the vertex v is black).
You have to solve... | instruction | 0 | 3,487 | 13 | 6,974 |
Tags: dfs and similar, dp, graphs, trees
Correct Solution:
```
def main():
import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
adj = [[] for _ in range(N+1)]
for _ in range(N-1):
a, b = map(int, input().split())
adj[a].append(b)
adj... | output | 1 | 3,487 | 13 | 6,975 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree consisting of n vertices. A tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a color assigned to it (a_v = 1 if the vertex v is white and 0 if the vertex v is black).
You have to solve... | instruction | 0 | 3,488 | 13 | 6,976 |
Tags: dfs and similar, dp, graphs, trees
Correct Solution:
```
class Graph:
def __init__(self, n_vertices, edges, directed=True):
self.n_vertices = n_vertices
self.edges = edges
self.directed = directed
@property
def adj(self):
try:
return self._adj
exc... | output | 1 | 3,488 | 13 | 6,977 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree consisting of n vertices. A tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a color assigned to it (a_v = 1 if the vertex v is white and 0 if the vertex v is black).
You have to solve... | instruction | 0 | 3,489 | 13 | 6,978 |
Tags: dfs and similar, dp, graphs, trees
Correct Solution:
```
import sys
from collections import deque
input = sys.stdin.buffer.readline
N = int(input())
A = list(map(int, input().split()))
A = [-1] + A
adj = [[] for _ in range(N+1)]
for _ in range(N-1):
a, b = map(int, input().split())
adj[a].append(b)
a... | output | 1 | 3,489 | 13 | 6,979 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree consisting of n vertices. A tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a color assigned to it (a_v = 1 if the vertex v is white and 0 if the vertex v is black).
You have to solve... | instruction | 0 | 3,490 | 13 | 6,980 |
Tags: dfs and similar, dp, graphs, trees
Correct Solution:
```
import sys
input = sys.stdin.readline
N = int(input())
C = list(map(int, input().split()))
T = [[] for _ in range(N)]
edges = []
for _ in range(N-1):
a, b = map(int, input().split())
a -= 1
b -= 1
edges.append([a, b])
T[a].append(b)
... | output | 1 | 3,490 | 13 | 6,981 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a tree consisting of n vertices. A tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a color assigned to it (a_v = 1 if the vertex v is white and ... | instruction | 0 | 3,491 | 13 | 6,982 |
Yes | output | 1 | 3,491 | 13 | 6,983 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a tree consisting of n vertices. A tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a color assigned to it (a_v = 1 if the vertex v is white and ... | instruction | 0 | 3,492 | 13 | 6,984 |
Yes | output | 1 | 3,492 | 13 | 6,985 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a tree consisting of n vertices. A tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a color assigned to it (a_v = 1 if the vertex v is white and ... | instruction | 0 | 3,493 | 13 | 6,986 |
Yes | output | 1 | 3,493 | 13 | 6,987 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a tree consisting of n vertices. A tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a color assigned to it (a_v = 1 if the vertex v is white and ... | instruction | 0 | 3,494 | 13 | 6,988 |
Yes | output | 1 | 3,494 | 13 | 6,989 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a tree consisting of n vertices. A tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a color assigned to it (a_v = 1 if the vertex v is white and ... | instruction | 0 | 3,495 | 13 | 6,990 |
No | output | 1 | 3,495 | 13 | 6,991 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a tree consisting of n vertices. A tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a color assigned to it (a_v = 1 if the vertex v is white and ... | instruction | 0 | 3,496 | 13 | 6,992 |
No | output | 1 | 3,496 | 13 | 6,993 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a tree consisting of n vertices. A tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a color assigned to it (a_v = 1 if the vertex v is white and ... | instruction | 0 | 3,497 | 13 | 6,994 |
No | output | 1 | 3,497 | 13 | 6,995 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a tree consisting of n vertices. A tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a color assigned to it (a_v = 1 if the vertex v is white and ... | instruction | 0 | 3,498 | 13 | 6,996 |
No | output | 1 | 3,498 | 13 | 6,997 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree (connected graph without cycles) consisting of n vertices. The tree is unrooted — it is just a connected undirected graph without cycles.
In one move, you can choose exactly k leaves (leaf is such a vertex that is conne... | instruction | 0 | 3,533 | 13 | 7,066 |
Tags: data structures, greedy, implementation, trees
Correct Solution:
```
from collections import defaultdict,deque
for _ in range(int(input())):
n,k=map(int,input().split())
g=defaultdict(list)
for i in range(n-1):
u,v=map(int,input().split())
u-=1;v-=1
g[u].append(v)
g[v].... | output | 1 | 3,533 | 13 | 7,067 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree (connected graph without cycles) consisting of n vertices. The tree is unrooted — it is just a connected undirected graph without cycles.
In one move, you can choose exactly k leaves (leaf is such a vertex that is conne... | instruction | 0 | 3,534 | 13 | 7,068 |
Tags: data structures, greedy, implementation, trees
Correct Solution:
```
from sys import stdin, gettrace
if gettrace():
inputi = input
else:
def input():
return next(stdin)[:-1]
def inputi():
return stdin.buffer.readline()
def readGraph(n, m):
adj = [set() for _ in range(n)]
fo... | output | 1 | 3,534 | 13 | 7,069 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree (connected graph without cycles) consisting of n vertices. The tree is unrooted — it is just a connected undirected graph without cycles.
In one move, you can choose exactly k leaves (leaf is such a vertex that is conne... | instruction | 0 | 3,535 | 13 | 7,070 |
Tags: data structures, greedy, implementation, trees
Correct Solution:
```
for i in range(int(input())):
n,k=list(map(int,input().split()))
a=[[] for i in range(n)]
b=[0]*n
c=[0]*n
d=[0]*n
e=[]
for i in range(n-1):
u,v=list(map(int,input().split()))
a[u-1].append(v)
a... | output | 1 | 3,535 | 13 | 7,071 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree (connected graph without cycles) consisting of n vertices. The tree is unrooted — it is just a connected undirected graph without cycles.
In one move, you can choose exactly k leaves (leaf is such a vertex that is conne... | instruction | 0 | 3,536 | 13 | 7,072 |
Tags: data structures, greedy, implementation, trees
Correct Solution:
```
import collections
t=int(input())
for i in range(t):
n,k=map(int,input().split())
g=collections.defaultdict(list)
for j in range(n-1):
x,y=map(int,input().split())
g[x].append(y)
g[y].append(x)
if k==1:
... | output | 1 | 3,536 | 13 | 7,073 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree (connected graph without cycles) consisting of n vertices. The tree is unrooted — it is just a connected undirected graph without cycles.
In one move, you can choose exactly k leaves (leaf is such a vertex that is conne... | instruction | 0 | 3,537 | 13 | 7,074 |
Tags: data structures, greedy, implementation, trees
Correct Solution:
```
from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush,heappop,heapify
import math
from collections import *
from functools import reduce,cmp_to_key
import sys
input = sys.stdin.readline
M = mod = 9... | output | 1 | 3,537 | 13 | 7,075 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree (connected graph without cycles) consisting of n vertices. The tree is unrooted — it is just a connected undirected graph without cycles.
In one move, you can choose exactly k leaves (leaf is such a vertex that is conne... | instruction | 0 | 3,538 | 13 | 7,076 |
Tags: data structures, greedy, implementation, trees
Correct Solution:
```
from collections import defaultdict,deque
import sys
input=sys.stdin.readline
t=int(input())
for ii in range(t):
graph=defaultdict(list)
n,k=map(int,input().split())
for i in range(n-1):
u,v=map(int,input().split())
g... | output | 1 | 3,538 | 13 | 7,077 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree (connected graph without cycles) consisting of n vertices. The tree is unrooted — it is just a connected undirected graph without cycles.
In one move, you can choose exactly k leaves (leaf is such a vertex that is conne... | instruction | 0 | 3,539 | 13 | 7,078 |
Tags: data structures, greedy, implementation, trees
Correct Solution:
```
def main():
from heapq import heapify, heappop, heappush
import sys
input = sys.stdin.readline
for __ in [0]*int(input()):
N, K = map(int, input().split())
G = [[] for _ in [0]*N]
deg = [0]*N
for ... | output | 1 | 3,539 | 13 | 7,079 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree (connected graph without cycles) consisting of n vertices. The tree is unrooted — it is just a connected undirected graph without cycles.
In one move, you can choose exactly k leaves (leaf is such a vertex that is conne... | instruction | 0 | 3,540 | 13 | 7,080 |
Tags: data structures, greedy, implementation, trees
Correct Solution:
```
from collections import defaultdict, deque
import heapq
class Graph:
def __init__(self, vertices):
self.graph = [defaultdict() for x in range(vertices+1)]
self.V = vertices
def addEdge(self, u, v, w=1):
self.... | output | 1 | 3,540 | 13 | 7,081 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a tree (connected graph without cycles) consisting of n vertices. The tree is unrooted — it is just a connected undirected graph without cycles.
In one move, you can choose exactl... | instruction | 0 | 3,541 | 13 | 7,082 |
Yes | output | 1 | 3,541 | 13 | 7,083 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a tree (connected graph without cycles) consisting of n vertices. The tree is unrooted — it is just a connected undirected graph without cycles.
In one move, you can choose exactl... | instruction | 0 | 3,542 | 13 | 7,084 |
Yes | output | 1 | 3,542 | 13 | 7,085 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a tree (connected graph without cycles) consisting of n vertices. The tree is unrooted — it is just a connected undirected graph without cycles.
In one move, you can choose exactl... | instruction | 0 | 3,543 | 13 | 7,086 |
Yes | output | 1 | 3,543 | 13 | 7,087 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a tree (connected graph without cycles) consisting of n vertices. The tree is unrooted — it is just a connected undirected graph without cycles.
In one move, you can choose exactl... | instruction | 0 | 3,544 | 13 | 7,088 |
Yes | output | 1 | 3,544 | 13 | 7,089 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a tree (connected graph without cycles) consisting of n vertices. The tree is unrooted — it is just a connected undirected graph without cycles.
In one move, you can choose exactl... | instruction | 0 | 3,545 | 13 | 7,090 |
No | output | 1 | 3,545 | 13 | 7,091 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a tree (connected graph without cycles) consisting of n vertices. The tree is unrooted — it is just a connected undirected graph without cycles.
In one move, you can choose exactl... | instruction | 0 | 3,546 | 13 | 7,092 |
No | output | 1 | 3,546 | 13 | 7,093 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a tree (connected graph without cycles) consisting of n vertices. The tree is unrooted — it is just a connected undirected graph without cycles.
In one move, you can choose exactl... | instruction | 0 | 3,547 | 13 | 7,094 |
No | output | 1 | 3,547 | 13 | 7,095 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a tree (connected graph without cycles) consisting of n vertices. The tree is unrooted — it is just a connected undirected graph without cycles.
In one move, you can choose exactl... | instruction | 0 | 3,548 | 13 | 7,096 |
No | output | 1 | 3,548 | 13 | 7,097 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You've got an undirected graph, consisting of n vertices and m edges. We will consider the graph's vertices numbered with integers from 1 to n. Each vertex of the graph has a color. The color of the i-th vertex is an integer ci.
Let's consi... | instruction | 0 | 3,660 | 13 | 7,320 |
Tags: brute force, dfs and similar, graphs
Correct Solution:
```
"""
Satwik_Tiwari ;) .
21st AUGUST , 2020 - FRIDAY
"""
#===============================================================================================
#importing some useful libraries.
from __future__ import division, print_function
from fract... | output | 1 | 3,660 | 13 | 7,321 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You've got an undirected graph, consisting of n vertices and m edges. We will consider the graph's vertices numbered with integers from 1 to n. Each vertex of the graph has a color. The color of the i-th vertex is an integer ci.
Let's consi... | instruction | 0 | 3,661 | 13 | 7,322 |
Tags: brute force, dfs and similar, graphs
Correct Solution:
```
# Author : nitish420 --------------------------------------------------------------------
import os
import sys
from io import BytesIO, IOBase
from math import inf
def main():
n,m=map(int,input().split())
c=[-1]+list(map(int,input().split()))
k=max(c)+... | output | 1 | 3,661 | 13 | 7,323 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You've got an undirected graph, consisting of n vertices and m edges. We will consider the graph's vertices numbered with integers from 1 to n. Each vertex of the graph has a color. The color of the i-th vertex is an integer ci.
Let's consi... | instruction | 0 | 3,662 | 13 | 7,324 |
Tags: brute force, dfs and similar, graphs
Correct Solution:
```
from sys import stdin
from collections import *
def arr_inp(n):
if n == 1:
return [int(x) for x in stdin.readline().split()]
elif n == 2:
return [float(x) for x in stdin.readline().split()]
else:
return list(stdin.rea... | output | 1 | 3,662 | 13 | 7,325 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You've got an undirected graph, consisting of n vertices and m edges. We will consider the graph's vertices numbered with integers from 1 to n. Each vertex of the graph has a color. The color of the i-th vertex is an integer ci.
Let's consi... | instruction | 0 | 3,663 | 13 | 7,326 |
Tags: brute force, dfs and similar, graphs
Correct Solution:
```
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._fd = file.fileno()
self.buffer = BytesIO()
self.writable = "x" in file.mode or "r" no... | output | 1 | 3,663 | 13 | 7,327 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You've got an undirected graph, consisting of n vertices and m edges. We will consider the graph's vertices numbered with integers from 1 to n. Each vertex of the graph has a color. The color of the i-th vertex is an integer ci.
Let's consi... | instruction | 0 | 3,664 | 13 | 7,328 |
Tags: brute force, dfs and similar, graphs
Correct Solution:
```
from sys import stdin
def main():
n, m = map(int, input().split())
cc = [0, *map(int, input().split())]
d, f = {c: set() for c in cc}, cc.__getitem__
for s in stdin.read().splitlines():
u, v = map(f, map(int, s.split()))
... | output | 1 | 3,664 | 13 | 7,329 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You've got an undirected graph, consisting of n vertices and m edges. We will consider the graph's vertices numbered with integers from 1 to n. Each vertex of the graph has a color. The color of the i-th vertex is an integer ci.
Let's consi... | instruction | 0 | 3,665 | 13 | 7,330 |
Tags: brute force, dfs and similar, graphs
Correct Solution:
```
from collections import defaultdict
n, m = map(int, input().split())
c = list(map(int, input().split()))
res = defaultdict(set)
for _ in range(m):
u, v = map(lambda x: int(x) - 1, input().split())
if c[u] != c[v]:
res[c[u]].add(c[v])
... | output | 1 | 3,665 | 13 | 7,331 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You've got an undirected graph, consisting of n vertices and m edges. We will consider the graph's vertices numbered with integers from 1 to n. Each vertex of the graph has a color. The color of the i-th vertex is an integer ci.
Let's consi... | instruction | 0 | 3,666 | 13 | 7,332 |
Tags: brute force, dfs and similar, graphs
Correct Solution:
```
n, m = map(int, input().split())
c = list(map(int, input().split()))
M =max(c)
g= [set() for _ in range(M+1)]
for _ in range(m):
a, b = map(int, input().split())
a -=1
b -= 1
if c[a] != c[b]:
g[c[a]].add(c[b])
g[c[b]].ad... | output | 1 | 3,666 | 13 | 7,333 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You've got an undirected graph, consisting of n vertices and m edges. We will consider the graph's vertices numbered with integers from 1 to n. Each vertex of the graph has a color. The color of the i-th vertex is an integer ci.
Let's consi... | instruction | 0 | 3,667 | 13 | 7,334 |
Tags: brute force, dfs and similar, graphs
Correct Solution:
```
from collections import defaultdict
from sys import stdin
input = stdin.readline
class N:
def __init__(self, c) -> None:
self.c = c
self.ch = []
if __name__ == '__main__':
n, m = map(int, input().split())
carr = list(map(in... | output | 1 | 3,667 | 13 | 7,335 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You've got an undirected graph, consisting of n vertices and m edges. We will consider the graph's vertices numbered with integers from 1 to n. Each vertex of the graph has a color. The color of... | instruction | 0 | 3,668 | 13 | 7,336 |
Yes | output | 1 | 3,668 | 13 | 7,337 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You've got an undirected graph, consisting of n vertices and m edges. We will consider the graph's vertices numbered with integers from 1 to n. Each vertex of the graph has a color. The color of... | instruction | 0 | 3,669 | 13 | 7,338 |
Yes | output | 1 | 3,669 | 13 | 7,339 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You've got an undirected graph, consisting of n vertices and m edges. We will consider the graph's vertices numbered with integers from 1 to n. Each vertex of the graph has a color. The color of... | instruction | 0 | 3,670 | 13 | 7,340 |
Yes | output | 1 | 3,670 | 13 | 7,341 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You've got an undirected graph, consisting of n vertices and m edges. We will consider the graph's vertices numbered with integers from 1 to n. Each vertex of the graph has a color. The color of... | instruction | 0 | 3,671 | 13 | 7,342 |
Yes | output | 1 | 3,671 | 13 | 7,343 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You've got an undirected graph, consisting of n vertices and m edges. We will consider the graph's vertices numbered with integers from 1 to n. Each vertex of the graph has a color. The color of... | instruction | 0 | 3,672 | 13 | 7,344 |
No | output | 1 | 3,672 | 13 | 7,345 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You've got an undirected graph, consisting of n vertices and m edges. We will consider the graph's vertices numbered with integers from 1 to n. Each vertex of the graph has a color. The color of... | instruction | 0 | 3,673 | 13 | 7,346 |
No | output | 1 | 3,673 | 13 | 7,347 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You've got an undirected graph, consisting of n vertices and m edges. We will consider the graph's vertices numbered with integers from 1 to n. Each vertex of the graph has a color. The color of... | instruction | 0 | 3,674 | 13 | 7,348 |
No | output | 1 | 3,674 | 13 | 7,349 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You've got an undirected graph, consisting of n vertices and m edges. We will consider the graph's vertices numbered with integers from 1 to n. Each vertex of the graph has a color. The color of... | instruction | 0 | 3,675 | 13 | 7,350 |
No | output | 1 | 3,675 | 13 | 7,351 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Greg has a weighed directed graph, consisting of n vertices. In this graph any pair of distinct vertices has an edge between them in both directions. Greg loves playing with the graph and now he has invented a new game:
* The game consist... | instruction | 0 | 3,680 | 13 | 7,360 |
Tags: dp, graphs, shortest paths
Correct Solution:
```
import sys
from array import array # noqa: F401
n = int(input())
matrix = [array('i', list(map(int, input().split()))) for _ in range(n)]
aa = tuple(map(lambda x: int(x) - 1, input().split()))
ans = [''] * n
for i in range(n-1, -1, -1):
x = aa[i]
for a ... | output | 1 | 3,680 | 13 | 7,361 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.