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 |
|---|---|---|---|---|---|
Provide tags and a correct Python 3 solution for this coding contest problem.
Given a connected undirected graph with n vertices and an integer k, you have to either:
* either find an independent set that has exactly ⌈k/2⌉ vertices.
* or find a simple cycle of length at most k.
An independent set is a set of ... | instruction | 0 | 43,129 | 13 | 86,258 |
Tags: constructive algorithms, dfs and similar, graphs, greedy, implementation, trees
Correct Solution:
```
import sys
input = sys.stdin.readline
from collections import deque
class Graph(object):
"""docstring for Graph"""
def __init__(self,n,d): # Number of nodes and d is True if directed
self.n = n
self.graph ... | output | 1 | 43,129 | 13 | 86,259 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Given a connected undirected graph with n vertices and an integer k, you have to either:
* either find an independent set that has exactly ⌈k/2⌉ vertices.
* or find a simple cycle of length at most k.
An independent set is a set of ... | instruction | 0 | 43,130 | 13 | 86,260 |
Tags: constructive algorithms, dfs and similar, graphs, greedy, implementation, trees
Correct Solution:
```
import io
import os
from collections import Counter, defaultdict, deque
import sys
sys.setrecursionlimit(10 ** 5 + 1)
from types import GeneratorType
# https://github.com/cheran-senthil/PyRival/blob/master/py... | output | 1 | 43,130 | 13 | 86,261 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Given a connected undirected graph with n vertices and an integer k, you have to either:
* either find an independent set that has exactly ⌈k/2⌉ vertices.
* or find a simple cycle of length at most k.
An independent set is a set of ... | instruction | 0 | 43,131 | 13 | 86,262 |
Tags: constructive algorithms, dfs and similar, graphs, greedy, implementation, trees
Correct Solution:
```
import math
import sys
from collections import deque
from typing import Deque, Dict, List, Optional, Set, Tuple
def data():
return sys.stdin.buffer.readline().strip()
def mdata():
return list(map(int... | output | 1 | 43,131 | 13 | 86,263 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given a connected undirected graph with n vertices and an integer k, you have to either:
* either find an independent set that has exactly ⌈k/2⌉ vertices.
* or find a simple cycle of length... | instruction | 0 | 43,132 | 13 | 86,264 |
Yes | output | 1 | 43,132 | 13 | 86,265 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given a connected undirected graph with n vertices and an integer k, you have to either:
* either find an independent set that has exactly ⌈k/2⌉ vertices.
* or find a simple cycle of length... | instruction | 0 | 43,133 | 13 | 86,266 |
Yes | output | 1 | 43,133 | 13 | 86,267 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given a connected undirected graph with n vertices and an integer k, you have to either:
* either find an independent set that has exactly ⌈k/2⌉ vertices.
* or find a simple cycle of length... | instruction | 0 | 43,134 | 13 | 86,268 |
Yes | output | 1 | 43,134 | 13 | 86,269 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given a connected undirected graph with n vertices and an integer k, you have to either:
* either find an independent set that has exactly ⌈k/2⌉ vertices.
* or find a simple cycle of length... | instruction | 0 | 43,135 | 13 | 86,270 |
Yes | output | 1 | 43,135 | 13 | 86,271 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given a connected undirected graph with n vertices and an integer k, you have to either:
* either find an independent set that has exactly ⌈k/2⌉ vertices.
* or find a simple cycle of length... | instruction | 0 | 43,136 | 13 | 86,272 |
No | output | 1 | 43,136 | 13 | 86,273 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given a connected undirected graph with n vertices and an integer k, you have to either:
* either find an independent set that has exactly ⌈k/2⌉ vertices.
* or find a simple cycle of length... | instruction | 0 | 43,137 | 13 | 86,274 |
No | output | 1 | 43,137 | 13 | 86,275 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given a connected undirected graph with n vertices and an integer k, you have to either:
* either find an independent set that has exactly ⌈k/2⌉ vertices.
* or find a simple cycle of length... | instruction | 0 | 43,138 | 13 | 86,276 |
No | output | 1 | 43,138 | 13 | 86,277 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given a connected undirected graph with n vertices and an integer k, you have to either:
* either find an independent set that has exactly ⌈k/2⌉ vertices.
* or find a simple cycle of length... | instruction | 0 | 43,139 | 13 | 86,278 |
No | output | 1 | 43,139 | 13 | 86,279 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Kefa decided to celebrate his first big salary by going to the restaurant.
He lives by an unusual park. The park is a rooted tree consisting of n vertices with the root at vertex 1. Vertex 1 also contains Kefa's house. Unfortunaely for our... | instruction | 0 | 43,396 | 13 | 86,792 |
Tags: dfs and similar, graphs, trees
Correct Solution:
```
from collections import deque
class CodeforcesTask580CSolution:
def __init__(self):
self.result = ''
self.n_m = []
self.wrong = []
self.edges = []
def read_input(self):
self.n_m = [int(x) for x in input().split... | output | 1 | 43,396 | 13 | 86,793 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Kefa decided to celebrate his first big salary by going to the restaurant.
He lives by an unusual park. The park is a rooted tree consisting of n vertices with the root at vertex 1. Vertex 1 also contains Kefa's house. Unfortunaely for our... | instruction | 0 | 43,397 | 13 | 86,794 |
Tags: dfs and similar, graphs, trees
Correct Solution:
```
from queue import Queue
MAX = 100005
a = [0]
cat = [0] * MAX
visited = [False] * MAX
head = [None] * MAX
#head = [None for _ in range(MAX)]
class Node:
def __init__(self, v=None, next=None):
self.v = v
self.next = next
def lianjie(x, y):
head[x] = Nod... | output | 1 | 43,397 | 13 | 86,795 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Kefa decided to celebrate his first big salary by going to the restaurant.
He lives by an unusual park. The park is a rooted tree consisting of n vertices with the root at vertex 1. Vertex 1 also contains Kefa's house. Unfortunaely for our... | instruction | 0 | 43,398 | 13 | 86,796 |
Tags: dfs and similar, graphs, trees
Correct Solution:
```
import sys
def input(): return sys.stdin.readline().strip()
n, m = map(int, input().split())
a = [int(i) for i in input().split()]
edge = [[] for i in range(n)]
for i in range(n-1):
x, y = map(int, input().split())
edge[x-1].append(y-1)
edge[y-1].append(x-... | output | 1 | 43,398 | 13 | 86,797 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Kefa decided to celebrate his first big salary by going to the restaurant.
He lives by an unusual park. The park is a rooted tree consisting of n vertices with the root at vertex 1. Vertex 1 also contains Kefa's house. Unfortunaely for our... | instruction | 0 | 43,399 | 13 | 86,798 |
Tags: dfs and similar, graphs, trees
Correct Solution:
```
def dfs(d,lst,n,m):
stack = [[0,0]]
mark = {i:False for i in range(n)}
mark[0]=True
res=0
while stack:
q = stack.pop()
s,a = q[0],q[1]
e=0
if lst[s]==1:
a+=1
else:
if a<=m:
... | output | 1 | 43,399 | 13 | 86,799 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Kefa decided to celebrate his first big salary by going to the restaurant.
He lives by an unusual park. The park is a rooted tree consisting of n vertices with the root at vertex 1. Vertex 1 also contains Kefa's house. Unfortunaely for our... | instruction | 0 | 43,400 | 13 | 86,800 |
Tags: dfs and similar, graphs, trees
Correct Solution:
```
n,m=map(int,input().split())
cats=list(map(int,input().split()))
q=[[] for i in range(n)]
for i in range(n-1):
x,y=map(int,input().split())
q[x-1].append(y-1)
q[y-1].append(x-1)
#0 is start_index,0 is the number of cats initially.
query=[(0,0)]
l=0
... | output | 1 | 43,400 | 13 | 86,801 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Kefa decided to celebrate his first big salary by going to the restaurant.
He lives by an unusual park. The park is a rooted tree consisting of n vertices with the root at vertex 1. Vertex 1 also contains Kefa's house. Unfortunaely for our... | instruction | 0 | 43,401 | 13 | 86,802 |
Tags: dfs and similar, graphs, trees
Correct Solution:
```
n, m = (map(int, input().split()))
a = [int(x) for x in input().split()]
a.insert(0, 0)
catNumbers = {}
tree = {}
restCount = 0
def handle(i, prev_i, streak):
global restCount, catNumbers, tree, front
newStreak = streak + 1 if a[i] else 0
catNumb... | output | 1 | 43,401 | 13 | 86,803 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Kefa decided to celebrate his first big salary by going to the restaurant.
He lives by an unusual park. The park is a rooted tree consisting of n vertices with the root at vertex 1. Vertex 1 also contains Kefa's house. Unfortunaely for our... | instruction | 0 | 43,402 | 13 | 86,804 |
Tags: dfs and similar, graphs, trees
Correct Solution:
```
global k
n,k=map(int, input().split())
global g
global v
g = [ [] for i in range(n)]
v = list(map(int, input().split()))
g[0].append(0)
for i in range (n-1):
a,b=map(int, input().split())
g[a-1].append(b-1)
g[b-1].append(a-1)
t=0
q=[[0,0,v[0]]]
whil... | output | 1 | 43,402 | 13 | 86,805 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Kefa decided to celebrate his first big salary by going to the restaurant.
He lives by an unusual park. The park is a rooted tree consisting of n vertices with the root at vertex 1. Vertex 1 also contains Kefa's house. Unfortunaely for our... | instruction | 0 | 43,403 | 13 | 86,806 |
Tags: dfs and similar, graphs, trees
Correct Solution:
```
# recursive too deep might causing stack overflow
def go_child(node, path_cat, parent):
# check if too more cat
m_cat = 0
if cat[node] == 0:
m_cat = 0
else:
m_cat = path_cat + cat[node]
# too more cat then leaves are not achi... | output | 1 | 43,403 | 13 | 86,807 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Kefa decided to celebrate his first big salary by going to the restaurant.
He lives by an unusual park. The park is a rooted tree consisting of n vertices with the root at vertex 1. Vertex 1 a... | instruction | 0 | 43,404 | 13 | 86,808 |
Yes | output | 1 | 43,404 | 13 | 86,809 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Kefa decided to celebrate his first big salary by going to the restaurant.
He lives by an unusual park. The park is a rooted tree consisting of n vertices with the root at vertex 1. Vertex 1 a... | instruction | 0 | 43,405 | 13 | 86,810 |
Yes | output | 1 | 43,405 | 13 | 86,811 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Kefa decided to celebrate his first big salary by going to the restaurant.
He lives by an unusual park. The park is a rooted tree consisting of n vertices with the root at vertex 1. Vertex 1 a... | instruction | 0 | 43,406 | 13 | 86,812 |
Yes | output | 1 | 43,406 | 13 | 86,813 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Kefa decided to celebrate his first big salary by going to the restaurant.
He lives by an unusual park. The park is a rooted tree consisting of n vertices with the root at vertex 1. Vertex 1 a... | instruction | 0 | 43,407 | 13 | 86,814 |
Yes | output | 1 | 43,407 | 13 | 86,815 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Kefa decided to celebrate his first big salary by going to the restaurant.
He lives by an unusual park. The park is a rooted tree consisting of n vertices with the root at vertex 1. Vertex 1 a... | instruction | 0 | 43,408 | 13 | 86,816 |
No | output | 1 | 43,408 | 13 | 86,817 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Kefa decided to celebrate his first big salary by going to the restaurant.
He lives by an unusual park. The park is a rooted tree consisting of n vertices with the root at vertex 1. Vertex 1 a... | instruction | 0 | 43,409 | 13 | 86,818 |
No | output | 1 | 43,409 | 13 | 86,819 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Kefa decided to celebrate his first big salary by going to the restaurant.
He lives by an unusual park. The park is a rooted tree consisting of n vertices with the root at vertex 1. Vertex 1 a... | instruction | 0 | 43,410 | 13 | 86,820 |
No | output | 1 | 43,410 | 13 | 86,821 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Kefa decided to celebrate his first big salary by going to the restaurant.
He lives by an unusual park. The park is a rooted tree consisting of n vertices with the root at vertex 1. Vertex 1 a... | instruction | 0 | 43,411 | 13 | 86,822 |
No | output | 1 | 43,411 | 13 | 86,823 |
Provide a correct Python 3 solution for this coding contest problem.
Snuke found a record of a tree with N vertices in ancient ruins. The findings are as follows:
* The vertices of the tree were numbered 1,2,...,N, and the edges were numbered 1,2,...,N-1.
* Edge i connected Vertex a_i and b_i.
* The length of each ed... | instruction | 0 | 43,656 | 13 | 87,312 |
"Correct Solution:
```
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
data = list(map(int,read().split()))
A = data[:N+N-2:2]
B = data[1:N+N-2:2]
INF = 10 ** 18 + 100
S = [INF] + data[-N:]
graph = [[] for _ in range(N+1)]
for a,b... | output | 1 | 43,656 | 13 | 87,313 |
Provide a correct Python 3 solution for this coding contest problem.
Snuke found a record of a tree with N vertices in ancient ruins. The findings are as follows:
* The vertices of the tree were numbered 1,2,...,N, and the edges were numbered 1,2,...,N-1.
* Edge i connected Vertex a_i and b_i.
* The length of each ed... | instruction | 0 | 43,657 | 13 | 87,314 |
"Correct Solution:
```
def main():
n = int(input())
ab = [sorted(list(map(int, input().split()))) for _ in [0]*(n-1)]
s = list(map(int, input().split()))
g = [[] for _ in [0]*n]
[g[a-1].append(b-1) for a, b in ab]
[g[b-1].append(a-1) for a, b in ab]
root = 0 # 根
d = [-1]*n # 根からの距離
... | output | 1 | 43,657 | 13 | 87,315 |
Provide a correct Python 3 solution for this coding contest problem.
Snuke found a record of a tree with N vertices in ancient ruins. The findings are as follows:
* The vertices of the tree were numbered 1,2,...,N, and the edges were numbered 1,2,...,N-1.
* Edge i connected Vertex a_i and b_i.
* The length of each ed... | instruction | 0 | 43,658 | 13 | 87,316 |
"Correct Solution:
```
import sys
sys.setrecursionlimit(10**8)
N=int(input())
G=[[] for i in range(N)]
E=[]
ans=[0]*(N-1)
for i in range(N-1):
a,b=map(int,input().split())
G[a-1].append((b-1,i))
G[b-1].append((a-1,i))
s=[int(i) for i in input().split()]
n=[0]*N
visited=[False]*N
def size(x):
res=1
visited[x]=... | output | 1 | 43,658 | 13 | 87,317 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Snuke found a record of a tree with N vertices in ancient ruins. The findings are as follows:
* The vertices of the tree were numbered 1,2,...,N, and the edges were numbered 1,2,...,N-1.
* Edge... | instruction | 0 | 43,659 | 13 | 87,318 |
No | output | 1 | 43,659 | 13 | 87,319 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Snuke found a record of a tree with N vertices in ancient ruins. The findings are as follows:
* The vertices of the tree were numbered 1,2,...,N, and the edges were numbered 1,2,...,N-1.
* Edge... | instruction | 0 | 43,660 | 13 | 87,320 |
No | output | 1 | 43,660 | 13 | 87,321 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Snuke found a record of a tree with N vertices in ancient ruins. The findings are as follows:
* The vertices of the tree were numbered 1,2,...,N, and the edges were numbered 1,2,...,N-1.
* Edge... | instruction | 0 | 43,661 | 13 | 87,322 |
No | output | 1 | 43,661 | 13 | 87,323 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree consisting exactly of n vertices. Tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a value a_v assigned to it.
Let dist(x, y) be the distance between the vertices x and y. The distance... | instruction | 0 | 43,845 | 13 | 87,690 |
Tags: dfs and similar, dp, trees
Correct Solution:
```
from collections import defaultdict
from sys import stdin, setrecursionlimit
import threading
input = stdin.buffer.readline
def work():
res = 0
ans = 0
setrecursionlimit(1 << 18)
n = int(input())
a = list(map(int, input().split()))
a.inser... | output | 1 | 43,845 | 13 | 87,691 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree consisting exactly of n vertices. Tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a value a_v assigned to it.
Let dist(x, y) be the distance between the vertices x and y. The distance... | instruction | 0 | 43,846 | 13 | 87,692 |
Tags: dfs and similar, dp, trees
Correct Solution:
```
'''t=int(input())
while(t):
t-=1
n,k=[int(x) for x in input().split()]
s=""
while(len(s)!=n):
i=0
while(i<k):
if len(s)==n:
break
s+=chr(97+i)
i+=1
print(s)'''
'''n=int(input()... | output | 1 | 43,846 | 13 | 87,693 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree consisting exactly of n vertices. Tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a value a_v assigned to it.
Let dist(x, y) be the distance between the vertices x and y. The distance... | instruction | 0 | 43,847 | 13 | 87,694 |
Tags: dfs and similar, dp, 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.buffer = Byt... | output | 1 | 43,847 | 13 | 87,695 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree consisting exactly of n vertices. Tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a value a_v assigned to it.
Let dist(x, y) be the distance between the vertices x and y. The distance... | instruction | 0 | 43,848 | 13 | 87,696 |
Tags: dfs and similar, dp, trees
Correct Solution:
```
import traceback
import sys
sys.setrecursionlimit(200010)
try:
# alpha = "abcdefghijklmnopqrstuvwxyz"
n = int(input())
a = [0]
a.extend(list(map(int, input().split())))
D = [[] for i in range(n+1)]
for i in range(n-1):
e1,e2 = (map... | output | 1 | 43,848 | 13 | 87,697 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree consisting exactly of n vertices. Tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a value a_v assigned to it.
Let dist(x, y) be the distance between the vertices x and y. The distance... | instruction | 0 | 43,849 | 13 | 87,698 |
Tags: dfs and similar, dp, trees
Correct Solution:
```
import io,os
from collections import deque
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
class Node:
def __init__(self,val):
self.val = int(val)
self.cul = 0
self.child = set()
self.path = {}
def __str__(self):... | output | 1 | 43,849 | 13 | 87,699 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree consisting exactly of n vertices. Tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a value a_v assigned to it.
Let dist(x, y) be the distance between the vertices x and y. The distance... | instruction | 0 | 43,850 | 13 | 87,700 |
Tags: dfs and similar, dp, trees
Correct Solution:
```
import sys
from collections import deque
from types import GeneratorType
sys.setrecursionlimit(200000)
input = sys.stdin.readline
def bootstrap(f, stack=[]):
def wrappedfunc(*args, **kwargs):
if stack:
return f(*args, **kwargs)
else:... | output | 1 | 43,850 | 13 | 87,701 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree consisting exactly of n vertices. Tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a value a_v assigned to it.
Let dist(x, y) be the distance between the vertices x and y. The distance... | instruction | 0 | 43,851 | 13 | 87,702 |
Tags: dfs and similar, dp, trees
Correct Solution:
```
from sys import stdin,setrecursionlimit
n = int(stdin.readline())
ay = [int(x) for x in stdin.readline().split()]
graph = [set() for x in range(n)]
for e in range(n-1):
a,b = [int(x)-1 for x in stdin.readline().split()]
graph[a].add(b)
graph[b].add(... | output | 1 | 43,851 | 13 | 87,703 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree consisting exactly of n vertices. Tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a value a_v assigned to it.
Let dist(x, y) be the distance between the vertices x and y. The distance... | instruction | 0 | 43,852 | 13 | 87,704 |
Tags: dfs and similar, dp, trees
Correct Solution:
```
"""
Satwik_Tiwari ;) .
30th AUGUST , 2020 - SUNDAY
"""
#===============================================================================================
#importing some useful libraries.
from __future__ import division, print_function
from fractions impor... | output | 1 | 43,852 | 13 | 87,705 |
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 exactly of n vertices. Tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a value a_v assigned to it.
Let dist(x, y) be the dist... | instruction | 0 | 43,853 | 13 | 87,706 |
Yes | output | 1 | 43,853 | 13 | 87,707 |
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 exactly of n vertices. Tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a value a_v assigned to it.
Let dist(x, y) be the dist... | instruction | 0 | 43,854 | 13 | 87,708 |
Yes | output | 1 | 43,854 | 13 | 87,709 |
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 exactly of n vertices. Tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a value a_v assigned to it.
Let dist(x, y) be the dist... | instruction | 0 | 43,855 | 13 | 87,710 |
Yes | output | 1 | 43,855 | 13 | 87,711 |
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 exactly of n vertices. Tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a value a_v assigned to it.
Let dist(x, y) be the dist... | instruction | 0 | 43,856 | 13 | 87,712 |
No | output | 1 | 43,856 | 13 | 87,713 |
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 exactly of n vertices. Tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a value a_v assigned to it.
Let dist(x, y) be the dist... | instruction | 0 | 43,857 | 13 | 87,714 |
No | output | 1 | 43,857 | 13 | 87,715 |
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 exactly of n vertices. Tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a value a_v assigned to it.
Let dist(x, y) be the dist... | instruction | 0 | 43,858 | 13 | 87,716 |
No | output | 1 | 43,858 | 13 | 87,717 |
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 exactly of n vertices. Tree is a connected undirected graph with n-1 edges. Each vertex v of this tree has a value a_v assigned to it.
Let dist(x, y) be the dist... | instruction | 0 | 43,859 | 13 | 87,718 |
No | output | 1 | 43,859 | 13 | 87,719 |
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 with n nodes and q queries.
Every query starts with three integers k, m and r, followed by k nodes of the tree a_1, a_2, …, a_k. To answer a query, assume that the tree is ... | instruction | 0 | 43,860 | 13 | 87,720 |
No | output | 1 | 43,860 | 13 | 87,721 |
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 with n nodes and q queries.
Every query starts with three integers k, m and r, followed by k nodes of the tree a_1, a_2, …, a_k. To answer a query, assume that the tree is ... | instruction | 0 | 43,861 | 13 | 87,722 |
No | output | 1 | 43,861 | 13 | 87,723 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.