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 a correct Python 3 solution for this coding contest problem.
There is a tree with N vertices, numbered 1 through N.
The i-th of the N-1 edges connects the vertices p_i and q_i.
Among the sequences of distinct vertices v_1, v_2, ..., v_M that satisfy the following condition, find the maximum value of M.
* Fo... | instruction | 0 | 12,387 | 13 | 24,774 |
"Correct Solution:
```
import sys
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)
"""
・次数3以上の点は使わないとしてよい
・次数1の点は全て回収できる。次数2の点を、パスとなる形で回収する。
"""
N = int(readline())
PQ = [tuple(int(x)-1 for x in line.split()) for line in readlines()]
graph = [[] for _ in range(N)]
for p,q ... | output | 1 | 12,387 | 13 | 24,775 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a tree with N vertices, numbered 1 through N.
The i-th of the N-1 edges connects the vertices p_i and q_i.
Among the sequences of distinct vertices v_1, v_2, ..., v_M that satisfy the... | instruction | 0 | 12,388 | 13 | 24,776 |
No | output | 1 | 12,388 | 13 | 24,777 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a tree with N vertices, numbered 1 through N.
The i-th of the N-1 edges connects the vertices p_i and q_i.
Among the sequences of distinct vertices v_1, v_2, ..., v_M that satisfy the... | instruction | 0 | 12,389 | 13 | 24,778 |
No | output | 1 | 12,389 | 13 | 24,779 |
Provide a correct Python 3 solution for this coding contest problem.
Problem statement
Modulo is very good at drawing trees.
Over the years, Modulo has drawn a picture of a tree with $ N $ vertices. The vertices of this tree are numbered from $ 1 $ to $ N $, and the vertices $ a_i $ and $ b_i $$ (1 \ leq i \ leq N-1... | instruction | 0 | 12,451 | 13 | 24,902 |
"Correct Solution:
```
import sys
from collections import deque
readline = sys.stdin.readline
def parorder(Edge, p):
N = len(Edge)
par = [0]*N
par[p] = -1
stack = [p]
order = []
visited = set([p])
ast = stack.append
apo = order.append
while stack:
vn = stack.pop()
ap... | output | 1 | 12,451 | 13 | 24,903 |
Provide a correct Python 3 solution for this coding contest problem.
Write a program which manipulates a weighted rooted tree $T$ with the following operations:
* $add(v,w)$: add $w$ to the edge which connects node $v$ and its parent
* $getSum(u)$: report the sum of weights of all edges from the root to node $u$
... | instruction | 0 | 12,452 | 13 | 24,904 |
"Correct Solution:
```
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(1000000)
class weightRtree:
def __init__(self, num):
self.num = num
self.weight = [0] * (num+1)
def add(self, v, w):
if v == 0:
return 0
while v <= self.num:
self.weig... | output | 1 | 12,452 | 13 | 24,905 |
Provide a correct Python 3 solution for this coding contest problem.
Write a program which manipulates a weighted rooted tree $T$ with the following operations:
* $add(v,w)$: add $w$ to the edge which connects node $v$ and its parent
* $getSum(u)$: report the sum of weights of all edges from the root to node $u$
... | instruction | 0 | 12,453 | 13 | 24,906 |
"Correct Solution:
```
import sys
sys.setrecursionlimit(200000)
class BIT(object):
def __init__(self, n: int) -> None:
self.n = n
self.data = [0] * (n + 1)
def get_sum(self, i: int) -> int:
ret = 0
while i > 0:
ret += self.data[i]
i -= (i & -i)
... | output | 1 | 12,453 | 13 | 24,907 |
Provide a correct Python 3 solution for this coding contest problem.
Write a program which manipulates a weighted rooted tree $T$ with the following operations:
* $add(v,w)$: add $w$ to the edge which connects node $v$ and its parent
* $getSum(u)$: report the sum of weights of all edges from the root to node $u$
... | instruction | 0 | 12,454 | 13 | 24,908 |
"Correct Solution:
```
import sys
sys.setrecursionlimit(1000000)
# The class of range query on a Tree
class RQT:
# The initialization of node
def __init__(self, num):
self.num = num
self.weight = [0] * (num + 1)
# weight add operation
def add(self, v, w):
if v == 0:
... | output | 1 | 12,454 | 13 | 24,909 |
Provide a correct Python 3 solution for this coding contest problem.
Write a program which manipulates a weighted rooted tree $T$ with the following operations:
* $add(v,w)$: add $w$ to the edge which connects node $v$ and its parent
* $getSum(u)$: report the sum of weights of all edges from the root to node $u$
... | instruction | 0 | 12,455 | 13 | 24,910 |
"Correct Solution:
```
#!/usr/bin/env python3
# GRL_5_D: Tree - Range Query on Tree
# Eular Tour Technique
# DFSの結果でサブツリーの範囲がわかるので、range add queryを利用して
# add/getを行う
class Edge:
__slots__ = ('v', 'w')
def __init__(self, v, w):
self.v = v
self.w = w
def either(self):
return self.v
... | output | 1 | 12,455 | 13 | 24,911 |
Provide a correct Python 3 solution for this coding contest problem.
Write a program which manipulates a weighted rooted tree $T$ with the following operations:
* $add(v,w)$: add $w$ to the edge which connects node $v$ and its parent
* $getSum(u)$: report the sum of weights of all edges from the root to node $u$
... | instruction | 0 | 12,456 | 13 | 24,912 |
"Correct Solution:
```
#!/usr/bin/env python3
# GRL_5_D: Tree - Range Query on Tree
class Edge:
__slots__ = ('v', 'w')
def __init__(self, v, w):
self.v = v
self.w = w
def either(self):
return self.v
def other(self, v):
if v == self.v:
return self.w
... | output | 1 | 12,456 | 13 | 24,913 |
Provide a correct Python 3 solution for this coding contest problem.
Write a program which manipulates a weighted rooted tree $T$ with the following operations:
* $add(v,w)$: add $w$ to the edge which connects node $v$ and its parent
* $getSum(u)$: report the sum of weights of all edges from the root to node $u$
... | instruction | 0 | 12,457 | 13 | 24,914 |
"Correct Solution:
```
import sys
sys.setrecursionlimit(int(1e6))
class BIT:
def __init__(self, n):
self.n = n
self.data = [0] * (n + 1)
def get_sum(self, i):
ret = 0
while i > 0:
ret += self.data[i]
i -= (i & -i)
return ret
def add(self, i, w):
if i == 0:
return
while i <= self.n:
sel... | output | 1 | 12,457 | 13 | 24,915 |
Provide a correct Python 3 solution for this coding contest problem.
Write a program which manipulates a weighted rooted tree $T$ with the following operations:
* $add(v,w)$: add $w$ to the edge which connects node $v$ and its parent
* $getSum(u)$: report the sum of weights of all edges from the root to node $u$
... | instruction | 0 | 12,458 | 13 | 24,916 |
"Correct Solution:
```
from collections import deque
import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
write = sys.stdout.write
N = int(readline())
G = [None]*N
for i in range(N):
k, *c = map(int, readline().split())
G[i] = c
H = [0]*N
prv = [None]*N
def dfs(v):
s = 1; heavy = None; m ... | output | 1 | 12,458 | 13 | 24,917 |
Provide a correct Python 3 solution for this coding contest problem.
Write a program which manipulates a weighted rooted tree $T$ with the following operations:
* $add(v,w)$: add $w$ to the edge which connects node $v$ and its parent
* $getSum(u)$: report the sum of weights of all edges from the root to node $u$
... | instruction | 0 | 12,459 | 13 | 24,918 |
"Correct Solution:
```
import sys
sys.setrecursionlimit(int(1e6))
class B_I_T:
def __init__(self, n):
self.n = n
self.data = [0] * (n + 1)
def get_sum(self, i):
ret = 0
while i > 0:
ret += self.data[i]
i -= (i & -i)
return ret
def add... | output | 1 | 12,459 | 13 | 24,919 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which manipulates a weighted rooted tree $T$ with the following operations:
* $add(v,w)$: add $w$ to the edge which connects node $v$ and its parent
* $getSum(u)$: report the s... | instruction | 0 | 12,460 | 13 | 24,920 |
Yes | output | 1 | 12,460 | 13 | 24,921 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which manipulates a weighted rooted tree $T$ with the following operations:
* $add(v,w)$: add $w$ to the edge which connects node $v$ and its parent
* $getSum(u)$: report the s... | instruction | 0 | 12,461 | 13 | 24,922 |
Yes | output | 1 | 12,461 | 13 | 24,923 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which manipulates a weighted rooted tree $T$ with the following operations:
* $add(v,w)$: add $w$ to the edge which connects node $v$ and its parent
* $getSum(u)$: report the s... | instruction | 0 | 12,462 | 13 | 24,924 |
Yes | output | 1 | 12,462 | 13 | 24,925 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which manipulates a weighted rooted tree $T$ with the following operations:
* $add(v,w)$: add $w$ to the edge which connects node $v$ and its parent
* $getSum(u)$: report the s... | instruction | 0 | 12,463 | 13 | 24,926 |
No | output | 1 | 12,463 | 13 | 24,927 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which manipulates a weighted rooted tree $T$ with the following operations:
* $add(v,w)$: add $w$ to the edge which connects node $v$ and its parent
* $getSum(u)$: report the s... | instruction | 0 | 12,464 | 13 | 24,928 |
No | output | 1 | 12,464 | 13 | 24,929 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which manipulates a weighted rooted tree $T$ with the following operations:
* $add(v,w)$: add $w$ to the edge which connects node $v$ and its parent
* $getSum(u)$: report the s... | instruction | 0 | 12,465 | 13 | 24,930 |
No | output | 1 | 12,465 | 13 | 24,931 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which manipulates a weighted rooted tree $T$ with the following operations:
* $add(v,w)$: add $w$ to the edge which connects node $v$ and its parent
* $getSum(u)$: report the s... | instruction | 0 | 12,466 | 13 | 24,932 |
No | output | 1 | 12,466 | 13 | 24,933 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Every person likes prime numbers. Alice is a person, thus she also shares the love for them. Bob wanted to give her an affectionate gift but couldn't think of anything inventive. Hence, he will be giving her a graph. How original, Bob! Alice... | instruction | 0 | 12,521 | 13 | 25,042 |
Tags: constructive algorithms, greedy, math, number theory
Correct Solution:
```
n = int(input())
odp = []
for i in range(n - 1):
odp.append([i + 1, i + 2])
odp.append([n, 1])
k = n
def prime(x):
i = 2
while i ** 2 <= x:
if x % i == 0:
return False
i += 1
return True
primes = [0] * 50000
for i in range(50000... | output | 1 | 12,521 | 13 | 25,043 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Every person likes prime numbers. Alice is a person, thus she also shares the love for them. Bob wanted to give her an affectionate gift but couldn't think of anything inventive. Hence, he will be giving her a graph. How original, Bob! Alice... | instruction | 0 | 12,522 | 13 | 25,044 |
Tags: constructive algorithms, greedy, math, number theory
Correct Solution:
```
import sys
read = lambda: sys.stdin.readline().strip()
readi = lambda: map(int, read().split())
from collections import *
n = int(read())
nearestPrime = None
for i in range(n, 1010):
for j in range(2, int(i**0.5)+1):
if i % ... | output | 1 | 12,522 | 13 | 25,045 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Every person likes prime numbers. Alice is a person, thus she also shares the love for them. Bob wanted to give her an affectionate gift but couldn't think of anything inventive. Hence, he will be giving her a graph. How original, Bob! Alice... | instruction | 0 | 12,523 | 13 | 25,046 |
Tags: constructive algorithms, greedy, math, number theory
Correct Solution:
```
from bisect import *
l = [3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, ... | output | 1 | 12,523 | 13 | 25,047 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Every person likes prime numbers. Alice is a person, thus she also shares the love for them. Bob wanted to give her an affectionate gift but couldn't think of anything inventive. Hence, he will be giving her a graph. How original, Bob! Alice... | instruction | 0 | 12,524 | 13 | 25,048 |
Tags: constructive algorithms, greedy, math, number theory
Correct Solution:
```
prost = [3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 24... | output | 1 | 12,524 | 13 | 25,049 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Every person likes prime numbers. Alice is a person, thus she also shares the love for them. Bob wanted to give her an affectionate gift but couldn't think of anything inventive. Hence, he will be giving her a graph. How original, Bob! Alice... | instruction | 0 | 12,525 | 13 | 25,050 |
Tags: constructive algorithms, greedy, math, number theory
Correct Solution:
```
import bisect
import decimal
from decimal import Decimal
import os
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq
from math import sqrt
import sys
from functools im... | output | 1 | 12,525 | 13 | 25,051 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Every person likes prime numbers. Alice is a person, thus she also shares the love for them. Bob wanted to give her an affectionate gift but couldn't think of anything inventive. Hence, he will be giving her a graph. How original, Bob! Alice... | instruction | 0 | 12,526 | 13 | 25,052 |
Tags: constructive algorithms, greedy, math, number theory
Correct Solution:
```
prime=[True]*1501
prime[0]=False
prime[1]=False
for i in range(2,1501):
if prime[i]:
for j in range(i*i,1501,i):
prime[j]=False
n=int(input())
degree=[2]*n
ans=[]
edges=n
for i in range(n-1):
ans.append([i+1,i+2])
ans.append([1,n])
... | output | 1 | 12,526 | 13 | 25,053 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Every person likes prime numbers. Alice is a person, thus she also shares the love for them. Bob wanted to give her an affectionate gift but couldn't think of anything inventive. Hence, he will be giving her a graph. How original, Bob! Alice... | instruction | 0 | 12,527 | 13 | 25,054 |
Tags: constructive algorithms, greedy, math, number theory
Correct Solution:
```
import math
n = int(input())
def isPrime(x):
if x in [2, 3, 5, 7]:
return True
if x == 1:
return False
for i in range(2, int(math.sqrt(x)) + 1):
if x % i == 0:
return False
return True
an... | output | 1 | 12,527 | 13 | 25,055 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Every person likes prime numbers. Alice is a person, thus she also shares the love for them. Bob wanted to give her an affectionate gift but couldn't think of anything inventive. Hence, he will be giving her a graph. How original, Bob! Alice... | instruction | 0 | 12,528 | 13 | 25,056 |
Tags: constructive algorithms, greedy, math, number theory
Correct Solution:
```
from sys import stdin,stdout,setrecursionlimit
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush,nlargest
from math import *
from collections import defaultdict as dd, deque, Counter as C
from ... | output | 1 | 12,528 | 13 | 25,057 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Every person likes prime numbers. Alice is a person, thus she also shares the love for them. Bob wanted to give her an affectionate gift but couldn't think of anything inventive. Hence, he will ... | instruction | 0 | 12,529 | 13 | 25,058 |
Yes | output | 1 | 12,529 | 13 | 25,059 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Every person likes prime numbers. Alice is a person, thus she also shares the love for them. Bob wanted to give her an affectionate gift but couldn't think of anything inventive. Hence, he will ... | instruction | 0 | 12,530 | 13 | 25,060 |
Yes | output | 1 | 12,530 | 13 | 25,061 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Every person likes prime numbers. Alice is a person, thus she also shares the love for them. Bob wanted to give her an affectionate gift but couldn't think of anything inventive. Hence, he will ... | instruction | 0 | 12,531 | 13 | 25,062 |
Yes | output | 1 | 12,531 | 13 | 25,063 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Every person likes prime numbers. Alice is a person, thus she also shares the love for them. Bob wanted to give her an affectionate gift but couldn't think of anything inventive. Hence, he will ... | instruction | 0 | 12,532 | 13 | 25,064 |
Yes | output | 1 | 12,532 | 13 | 25,065 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Every person likes prime numbers. Alice is a person, thus she also shares the love for them. Bob wanted to give her an affectionate gift but couldn't think of anything inventive. Hence, he will ... | instruction | 0 | 12,533 | 13 | 25,066 |
No | output | 1 | 12,533 | 13 | 25,067 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Every person likes prime numbers. Alice is a person, thus she also shares the love for them. Bob wanted to give her an affectionate gift but couldn't think of anything inventive. Hence, he will ... | instruction | 0 | 12,534 | 13 | 25,068 |
No | output | 1 | 12,534 | 13 | 25,069 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Every person likes prime numbers. Alice is a person, thus she also shares the love for them. Bob wanted to give her an affectionate gift but couldn't think of anything inventive. Hence, he will ... | instruction | 0 | 12,535 | 13 | 25,070 |
No | output | 1 | 12,535 | 13 | 25,071 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Every person likes prime numbers. Alice is a person, thus she also shares the love for them. Bob wanted to give her an affectionate gift but couldn't think of anything inventive. Hence, he will ... | instruction | 0 | 12,536 | 13 | 25,072 |
No | output | 1 | 12,536 | 13 | 25,073 |
Provide tags and a correct Python 3 solution for this coding contest problem.
We had a really tough time generating tests for problem D. In order to prepare strong tests, we had to solve the following problem.
Given an undirected labeled tree consisting of n vertices, find a set of segments such that:
1. both endp... | instruction | 0 | 12,585 | 13 | 25,170 |
Tags: constructive algorithms, dfs and similar, divide and conquer, trees
Correct Solution:
```
def main():
import sys
input = sys.stdin.buffer.readline
N = int(input())
adj = [[] for _ in range(N+1)]
for _ in range(N-1):
a, b = map(int, input().split())
adj[a].append(b)
adj... | output | 1 | 12,585 | 13 | 25,171 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Tree is a connected graph without cycles. A leaf of a tree is any vertex connected with exactly one other vertex.
You are given a tree with n vertices and a root in the vertex 1. There is an ant in each leaf of the tree. In one second some ... | instruction | 0 | 12,923 | 13 | 25,846 |
Tags: dfs and similar, greedy, sortings, trees
Correct Solution:
```
import sys
def main():
n = int(sys.stdin.buffer.readline().decode('utf-8'))
adj = [[] for _ in range(n)]
deg = [0]*n
for u, v in (map(int, line.decode('utf-8').split()) for line in sys.stdin.buffer):
adj[u-1].append(v-1)
... | output | 1 | 12,923 | 13 | 25,847 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Tree is a connected graph without cycles. A leaf of a tree is any vertex connected with exactly one other vertex.
You are given a tree with n vertices and a root in the vertex 1. There is an ant in each leaf of the tree. In one second some ... | instruction | 0 | 12,924 | 13 | 25,848 |
Tags: dfs and similar, greedy, sortings, trees
Correct Solution:
```
import sys
def read_input():
n = int(sys.stdin.buffer.readline().decode('utf-8'))
graph = [[] for _ in range(n)]
tree = [0] * n
for u, v in (map(int, line.decode('utf-8').split()) for line in sys.stdin.buffer):
graph[u-1].appe... | output | 1 | 12,924 | 13 | 25,849 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Tree is a connected graph without cycles. A leaf of a tree is any vertex connected with exactly one other vertex.
You are given a tree with n vertices and a root in the vertex 1. There is an ant in each leaf of the tree. In one second some ... | instruction | 0 | 12,925 | 13 | 25,850 |
Tags: dfs and similar, greedy, sortings, trees
Correct Solution:
```
import sys
n = int(sys.stdin.buffer.readline().decode('utf-8'))
adj = [[] for _ in range(n)]
deg = [0]*n
for u, v in (map(int, line.decode('utf-8').split()) for line in sys.stdin.buffer):
adj[u-1].append(v-1)
adj[v-1].append(u-1)
deg[u-1] ... | output | 1 | 12,925 | 13 | 25,851 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Tree is a connected graph without cycles. A leaf of a tree is any vertex connected with exactly one other vertex.
You are given a tree with n vertices and a root in the vertex 1. There is an ant in each leaf of the tree. In one second some ... | instruction | 0 | 12,926 | 13 | 25,852 |
Tags: dfs and similar, greedy, sortings, trees
Correct Solution:
```
import sys
def read_input():
n = int(sys.stdin.buffer.readline().decode('utf-8'))
graph = [[] for _ in range(n)]
tree = [0] * n
for u, v in (map(int, line.decode('utf-8').split()) for line in sys.stdin.buffer):
graph[u-1].appe... | output | 1 | 12,926 | 13 | 25,853 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Tree is a connected graph without cycles. A leaf of a tree is any vertex connected with exactly one other vertex.
You are given a tree with n vertices and a root in the vertex 1. There is an an... | instruction | 0 | 12,927 | 13 | 25,854 |
No | output | 1 | 12,927 | 13 | 25,855 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Tree is a connected graph without cycles. A leaf of a tree is any vertex connected with exactly one other vertex.
You are given a tree with n vertices and a root in the vertex 1. There is an an... | instruction | 0 | 12,928 | 13 | 25,856 |
No | output | 1 | 12,928 | 13 | 25,857 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Tree is a connected graph without cycles. A leaf of a tree is any vertex connected with exactly one other vertex.
You are given a tree with n vertices and a root in the vertex 1. There is an an... | instruction | 0 | 12,929 | 13 | 25,858 |
No | output | 1 | 12,929 | 13 | 25,859 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Tree is a connected graph without cycles. A leaf of a tree is any vertex connected with exactly one other vertex.
You are given a tree with n vertices and a root in the vertex 1. There is an an... | instruction | 0 | 12,930 | 13 | 25,860 |
No | output | 1 | 12,930 | 13 | 25,861 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
I see a pink boar and I want it painted black. Black boars look much more awesome and mighty than the pink ones. Since Jaggy became the ruler of the forest, he has been trying his best to improv... | instruction | 0 | 12,963 | 13 | 25,926 |
No | output | 1 | 12,963 | 13 | 25,927 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
I see a pink boar and I want it painted black. Black boars look much more awesome and mighty than the pink ones. Since Jaggy became the ruler of the forest, he has been trying his best to improv... | instruction | 0 | 12,964 | 13 | 25,928 |
No | output | 1 | 12,964 | 13 | 25,929 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
I see a pink boar and I want it painted black. Black boars look much more awesome and mighty than the pink ones. Since Jaggy became the ruler of the forest, he has been trying his best to improv... | instruction | 0 | 12,965 | 13 | 25,930 |
No | output | 1 | 12,965 | 13 | 25,931 |
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 T with N vertices and an undirected graph G with N vertices and M edges. The vertices of each graph are numbered 1 to N. The i-th of the N-1 edges in T connects Vertex a_i a... | instruction | 0 | 13,156 | 13 | 26,312 |
No | output | 1 | 13,156 | 13 | 26,313 |
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 T with N vertices and an undirected graph G with N vertices and M edges. The vertices of each graph are numbered 1 to N. The i-th of the N-1 edges in T connects Vertex a_i a... | instruction | 0 | 13,157 | 13 | 26,314 |
No | output | 1 | 13,157 | 13 | 26,315 |
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 T with N vertices and an undirected graph G with N vertices and M edges. The vertices of each graph are numbered 1 to N. The i-th of the N-1 edges in T connects Vertex a_i a... | instruction | 0 | 13,158 | 13 | 26,316 |
No | output | 1 | 13,158 | 13 | 26,317 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.