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.
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,681 | 13 | 7,362 |
Tags: dp, graphs, shortest paths
Correct Solution:
```
import sys
from array import array # noqa: F401
def input():
return sys.stdin.buffer.readline().decode('utf-8')
n = int(input())
matrix = [array('i', list(map(int, input().split()))) for _ in range(n)]
a = tuple(map(lambda x: int(x) - 1, input().split()))
... | output | 1 | 3,681 | 13 | 7,363 |
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,682 | 13 | 7,364 |
Tags: dp, graphs, shortest paths
Correct Solution:
```
#!/usr/bin/env python3
# from typing import *
import sys
import io
import math
import collections
import decimal
import itertools
import bisect
import heapq
from array import array
def input():
return sys.stdin.readline()[:-1]
# sys.setrecursionlimit(10000... | output | 1 | 3,682 | 13 | 7,365 |
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,683 | 13 | 7,366 |
Tags: dp, graphs, shortest paths
Correct Solution:
```
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
# from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bise... | output | 1 | 3,683 | 13 | 7,367 |
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,684 | 13 | 7,368 |
Tags: dp, graphs, shortest paths
Correct Solution:
```
import sys
from array import array # noqa: F401
def input():
return sys.stdin.buffer.readline().decode('utf-8')
def solve():
n = int(input())
matrix = [array('i', list(map(int, input().split()))) for _ in range(n)]
a = tuple(map(lambda x: int(x... | output | 1 | 3,684 | 13 | 7,369 |
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,685 | 13 | 7,370 |
Tags: dp, graphs, shortest paths
Correct Solution:
```
#!/usr/bin/env python3
# from typing import *
import sys
import io
import math
import collections
import decimal
import itertools
import bisect
import heapq
from array import array
def input():
return sys.stdin.readline()[:-1]
# sys.setrecursionlimit(10000... | output | 1 | 3,685 | 13 | 7,371 |
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,686 | 13 | 7,372 |
Tags: dp, graphs, shortest paths
Correct Solution:
```
import sys
from array import array # noqa: F401
def input():
return sys.stdin.buffer.readline().decode('utf-8')
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()))... | output | 1 | 3,686 | 13 | 7,373 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
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... | instruction | 0 | 3,687 | 13 | 7,374 |
No | output | 1 | 3,687 | 13 | 7,375 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
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... | instruction | 0 | 3,688 | 13 | 7,376 |
No | output | 1 | 3,688 | 13 | 7,377 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
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... | instruction | 0 | 3,689 | 13 | 7,378 |
No | output | 1 | 3,689 | 13 | 7,379 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Xenia the programmer has a tree consisting of n nodes. We will consider the tree nodes indexed from 1 to n. We will also consider the first node to be initially painted red, and the other nodes — to be painted blue.
The distance between two... | instruction | 0 | 3,690 | 13 | 7,380 |
Tags: data structures, divide and conquer, trees
Correct Solution:
```
class CentroidDecomposition():
def __init__(self, g):
self.g = g
self.n = len(g)
self.parent = [-1]*self.n
self.size = [1]*self.n
self.cdparent = [-1]*self.n
self.cddepth = [0]*self.n
self... | output | 1 | 3,690 | 13 | 7,381 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Xenia the programmer has a tree consisting of n nodes. We will consider the tree nodes indexed from 1 to n. We will also consider the first node to be initially painted red, and the other nodes — to be painted blue.
The distance between two... | instruction | 0 | 3,691 | 13 | 7,382 |
Tags: data structures, divide and conquer, trees
Correct Solution:
```
n,m=map(int,input().split())
tr=[set() for i in range(n+1)]
trr=[[] for i in range(n+1)]
for _ in range(n-1):
a,b=map(int,input().split())
trr[a].append(b);trr[b].append(a)
tr[a].add(b);tr[b].add(a)
euler=[]
disc=[-1 for i in range(n+1)]
hei=... | output | 1 | 3,691 | 13 | 7,383 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Xenia the programmer has a tree consisting of n nodes. We will consider the tree nodes indexed from 1 to n. We will also consider the first node to be initially painted red, and the other nodes — to be painted blue.
The distance between two... | instruction | 0 | 3,692 | 13 | 7,384 |
Tags: data structures, divide and conquer, trees
Correct Solution:
```
class Tree():
def __init__(self, n):
self.n = n
self.tree = [[] for _ in range(n)]
self.root = None
def add_edge(self, u, v):
self.tree[u].append(v)
self.tree[v].append(u)
def set_root(self, r=0)... | output | 1 | 3,692 | 13 | 7,385 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Xenia the programmer has a tree consisting of n nodes. We will consider the tree nodes indexed from 1 to n. We will also consider the first node to be initially painted red, and the other nodes — to be painted blue.
The distance between two... | instruction | 0 | 3,693 | 13 | 7,386 |
Tags: data structures, divide and conquer, trees
Correct Solution:
```
class CentroidDecomposition():
def __init__(self, g):
self.g = g
self.n = len(g)
self.parent = [-1]*self.n
self.size = [1]*self.n
self.cdparent = [-1]*self.n
self.cddepth = [0]*self.n
self... | output | 1 | 3,693 | 13 | 7,387 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Xenia the programmer has a tree consisting of n nodes. We will consider the tree nodes indexed from 1 to n. We will also consider the first node to be initially painted red, and the other nodes ... | instruction | 0 | 3,694 | 13 | 7,388 |
No | output | 1 | 3,694 | 13 | 7,389 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Xenia the programmer has a tree consisting of n nodes. We will consider the tree nodes indexed from 1 to n. We will also consider the first node to be initially painted red, and the other nodes ... | instruction | 0 | 3,695 | 13 | 7,390 |
No | output | 1 | 3,695 | 13 | 7,391 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Xenia the programmer has a tree consisting of n nodes. We will consider the tree nodes indexed from 1 to n. We will also consider the first node to be initially painted red, and the other nodes ... | instruction | 0 | 3,696 | 13 | 7,392 |
No | output | 1 | 3,696 | 13 | 7,393 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Xenia the programmer has a tree consisting of n nodes. We will consider the tree nodes indexed from 1 to n. We will also consider the first node to be initially painted red, and the other nodes ... | instruction | 0 | 3,697 | 13 | 7,394 |
No | output | 1 | 3,697 | 13 | 7,395 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A tree is an undirected connected graph without cycles.
Let's consider a rooted undirected tree with n vertices, numbered 1 through n. There are many ways to represent such a tree. One way is to create an array with n integers p1, p2, ..., ... | instruction | 0 | 3,812 | 13 | 7,624 |
Tags: constructive algorithms, dfs and similar, dsu, graphs, trees
Correct Solution:
```
from collections import deque
# Para revisar la correctitud pueden probar el codigo en el codeforce que va a dar accepted
# ver si hay un camino que llega a el a partir
# de su padre entonces hay un ciclo
def Padre(x, padre):
... | output | 1 | 3,812 | 13 | 7,625 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A tree is an undirected connected graph without cycles.
Let's consider a rooted undirected tree with n vertices, numbered 1 through n. There are many ways to represent such a tree. One way is to create an array with n integers p1, p2, ..., ... | instruction | 0 | 3,813 | 13 | 7,626 |
Tags: constructive algorithms, dfs and similar, dsu, graphs, trees
Correct Solution:
```
import math,sys,bisect,heapq
from collections import defaultdict,Counter,deque
from itertools import groupby,accumulate
#sys.setrecursionlimit(200000000)
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
ilele = ... | output | 1 | 3,813 | 13 | 7,627 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A tree is an undirected connected graph without cycles.
Let's consider a rooted undirected tree with n vertices, numbered 1 through n. There are many ways to represent such a tree. One way is to create an array with n integers p1, p2, ..., ... | instruction | 0 | 3,814 | 13 | 7,628 |
Tags: constructive algorithms, dfs and similar, dsu, graphs, trees
Correct Solution:
```
n = int(input())
par = [int(x)-1 for x in input().split()]
assert len(par) == n
changes = 0
root = -1
for i, p in enumerate(par):
if i == p:
root = i
break
# possibly cycles, 0-n roots, possibly still root ==... | output | 1 | 3,814 | 13 | 7,629 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A tree is an undirected connected graph without cycles.
Let's consider a rooted undirected tree with n vertices, numbered 1 through n. There are many ways to represent such a tree. One way is to create an array with n integers p1, p2, ..., ... | instruction | 0 | 3,815 | 13 | 7,630 |
Tags: constructive algorithms, dfs and similar, dsu, graphs, trees
Correct Solution:
```
# [https://codeforces.com/contest/698/submission/42129034]
input()
A = list(map(int, input().split(' ')))
root = -1
for i,a in enumerate(A) :
if i == a-1 :
root = i
break
v = [False]*len(A)
if root>-1 :... | output | 1 | 3,815 | 13 | 7,631 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A tree is an undirected connected graph without cycles.
Let's consider a rooted undirected tree with n vertices, numbered 1 through n. There are many ways to represent such a tree. One way is to create an array with n integers p1, p2, ..., ... | instruction | 0 | 3,816 | 13 | 7,632 |
Tags: constructive algorithms, dfs and similar, dsu, graphs, trees
Correct Solution:
```
from collections import deque
# ver si hay un camino que llega a el a partir
# de su padre entonces hay un ciclo
def Padre(x, P):
while x != P[x]:
x = P[x]
return x
def Solucion():
P = [None]*n
for i ... | output | 1 | 3,816 | 13 | 7,633 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A tree is an undirected connected graph without cycles.
Let's consider a rooted undirected tree with n vertices, numbered 1 through n. There are many ways to represent such a tree. One way is to create an array with n integers p1, p2, ..., ... | instruction | 0 | 3,817 | 13 | 7,634 |
Tags: constructive algorithms, dfs and similar, dsu, graphs, trees
Correct Solution:
```
input()
A = list(map(int, input().split(' ')))
root = -1
for i,a in enumerate(A) :
if i == a-1 :
root = i
break
v = [False]*len(A)
if root>-1 :
v[root]=True
changed = 0
for i,a in enumerate(A) ... | output | 1 | 3,817 | 13 | 7,635 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A tree is an undirected connected graph without cycles.
Let's consider a rooted undirected tree with n vertices, numbered 1 through n. There are many ways to represent such a tree. One way is to create an array with n integers p1, p2, ..., ... | instruction | 0 | 3,818 | 13 | 7,636 |
Tags: constructive algorithms, dfs and similar, dsu, graphs, trees
Correct Solution:
```
class DSU(object):
def __init__(self, n):
self.p = list(range(n))
self.rk = [0] * n
def find(self, u):
while u != self.p[u]:
u = self.p[u]
return u
def unite(self, u, v):
... | output | 1 | 3,818 | 13 | 7,637 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A tree is an undirected connected graph without cycles.
Let's consider a rooted undirected tree with n vertices, numbered 1 through n. There are many ways to represent such a tree. One way is to create an array with n integers p1, p2, ..., ... | instruction | 0 | 3,819 | 13 | 7,638 |
Tags: constructive algorithms, dfs and similar, dsu, graphs, trees
Correct Solution:
```
# Why do we fall ? So we can learn to pick ourselves up.
root = -1
def find(i,time):
parent[i] = time
while not parent[aa[i]]:
i = aa[i]
parent[i] = time
# print(parent,"in",i)
if parent[aa[i]... | output | 1 | 3,819 | 13 | 7,639 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A tree is an undirected connected graph without cycles.
Let's consider a rooted undirected tree with n vertices, numbered 1 through n. There are many ways to represent such a tree. One way is t... | instruction | 0 | 3,820 | 13 | 7,640 |
Yes | output | 1 | 3,820 | 13 | 7,641 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A tree is an undirected connected graph without cycles.
Let's consider a rooted undirected tree with n vertices, numbered 1 through n. There are many ways to represent such a tree. One way is t... | instruction | 0 | 3,821 | 13 | 7,642 |
Yes | output | 1 | 3,821 | 13 | 7,643 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A tree is an undirected connected graph without cycles.
Let's consider a rooted undirected tree with n vertices, numbered 1 through n. There are many ways to represent such a tree. One way is t... | instruction | 0 | 3,822 | 13 | 7,644 |
Yes | output | 1 | 3,822 | 13 | 7,645 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A tree is an undirected connected graph without cycles.
Let's consider a rooted undirected tree with n vertices, numbered 1 through n. There are many ways to represent such a tree. One way is t... | instruction | 0 | 3,823 | 13 | 7,646 |
Yes | output | 1 | 3,823 | 13 | 7,647 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A tree is an undirected connected graph without cycles.
Let's consider a rooted undirected tree with n vertices, numbered 1 through n. There are many ways to represent such a tree. One way is t... | instruction | 0 | 3,824 | 13 | 7,648 |
No | output | 1 | 3,824 | 13 | 7,649 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A tree is an undirected connected graph without cycles.
Let's consider a rooted undirected tree with n vertices, numbered 1 through n. There are many ways to represent such a tree. One way is t... | instruction | 0 | 3,825 | 13 | 7,650 |
No | output | 1 | 3,825 | 13 | 7,651 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A tree is an undirected connected graph without cycles.
Let's consider a rooted undirected tree with n vertices, numbered 1 through n. There are many ways to represent such a tree. One way is t... | instruction | 0 | 3,826 | 13 | 7,652 |
No | output | 1 | 3,826 | 13 | 7,653 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A tree is an undirected connected graph without cycles.
Let's consider a rooted undirected tree with n vertices, numbered 1 through n. There are many ways to represent such a tree. One way is t... | instruction | 0 | 3,827 | 13 | 7,654 |
No | output | 1 | 3,827 | 13 | 7,655 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given an undirected tree of n vertices.
Some vertices are colored blue, some are colored red and some are uncolored. It is guaranteed that the tree contains at least one red vertex and at least one blue vertex.
You choose an edge ... | instruction | 0 | 4,189 | 13 | 8,378 |
Tags: dfs and similar, trees
Correct Solution:
```
import sys
input=sys.stdin.readline
n = int(input())
a = [int(t) for t in input().split(' ')]
mx = [[] for _ in range(n)]
for i in range(n-1):
v1, v2 = map(int,input().split())
mx[v1-1].append(v2-1)
mx[v2-1].append(v1-1)
count = [[0, 0] for _ in range(n)]
t... | output | 1 | 4,189 | 13 | 8,379 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given an undirected tree of n vertices.
Some vertices are colored blue, some are colored red and some are uncolored. It is guaranteed that the tree contains at least one red vertex and at least one blue vertex.
You choose an edge ... | instruction | 0 | 4,190 | 13 | 8,380 |
Tags: dfs and similar, trees
Correct Solution:
```
import sys
n = int(input())
a = [int(t) for t in input().split(' ')]
mx = [[] for _ in range(n)]
lines = sys.stdin.readlines()
for i in range(n-1):
v1, v2 = (int(t) - 1 for t in lines[i].split(' '))
mx[v1].append(v2)
mx[v2].append(v1)
count = [[0, 0] fo... | output | 1 | 4,190 | 13 | 8,381 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given an undirected tree of n vertices.
Some vertices are colored blue, some are colored red and some are uncolored. It is guaranteed that the tree contains at least one red vertex and at least one blue vertex.
You choose an edge ... | instruction | 0 | 4,191 | 13 | 8,382 |
Tags: dfs and similar, trees
Correct Solution:
```
#!/usr/bin/env python3
"""
This file is part of https://github.com/cheran-senthil/PyRival
Copyright 2019 Cheran Senthilkumar <hello@cheran.io>
"""
import os
import sys
from atexit import register
from io import BytesIO
input = BytesIO(os.read(0, os.fstat(0).st_size))... | output | 1 | 4,191 | 13 | 8,383 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given an undirected tree of n vertices.
Some vertices are colored blue, some are colored red and some are uncolored. It is guaranteed that the tree contains at least one red vertex and at least one blue vertex.
You choose an edge ... | instruction | 0 | 4,192 | 13 | 8,384 |
Tags: dfs and similar, trees
Correct Solution:
```
from sys import stdin,stdout
from collections import *
from math import gcd,floor,ceil
st=lambda:list(stdin.readline().strip())
li=lambda:list(map(int,stdin.readline().split()))
mp=lambda:map(int,stdin.readline().split())
inp=lambda:int(stdin.readline())
pr=lambda n:... | output | 1 | 4,192 | 13 | 8,385 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given an undirected tree of n vertices.
Some vertices are colored blue, some are colored red and some are uncolored. It is guaranteed that the tree contains at least one red vertex and at least one blue vertex.
You choose an edge ... | instruction | 0 | 4,193 | 13 | 8,386 |
Tags: dfs and similar, trees
Correct Solution:
```
import os
import sys
from io import BytesIO, IOBase
from collections import defaultdict, deque, Counter, OrderedDict
import threading
def main():
n = int(input())
a = [0]+[*map(int,input().split())]
adj = [[] for _ in range(n+1)]
for i in range(n-1):
... | output | 1 | 4,193 | 13 | 8,387 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given an undirected tree of n vertices.
Some vertices are colored blue, some are colored red and some are uncolored. It is guaranteed that the tree contains at least one red vertex and at least one blue vertex.
You choose an edge ... | instruction | 0 | 4,194 | 13 | 8,388 |
Tags: dfs and similar, trees
Correct Solution:
```
# by the authority of GOD author: manhar singh sachdev #
import os,sys
from io import BytesIO,IOBase
def main():
n = int(input())
a = list(map(int,input().split()))
red = a.count(1)
blue = a.count(2)
path = [[] for _ in range(n+1)]
for _ i... | output | 1 | 4,194 | 13 | 8,389 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given an undirected tree of n vertices.
Some vertices are colored blue, some are colored red and some are uncolored. It is guaranteed that the tree contains at least one red vertex and at least one blue vertex.
You choose an edge ... | instruction | 0 | 4,195 | 13 | 8,390 |
Tags: dfs and similar, trees
Correct Solution:
```
from collections import deque
import sys
input = sys.stdin.readline
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 = [[] for i in range(n)]
self.parent = [-1 for i in ran... | output | 1 | 4,195 | 13 | 8,391 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given an undirected tree of n vertices.
Some vertices are colored blue, some are colored red and some are uncolored. It is guaranteed that the tree contains at least one red vertex and at least one blue vertex.
You choose an edge ... | instruction | 0 | 4,196 | 13 | 8,392 |
Tags: dfs and similar, trees
Correct Solution:
```
import os, sys
from io import IOBase, BytesIO
py2 = round(0.5)
if py2:
from future_builtins import ascii, filter, hex, map, oct, zip
range = xrange
BUFSIZE = 8192
class FastIO(BytesIO):
newlines = 0
def __init__(self, file):
self._file = file
... | output | 1 | 4,196 | 13 | 8,393 |
Provide tags and a correct Python 2 solution for this coding contest problem.
You are given an undirected tree of n vertices.
Some vertices are colored blue, some are colored red and some are uncolored. It is guaranteed that the tree contains at least one red vertex and at least one blue vertex.
You choose an edge ... | instruction | 0 | 4,197 | 13 | 8,394 |
Tags: dfs and similar, trees
Correct Solution:
```
from sys import stdin, stdout
from collections import Counter, defaultdict
raw_input = stdin.readline
pr = stdout.write
def in_arr():
return map(int,raw_input().split())
def pr_num(n):
stdout.write(str(n)+'\n')
def pr_arr(arr):
for i in arr:
s... | output | 1 | 4,197 | 13 | 8,395 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given an undirected tree of n vertices.
Some vertices are colored blue, some are colored red and some are uncolored. It is guaranteed that the tree contains at least one red vertex and... | instruction | 0 | 4,198 | 13 | 8,396 |
Yes | output | 1 | 4,198 | 13 | 8,397 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given an undirected tree of n vertices.
Some vertices are colored blue, some are colored red and some are uncolored. It is guaranteed that the tree contains at least one red vertex and... | instruction | 0 | 4,199 | 13 | 8,398 |
Yes | output | 1 | 4,199 | 13 | 8,399 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given an undirected tree of n vertices.
Some vertices are colored blue, some are colored red and some are uncolored. It is guaranteed that the tree contains at least one red vertex and... | instruction | 0 | 4,200 | 13 | 8,400 |
Yes | output | 1 | 4,200 | 13 | 8,401 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given an undirected tree of n vertices.
Some vertices are colored blue, some are colored red and some are uncolored. It is guaranteed that the tree contains at least one red vertex and... | instruction | 0 | 4,201 | 13 | 8,402 |
Yes | output | 1 | 4,201 | 13 | 8,403 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given an undirected tree of n vertices.
Some vertices are colored blue, some are colored red and some are uncolored. It is guaranteed that the tree contains at least one red vertex and... | instruction | 0 | 4,202 | 13 | 8,404 |
No | output | 1 | 4,202 | 13 | 8,405 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given an undirected tree of n vertices.
Some vertices are colored blue, some are colored red and some are uncolored. It is guaranteed that the tree contains at least one red vertex and... | instruction | 0 | 4,203 | 13 | 8,406 |
No | output | 1 | 4,203 | 13 | 8,407 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given an undirected tree of n vertices.
Some vertices are colored blue, some are colored red and some are uncolored. It is guaranteed that the tree contains at least one red vertex and... | instruction | 0 | 4,204 | 13 | 8,408 |
No | output | 1 | 4,204 | 13 | 8,409 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given an undirected tree of n vertices.
Some vertices are colored blue, some are colored red and some are uncolored. It is guaranteed that the tree contains at least one red vertex and... | instruction | 0 | 4,205 | 13 | 8,410 |
No | output | 1 | 4,205 | 13 | 8,411 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.