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.
After Vitaly was expelled from the university, he became interested in the graph theory.
Vitaly especially liked the cycles of an odd length in which each vertex occurs at most once.
Vitaly wa... | instruction | 0 | 93,923 | 13 | 187,846 |
No | output | 1 | 93,923 | 13 | 187,847 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
After Vitaly was expelled from the university, he became interested in the graph theory.
Vitaly especially liked the cycles of an odd length in which each vertex occurs at most once.
Vitaly wa... | instruction | 0 | 93,924 | 13 | 187,848 |
No | output | 1 | 93,924 | 13 | 187,849 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Student Vladislav came to his programming exam completely unprepared as usual. He got a question about some strange algorithm on a graph β something that will definitely never be useful in real life. He asked a girl sitting next to him to le... | instruction | 0 | 93,941 | 13 | 187,882 |
Tags: constructive algorithms, data structures, graphs
Correct Solution:
```
f = lambda: map(int, input().split())
n, m = f()
p = []
for i in range(m):
a, b = f()
p.append((a, 1 - b, i))
p.sort()
k = j = 0
s = [0] * m
u, v = 1, 3
for a, b, i in p:
if not b:
k += j
s[i] = (j + 1, j + 2)
... | output | 1 | 93,941 | 13 | 187,883 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Student Vladislav came to his programming exam completely unprepared as usual. He got a question about some strange algorithm on a graph β something that will definitely never be useful in real life. He asked a girl sitting next to him to le... | instruction | 0 | 93,942 | 13 | 187,884 |
Tags: constructive algorithms, data structures, graphs
Correct Solution:
```
import sys
from operator import itemgetter
lines = sys.stdin.readlines()
n, m = map(int, lines[0].split(' '))
def build_edge(i, row):
parts = row.split(' ')
return (int(parts[0]), int(parts[1]), i)
def edge_key(a):
return (a[0], -a[1])
... | output | 1 | 93,942 | 13 | 187,885 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Student Vladislav came to his programming exam completely unprepared as usual. He got a question about some strange algorithm on a graph β something that will definitely never be useful in real life. He asked a girl sitting next to him to le... | instruction | 0 | 93,943 | 13 | 187,886 |
Tags: constructive algorithms, data structures, graphs
Correct Solution:
```
def read_data():
n, m = map(int, input().split())
ABs = []
for i in range(m):
a, b = map(int, input().split())
ABs.append((a, b))
return n, m, ABs
def solve(n, m, ABs):
edges = [(a, -b, i) for i, (a, b) in ... | output | 1 | 93,943 | 13 | 187,887 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Student Vladislav came to his programming exam completely unprepared as usual. He got a question about some strange algorithm on a graph β something that will definitely never be useful in real life. He asked a girl sitting next to him to le... | instruction | 0 | 93,944 | 13 | 187,888 |
Tags: constructive algorithms, data structures, graphs
Correct Solution:
```
readInts=lambda: list(map(int, input().split()))
n,m=readInts()
edge=[]
for _ in range(m):
l,f=readInts()
if f==1:
f=-1
edge+=[(l,f,_)]
edge.sort()
ok=True
cnt=0;ret=[(0,0)]*m
u=2;v=3;t=2
for e in edge:
if e[1]==-1:
... | output | 1 | 93,944 | 13 | 187,889 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Student Vladislav came to his programming exam completely unprepared as usual. He got a question about some strange algorithm on a graph β something that will definitely never be useful in real life. He asked a girl sitting next to him to le... | instruction | 0 | 93,945 | 13 | 187,890 |
Tags: constructive algorithms, data structures, graphs
Correct Solution:
```
def graph(e):
e = [(w, i, b) for i, (w, b) in enumerate(e)]
e.sort()
g = [None]*len(e)
mst = [(w, i) for w, i, b in e if b]
for n, (w, i) in enumerate(mst, 2):
g[i] = 1, n
cm = 0
available = []
for w... | output | 1 | 93,945 | 13 | 187,891 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Student Vladislav came to his programming exam completely unprepared as usual. He got a question about some strange algorithm on a graph β something that will definitely never be useful in real life. He asked a girl sitting next to him to le... | instruction | 0 | 93,946 | 13 | 187,892 |
Tags: constructive algorithms, data structures, graphs
Correct Solution:
```
def main():
n, m = map(int, input().split())
tmp = ([], [])
for i in range(m):
a, b = input().split()
tmp[b == "1"].append((int(a), i))
for l in tmp:
l.sort()
additional, spanning = tmp
tmp = []
... | output | 1 | 93,946 | 13 | 187,893 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Student Vladislav came to his programming exam completely unprepared as usual. He got a question about some strange algorithm on a graph β something that will definitely never be useful in real life. He asked a girl sitting next to him to le... | instruction | 0 | 93,947 | 13 | 187,894 |
Tags: constructive algorithms, data structures, graphs
Correct Solution:
```
def parse(i):
t = input().split()
return int(t[0]), int(t[1]), i
n, m = [int(x) for x in input().split()]
list = [parse(i) for i in range(m)]
list.sort(key=lambda x: (x[0], -x[1]))
# print(list)
f = 0
t = 1
fakeFrom = 1
fakeTo = 2... | output | 1 | 93,947 | 13 | 187,895 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Student Vladislav came to his programming exam completely unprepared as usual. He got a question about some strange algorithm on a graph β something that will definitely never be useful in real life. He asked a girl sitting next to him to le... | instruction | 0 | 93,948 | 13 | 187,896 |
Tags: constructive algorithms, data structures, graphs
Correct Solution:
```
f = lambda: map(int, input().split())
n, m = f()
p = []
for i in range(m):
a, b = f()
p.append((a, 1 - b, i))
p.sort()
k = j = 0
s = [0] * m
u, v = 1, 3
for a, b, i in p:
if not b:
k += j
s[i] = (j + 1,... | output | 1 | 93,948 | 13 | 187,897 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Student Vladislav came to his programming exam completely unprepared as usual. He got a question about some strange algorithm on a graph β something that will definitely never be useful in real ... | instruction | 0 | 93,949 | 13 | 187,898 |
Yes | output | 1 | 93,949 | 13 | 187,899 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Student Vladislav came to his programming exam completely unprepared as usual. He got a question about some strange algorithm on a graph β something that will definitely never be useful in real ... | instruction | 0 | 93,950 | 13 | 187,900 |
Yes | output | 1 | 93,950 | 13 | 187,901 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Student Vladislav came to his programming exam completely unprepared as usual. He got a question about some strange algorithm on a graph β something that will definitely never be useful in real ... | instruction | 0 | 93,951 | 13 | 187,902 |
Yes | output | 1 | 93,951 | 13 | 187,903 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Student Vladislav came to his programming exam completely unprepared as usual. He got a question about some strange algorithm on a graph β something that will definitely never be useful in real ... | instruction | 0 | 93,952 | 13 | 187,904 |
Yes | output | 1 | 93,952 | 13 | 187,905 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Student Vladislav came to his programming exam completely unprepared as usual. He got a question about some strange algorithm on a graph β something that will definitely never be useful in real ... | instruction | 0 | 93,953 | 13 | 187,906 |
No | output | 1 | 93,953 | 13 | 187,907 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Student Vladislav came to his programming exam completely unprepared as usual. He got a question about some strange algorithm on a graph β something that will definitely never be useful in real ... | instruction | 0 | 93,954 | 13 | 187,908 |
No | output | 1 | 93,954 | 13 | 187,909 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Student Vladislav came to his programming exam completely unprepared as usual. He got a question about some strange algorithm on a graph β something that will definitely never be useful in real ... | instruction | 0 | 93,955 | 13 | 187,910 |
No | output | 1 | 93,955 | 13 | 187,911 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Student Vladislav came to his programming exam completely unprepared as usual. He got a question about some strange algorithm on a graph β something that will definitely never be useful in real ... | instruction | 0 | 93,956 | 13 | 187,912 |
No | output | 1 | 93,956 | 13 | 187,913 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Monocarp has drawn a tree (an undirected connected acyclic graph) and then has given each vertex an index. All indices are distinct numbers from 1 to n. For every edge e of this tree, Monocarp has written two numbers: the maximum indices of ... | instruction | 0 | 94,397 | 13 | 188,794 |
Tags: constructive algorithms, data structures, graphs, greedy
Correct Solution:
```
# ---------------------------iye ha aam zindegi---------------------------------------------
import math
import random
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
import sys... | output | 1 | 94,397 | 13 | 188,795 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Monocarp has drawn a tree (an undirected connected acyclic graph) and then has given each vertex an index. All indices are distinct numbers from 1 to n. For every edge e of this tree, Monocarp has written two numbers: the maximum indices of ... | instruction | 0 | 94,398 | 13 | 188,796 |
Tags: constructive algorithms, data structures, graphs, greedy
Correct Solution:
```
input=__import__('sys').stdin.readline
n = int(input())
lis=[]
fre=[0]*(10005)
c1=0
ans=[[0,0]]
has=[0]*10005
for i in range(n-1):
a,b = map(int,input().split())
if b<n:
print("NO")
exit()
lis.append(a)
... | output | 1 | 94,398 | 13 | 188,797 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Monocarp has drawn a tree (an undirected connected acyclic graph) and then has given each vertex an index. All indices are distinct numbers from 1 to n. For every edge e of this tree, Monocarp has written two numbers: the maximum indices of ... | instruction | 0 | 94,399 | 13 | 188,798 |
Tags: constructive algorithms, data structures, graphs, greedy
Correct Solution:
```
#
def solve():
n = int(input())
d = {}
for _ in range(n-1):
u, v = map(int, input().split())
min_ = min(u, v)
max_ = max(u, v)
if max_ != n:
return False, None
... | output | 1 | 94,399 | 13 | 188,799 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Monocarp has drawn a tree (an undirected connected acyclic graph) and then has given each vertex an index. All indices are distinct numbers from 1 to n. For every edge e of this tree, Monocarp has written two numbers: the maximum indices of ... | instruction | 0 | 94,400 | 13 | 188,800 |
Tags: constructive algorithms, data structures, graphs, greedy
Correct Solution:
```
n = int(input())
indices = []
for i in range(n-1):
x, y = map(int, input().split())
indices.append((x, y))
try:
not_seen = set(list(range(1, n)))
seen = {}
for x, y in indices:
assert(x == n or y == n)
... | output | 1 | 94,400 | 13 | 188,801 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Monocarp has drawn a tree (an undirected connected acyclic graph) and then has given each vertex an index. All indices are distinct numbers from 1 to n. For every edge e of this tree, Monocarp has written two numbers: the maximum indices of ... | instruction | 0 | 94,401 | 13 | 188,802 |
Tags: constructive algorithms, data structures, graphs, greedy
Correct Solution:
```
n = int(input())
V = []
for _ in range(n-1):
a,b = map(int, input().split())
V.append(a)
if b <n:
print('NO')
quit()
V.sort()
for i in range(n-1):
if V[i]<=i:
print("NO")
quit()
used = [... | output | 1 | 94,401 | 13 | 188,803 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Monocarp has drawn a tree (an undirected connected acyclic graph) and then has given each vertex an index. All indices are distinct numbers from 1 to n. For every edge e of this tree, Monocarp has written two numbers: the maximum indices of ... | instruction | 0 | 94,402 | 13 | 188,804 |
Tags: constructive algorithms, data structures, graphs, greedy
Correct Solution:
```
from sys import stdin
def bad():
print('NO')
exit()
all_in = stdin.readlines()
n = int(all_in[0])
pair = list(map(lambda x: tuple(map(int, x.split())), all_in[1:]))
f = True
for i in range(n - 1):
if pair[i][0] ==... | output | 1 | 94,402 | 13 | 188,805 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Monocarp has drawn a tree (an undirected connected acyclic graph) and then has given each vertex an index. All indices are distinct numbers from 1 to n. For every edge e of this tree, Monocarp has written two numbers: the maximum indices of ... | instruction | 0 | 94,403 | 13 | 188,806 |
Tags: constructive algorithms, data structures, graphs, greedy
Correct Solution:
```
from copy import deepcopy
import itertools
from bisect import bisect_left
from bisect import bisect_right
import math
from collections import deque
from collections import Counter
def read():
return int(input())
def readmap():
... | output | 1 | 94,403 | 13 | 188,807 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Monocarp has drawn a tree (an undirected connected acyclic graph) and then has given each vertex an index. All indices are distinct numbers from 1 to n. For every edge e of this tree, Monocarp has written two numbers: the maximum indices of ... | instruction | 0 | 94,404 | 13 | 188,808 |
Tags: constructive algorithms, data structures, graphs, greedy
Correct Solution:
```
from bisect import bisect
from collections import defaultdict
# l = list(map(int,input().split()))
# map(int,input().split()))
from math import gcd,sqrt,ceil
from collections import Counter
import sys
sys.setrecursionlimit(10**9)
ans ... | output | 1 | 94,404 | 13 | 188,809 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Monocarp has drawn a tree (an undirected connected acyclic graph) and then has given each vertex an index. All indices are distinct numbers from 1 to n. For every edge e of this tree, Monocarp h... | instruction | 0 | 94,405 | 13 | 188,810 |
Yes | output | 1 | 94,405 | 13 | 188,811 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Monocarp has drawn a tree (an undirected connected acyclic graph) and then has given each vertex an index. All indices are distinct numbers from 1 to n. For every edge e of this tree, Monocarp h... | instruction | 0 | 94,406 | 13 | 188,812 |
Yes | output | 1 | 94,406 | 13 | 188,813 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Monocarp has drawn a tree (an undirected connected acyclic graph) and then has given each vertex an index. All indices are distinct numbers from 1 to n. For every edge e of this tree, Monocarp h... | instruction | 0 | 94,407 | 13 | 188,814 |
Yes | output | 1 | 94,407 | 13 | 188,815 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Monocarp has drawn a tree (an undirected connected acyclic graph) and then has given each vertex an index. All indices are distinct numbers from 1 to n. For every edge e of this tree, Monocarp h... | instruction | 0 | 94,408 | 13 | 188,816 |
No | output | 1 | 94,408 | 13 | 188,817 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Monocarp has drawn a tree (an undirected connected acyclic graph) and then has given each vertex an index. All indices are distinct numbers from 1 to n. For every edge e of this tree, Monocarp h... | instruction | 0 | 94,409 | 13 | 188,818 |
No | output | 1 | 94,409 | 13 | 188,819 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Monocarp has drawn a tree (an undirected connected acyclic graph) and then has given each vertex an index. All indices are distinct numbers from 1 to n. For every edge e of this tree, Monocarp h... | instruction | 0 | 94,410 | 13 | 188,820 |
No | output | 1 | 94,410 | 13 | 188,821 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Monocarp has drawn a tree (an undirected connected acyclic graph) and then has given each vertex an index. All indices are distinct numbers from 1 to n. For every edge e of this tree, Monocarp h... | instruction | 0 | 94,411 | 13 | 188,822 |
No | output | 1 | 94,411 | 13 | 188,823 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree (an undirected connected graph without cycles) and an integer s.
Vanya wants to put weights on all edges of the tree so that all weights are non-negative real numbers and their sum is s. At the same time, he wants to ma... | instruction | 0 | 94,426 | 13 | 188,852 |
Tags: constructive algorithms, implementation, trees
Correct Solution:
```
n, s = map(int, input().split())
gr = {i: [] for i in range(1, n + 1)}
for _ in range(n - 1):
a, b = map(int, input().split())
gr[a].append(b)
gr[b].append(a)
ans = 2 * s / sum([1 if len(gr[i]) == 1 else 0 for i in range(1, n + 1)])
... | output | 1 | 94,426 | 13 | 188,853 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree (an undirected connected graph without cycles) and an integer s.
Vanya wants to put weights on all edges of the tree so that all weights are non-negative real numbers and their sum is s. At the same time, he wants to ma... | instruction | 0 | 94,427 | 13 | 188,854 |
Tags: constructive algorithms, implementation, trees
Correct Solution:
```
n,s = map(int,input().split())
c = [[] for i in range(n)]
for i in range(n - 1):
a, b = map(int,input().split())
c[a-1].append(b)
c[b-1].append(a)
d = set()
k = 0
for i in range(n):
if len(c[i]) == 1:
d.add(i)
if ... | output | 1 | 94,427 | 13 | 188,855 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree (an undirected connected graph without cycles) and an integer s.
Vanya wants to put weights on all edges of the tree so that all weights are non-negative real numbers and their sum is s. At the same time, he wants to ma... | instruction | 0 | 94,428 | 13 | 188,856 |
Tags: constructive algorithms, implementation, trees
Correct Solution:
```
from collections import Counter
cnt = Counter()
n, s = map(int, input().split())
for _ in range(n-1):
cnt.update(map(int, input().split()))
#print(cnt)
k = sum(cnt[i] == 1 for i in cnt)
print(2*s/k)
``` | output | 1 | 94,428 | 13 | 188,857 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree (an undirected connected graph without cycles) and an integer s.
Vanya wants to put weights on all edges of the tree so that all weights are non-negative real numbers and their sum is s. At the same time, he wants to ma... | instruction | 0 | 94,429 | 13 | 188,858 |
Tags: constructive algorithms, implementation, trees
Correct Solution:
```
n,s=map(int, input().split())
g=[[] for i in range(n+1)]
ind=[0]*n
for i in range(n-1):
u,v=map(int, input().split())
ind[u-1]+=1
ind[v-1]+=1
#g[u-1].append(v-1)
#g[v-1].append(u-1)
ans=0
for i in range(n):
if ind[i]=... | output | 1 | 94,429 | 13 | 188,859 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree (an undirected connected graph without cycles) and an integer s.
Vanya wants to put weights on all edges of the tree so that all weights are non-negative real numbers and their sum is s. At the same time, he wants to ma... | instruction | 0 | 94,430 | 13 | 188,860 |
Tags: constructive algorithms, implementation, trees
Correct Solution:
```
# list(map(int, input().split()))
# map(int, input().split())
n, s = map(int, input().split())
g = [[] for i in range(n)]
for i in range(n - 1):
a, b = map(int, input().split())
a -= 1
b -= 1
g[a].append(b)
g[b].append(a)
c... | output | 1 | 94,430 | 13 | 188,861 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree (an undirected connected graph without cycles) and an integer s.
Vanya wants to put weights on all edges of the tree so that all weights are non-negative real numbers and their sum is s. At the same time, he wants to ma... | instruction | 0 | 94,431 | 13 | 188,862 |
Tags: constructive algorithms, implementation, trees
Correct Solution:
```
n,s = [int(i) for i in input().split()]
lst = [0 for i in range(n)]
for i in range(n-1):
x,y = [int(i) for i in input().split()]
lst[x-1]+=1
lst[y-1]+=1
count = 0
for i in lst:
if i == 1:
count+=1
print(2*s/count)
`... | output | 1 | 94,431 | 13 | 188,863 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree (an undirected connected graph without cycles) and an integer s.
Vanya wants to put weights on all edges of the tree so that all weights are non-negative real numbers and their sum is s. At the same time, he wants to ma... | instruction | 0 | 94,432 | 13 | 188,864 |
Tags: constructive algorithms, implementation, trees
Correct Solution:
```
n, s = map(int, input().split())
d = {}
for i in range(n - 1):
vertex = list(map(int, input().split()))
d[vertex[0]] = d.get(vertex[0], 0) + 1
d[vertex[1]] = d.get(vertex[1], 0) + 1
c = 0
for i in d:
if d[i] == 1: c += 1
print(2 ... | output | 1 | 94,432 | 13 | 188,865 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a tree (an undirected connected graph without cycles) and an integer s.
Vanya wants to put weights on all edges of the tree so that all weights are non-negative real numbers and their sum is s. At the same time, he wants to ma... | instruction | 0 | 94,433 | 13 | 188,866 |
Tags: constructive algorithms, implementation, trees
Correct Solution:
```
n, s = map(int, input().split())
dict = {}
for i in range(n - 1):
temp = list(map(int, input().split()))
dict[temp[0]] = dict.get(temp[0], 0) + 1
dict[temp[1]] = dict.get(temp[1], 0) + 1
k = 0
for i in dict:
if dict[i] == 1:
... | output | 1 | 94,433 | 13 | 188,867 |
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 (an undirected connected graph without cycles) and an integer s.
Vanya wants to put weights on all edges of the tree so that all weights are non-negative real numbers and t... | instruction | 0 | 94,434 | 13 | 188,868 |
Yes | output | 1 | 94,434 | 13 | 188,869 |
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 (an undirected connected graph without cycles) and an integer s.
Vanya wants to put weights on all edges of the tree so that all weights are non-negative real numbers and t... | instruction | 0 | 94,435 | 13 | 188,870 |
Yes | output | 1 | 94,435 | 13 | 188,871 |
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 (an undirected connected graph without cycles) and an integer s.
Vanya wants to put weights on all edges of the tree so that all weights are non-negative real numbers and t... | instruction | 0 | 94,436 | 13 | 188,872 |
Yes | output | 1 | 94,436 | 13 | 188,873 |
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 (an undirected connected graph without cycles) and an integer s.
Vanya wants to put weights on all edges of the tree so that all weights are non-negative real numbers and t... | instruction | 0 | 94,437 | 13 | 188,874 |
Yes | output | 1 | 94,437 | 13 | 188,875 |
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 (an undirected connected graph without cycles) and an integer s.
Vanya wants to put weights on all edges of the tree so that all weights are non-negative real numbers and t... | instruction | 0 | 94,438 | 13 | 188,876 |
No | output | 1 | 94,438 | 13 | 188,877 |
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 (an undirected connected graph without cycles) and an integer s.
Vanya wants to put weights on all edges of the tree so that all weights are non-negative real numbers and t... | instruction | 0 | 94,439 | 13 | 188,878 |
No | output | 1 | 94,439 | 13 | 188,879 |
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 (an undirected connected graph without cycles) and an integer s.
Vanya wants to put weights on all edges of the tree so that all weights are non-negative real numbers and t... | instruction | 0 | 94,440 | 13 | 188,880 |
No | output | 1 | 94,440 | 13 | 188,881 |
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 (an undirected connected graph without cycles) and an integer s.
Vanya wants to put weights on all edges of the tree so that all weights are non-negative real numbers and t... | instruction | 0 | 94,441 | 13 | 188,882 |
No | output | 1 | 94,441 | 13 | 188,883 |
Provide tags and a correct Python 3 solution for this coding contest problem.
We define a spanning tree of a graph to be a BFS tree rooted at vertex s if and only if for every node t the shortest distance between s and t in the graph is equal to the shortest distance between s and t in the spanning tree.
Given a gra... | instruction | 0 | 94,616 | 13 | 189,232 |
Tags: combinatorics, dfs and similar, graphs, math, shortest paths, trees
Correct Solution:
```
import sys, os
from collections import defaultdict, deque
if os.environ['USERNAME']=='kissz':
inp=open('in2.txt','r').readline
def debug(*args):
print(*args,file=sys.stderr)
else:
inp=sys.stdin.readline ... | output | 1 | 94,616 | 13 | 189,233 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.