message stringlengths 2 43.5k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 853 107k | cluster float64 24 24 | __index_level_0__ int64 1.71k 214k |
|---|---|---|---|---|---|
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A process RAM is a sequence of bytes that are indexed from 1 to n. Polycarpus's program contains such instructions as "memset", that is, the operations of filling memory cells on a segment with ... | instruction | 0 | 89,599 | 24 | 179,198 |
No | output | 1 | 89,599 | 24 | 179,199 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A process RAM is a sequence of bytes that are indexed from 1 to n. Polycarpus's program contains such instructions as "memset", that is, the operations of filling memory cells on a segment with ... | instruction | 0 | 89,600 | 24 | 179,200 |
No | output | 1 | 89,600 | 24 | 179,201 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A process RAM is a sequence of bytes that are indexed from 1 to n. Polycarpus's program contains such instructions as "memset", that is, the operations of filling memory cells on a segment with ... | instruction | 0 | 89,601 | 24 | 179,202 |
No | output | 1 | 89,601 | 24 | 179,203 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A process RAM is a sequence of bytes that are indexed from 1 to n. Polycarpus's program contains such instructions as "memset", that is, the operations of filling memory cells on a segment with ... | instruction | 0 | 89,602 | 24 | 179,204 |
No | output | 1 | 89,602 | 24 | 179,205 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Polycarp is a regular customer at the restaurant "Ber Patio". He likes having lunches there.
"Ber Patio" has special discount program for regular customers. A customer can collect bonuses and p... | instruction | 0 | 89,755 | 24 | 179,510 |
No | output | 1 | 89,755 | 24 | 179,511 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Polycarp is a regular customer at the restaurant "Ber Patio". He likes having lunches there.
"Ber Patio" has special discount program for regular customers. A customer can collect bonuses and p... | instruction | 0 | 89,756 | 24 | 179,512 |
No | output | 1 | 89,756 | 24 | 179,513 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Polycarp is a regular customer at the restaurant "Ber Patio". He likes having lunches there.
"Ber Patio" has special discount program for regular customers. A customer can collect bonuses and p... | instruction | 0 | 89,757 | 24 | 179,514 |
No | output | 1 | 89,757 | 24 | 179,515 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Polycarp is a regular customer at the restaurant "Ber Patio". He likes having lunches there.
"Ber Patio" has special discount program for regular customers. A customer can collect bonuses and p... | instruction | 0 | 89,758 | 24 | 179,516 |
No | output | 1 | 89,758 | 24 | 179,517 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Polycarp is a head of a circus troupe. There are n — an even number — artists in the troupe. It is known whether the i-th artist can perform as a clown (if yes, then c_i = 1, otherwise c_i = 0), and whether they can perform as an acrobat (if... | instruction | 0 | 90,166 | 24 | 180,332 |
Tags: brute force, greedy, math, strings
Correct Solution:
```
from collections import deque, Counter, OrderedDict
from heapq import nsmallest, nlargest, heapify, heappop ,heappush, heapreplace
from math import ceil,floor,log,log2,sqrt,gcd,factorial,pow,pi
from bisect import bisect_left,bisect_right
def binNumber(n,si... | output | 1 | 90,166 | 24 | 180,333 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Polycarp is a head of a circus troupe. There are n — an even number — artists in the troupe. It is known whether the i-th artist can perform as a clown (if yes, then c_i = 1, otherwise c_i = 0), and whether they can perform as an acrobat (if... | instruction | 0 | 90,167 | 24 | 180,334 |
Tags: brute force, greedy, math, strings
Correct Solution:
```
# map(int, input().split())
# list(map(int, input().split()))
# for _ in range(int(input())):
n = int(input())
c = list(map(int, list(input())))
a = list(map(int, list(input())))
p = [0,0,0,0]
# 00,10,01,11
ind = [[],[],[],[]]
for i in range(n):
if c... | output | 1 | 90,167 | 24 | 180,335 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Polycarp is a head of a circus troupe. There are n — an even number — artists in the troupe. It is known whether the i-th artist can perform as a clown (if yes, then c_i = 1, otherwise c_i = 0), and whether they can perform as an acrobat (if... | instruction | 0 | 90,168 | 24 | 180,336 |
Tags: brute force, greedy, math, strings
Correct Solution:
```
n = int(input())
n2 = n // 2
c = input()
a = input()
cl = []
ac = []
uni = []
par = []
res = []
for i in range(0, n):
if c[i] == "1":
if a[i]=="0":
cl.append(i+1)
else:
uni.append(i+1)
else:
if a[i]=="... | output | 1 | 90,168 | 24 | 180,337 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Polycarp is a head of a circus troupe. There are n — an even number — artists in the troupe. It is known whether the i-th artist can perform as a clown (if yes, then c_i = 1, otherwise c_i = 0), and whether they can perform as an acrobat (if... | instruction | 0 | 90,169 | 24 | 180,338 |
Tags: brute force, greedy, math, strings
Correct Solution:
```
from sys import stdin,stdout
from math import gcd,sqrt,factorial,pi,inf
from collections import deque,defaultdict
from bisect import bisect,bisect_left
from time import time
from itertools import permutations as per
from heapq import heapify,heappush,heappo... | output | 1 | 90,169 | 24 | 180,339 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Polycarp is a head of a circus troupe. There are n — an even number — artists in the troupe. It is known whether the i-th artist can perform as a clown (if yes, then c_i = 1, otherwise c_i = 0), and whether they can perform as an acrobat (if... | instruction | 0 | 90,170 | 24 | 180,340 |
Tags: brute force, greedy, math, strings
Correct Solution:
```
import sys
import random
N = int(input())
C = list(map(int, input()))
A = list(map(int, input()))
# N = random.randint(20, 40) * 2
# C = [random.randint(0, 1) for i in range(N)]
# A = [random.randint(0, 1) for i in range(N)]
def build_solution(i, j, x, y... | output | 1 | 90,170 | 24 | 180,341 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Polycarp is a head of a circus troupe. There are n — an even number — artists in the troupe. It is known whether the i-th artist can perform as a clown (if yes, then c_i = 1, otherwise c_i = 0), and whether they can perform as an acrobat (if... | instruction | 0 | 90,171 | 24 | 180,342 |
Tags: brute force, greedy, math, strings
Correct Solution:
```
def find_sol1(result,num_dict):
ans_list = []
#print("result",result)
for i in range(num_dict['a']+1):
for j in range(num_dict['d']+1):
if i - j == result:
ans_list.append((i,j))
return ans_list
def find_s... | output | 1 | 90,171 | 24 | 180,343 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Polycarp is a head of a circus troupe. There are n — an even number — artists in the troupe. It is known whether the i-th artist can perform as a clown (if yes, then c_i = 1, otherwise c_i = 0), and whether they can perform as an acrobat (if... | instruction | 0 | 90,172 | 24 | 180,344 |
Tags: brute force, greedy, math, strings
Correct Solution:
```
n = int(input())
s1 = input()
s2 = input()
w,x,y,z = 0,0,0,0
W,X,Y,Z = [],[],[],[]
for i in range(n):
s = s1[i] + s2[i]
if s == '00':
w += 1
W.append(i)
elif s == '11':
x += 1
X.append(i)
elif s =='10':
... | output | 1 | 90,172 | 24 | 180,345 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Polycarp is a head of a circus troupe. There are n — an even number — artists in the troupe. It is known whether the i-th artist can perform as a clown (if yes, then c_i = 1, otherwise c_i = 0), and whether they can perform as an acrobat (if... | instruction | 0 | 90,173 | 24 | 180,346 |
Tags: brute force, greedy, math, strings
Correct Solution:
```
import sys
n=int(input())
s=input()
s1=input()
a=0
b=0
c=0
d=0
an=[]
for i in range(n):
if s[i]=='0' and s1[i]=='0':
a+=1
elif s[i]=='1' and s1[i]=='0':
b+=1
elif s[i]=='0' and s1[i]=='1':
c+=1
else:
d+=1
x=0
... | output | 1 | 90,173 | 24 | 180,347 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Polycarp is a head of a circus troupe. There are n — an even number — artists in the troupe. It is known whether the i-th artist can perform as a clown (if yes, then c_i = 1, otherwise c_i = 0),... | instruction | 0 | 90,174 | 24 | 180,348 |
Yes | output | 1 | 90,174 | 24 | 180,349 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Polycarp is a head of a circus troupe. There are n — an even number — artists in the troupe. It is known whether the i-th artist can perform as a clown (if yes, then c_i = 1, otherwise c_i = 0),... | instruction | 0 | 90,175 | 24 | 180,350 |
Yes | output | 1 | 90,175 | 24 | 180,351 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Polycarp is a head of a circus troupe. There are n — an even number — artists in the troupe. It is known whether the i-th artist can perform as a clown (if yes, then c_i = 1, otherwise c_i = 0),... | instruction | 0 | 90,176 | 24 | 180,352 |
Yes | output | 1 | 90,176 | 24 | 180,353 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Polycarp is a head of a circus troupe. There are n — an even number — artists in the troupe. It is known whether the i-th artist can perform as a clown (if yes, then c_i = 1, otherwise c_i = 0),... | instruction | 0 | 90,177 | 24 | 180,354 |
Yes | output | 1 | 90,177 | 24 | 180,355 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Polycarp is a head of a circus troupe. There are n — an even number — artists in the troupe. It is known whether the i-th artist can perform as a clown (if yes, then c_i = 1, otherwise c_i = 0),... | instruction | 0 | 90,178 | 24 | 180,356 |
No | output | 1 | 90,178 | 24 | 180,357 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Polycarp is a head of a circus troupe. There are n — an even number — artists in the troupe. It is known whether the i-th artist can perform as a clown (if yes, then c_i = 1, otherwise c_i = 0),... | instruction | 0 | 90,179 | 24 | 180,358 |
No | output | 1 | 90,179 | 24 | 180,359 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Polycarp is a head of a circus troupe. There are n — an even number — artists in the troupe. It is known whether the i-th artist can perform as a clown (if yes, then c_i = 1, otherwise c_i = 0),... | instruction | 0 | 90,180 | 24 | 180,360 |
No | output | 1 | 90,180 | 24 | 180,361 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Polycarp is a head of a circus troupe. There are n — an even number — artists in the troupe. It is known whether the i-th artist can perform as a clown (if yes, then c_i = 1, otherwise c_i = 0),... | instruction | 0 | 90,181 | 24 | 180,362 |
No | output | 1 | 90,181 | 24 | 180,363 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n cities in Berland. The city numbered 1 is the capital. Some pairs of cities are connected by a one-way road of length 1.
Before the trip, Polycarp for each city found out the value of d_i — the shortest distance from the capital... | instruction | 0 | 90,348 | 24 | 180,696 |
Tags: dfs and similar, dp, graphs, shortest paths
Correct Solution:
```
"""
#If FastIO not needed, use this and don't forget to strip
#import sys, math
#input = sys.stdin.readline
"""
import os
import sys
from io import BytesIO, IOBase
import heapq as h
from bisect import bisect_left, bisect_right
import time
from t... | output | 1 | 90,348 | 24 | 180,697 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n cities in Berland. The city numbered 1 is the capital. Some pairs of cities are connected by a one-way road of length 1.
Before the trip, Polycarp for each city found out the value of d_i — the shortest distance from the capital... | instruction | 0 | 90,349 | 24 | 180,698 |
Tags: dfs and similar, dp, graphs, shortest paths
Correct Solution:
```
import math,sys
#from itertools import permutations, combinations;import heapq,random;
from collections import defaultdict,deque
import bisect as bi
def yes():print('YES')
def no():print('NO')
#sys.stdin=open('input.txt','r');sys.stdout=open('outpu... | output | 1 | 90,349 | 24 | 180,699 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n cities in Berland. The city numbered 1 is the capital. Some pairs of cities are connected by a one-way road of length 1.
Before the trip, Polycarp for each city found out the value of d_i — the shortest distance from the capital... | instruction | 0 | 90,350 | 24 | 180,700 |
Tags: dfs and similar, dp, graphs, shortest paths
Correct Solution:
```
import sys
def input():
return sys.stdin.readline().strip()
def mint():
return int(input())
def mints():
return map(int, input().split())
for i in range(mint()):
input()
n, m = mints()
n2 = n*2
e = [[] for i in range(n)]
eb = [[] for i ... | output | 1 | 90,350 | 24 | 180,701 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n cities in Berland. The city numbered 1 is the capital. Some pairs of cities are connected by a one-way road of length 1.
Before the trip, Polycarp for each city found out the value of d_i — the shortest distance from the capital... | instruction | 0 | 90,351 | 24 | 180,702 |
Tags: dfs and similar, dp, graphs, shortest paths
Correct Solution:
```
from queue import Queue
class Node:
def __init__(self, idx, d = -1):
self.d = d
self.idx = idx
self.par = []
t = int(input())
for _ in range(t):
dkk = input()
c, eds = tuple([int(x) for x in input().split()])
... | output | 1 | 90,351 | 24 | 180,703 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n cities in Berland. The city numbered 1 is the capital. Some pairs of cities are connected by a one-way road of length 1.
Before the trip, Polycarp for each city found out the value of d_i — the shortest distance from the capital... | instruction | 0 | 90,352 | 24 | 180,704 |
Tags: dfs and similar, dp, graphs, shortest paths
Correct Solution:
```
import sys
input=sys.stdin.buffer.readline #FOR READING PURE INTEGER INPUTS (space separation ok)
from queue import deque
from types import GeneratorType
def bootstrap(f, stack=[]):
def wrappedfunc(*args, **kwargs):
if stack:
... | output | 1 | 90,352 | 24 | 180,705 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n cities in Berland. The city numbered 1 is the capital. Some pairs of cities are connected by a one-way road of length 1.
Before the trip, Polycarp for each city found out the value of d_i — the shortest distance from the capital... | instruction | 0 | 90,353 | 24 | 180,706 |
Tags: dfs and similar, dp, graphs, shortest paths
Correct Solution:
```
# https://codeforces.com/problemset/problem/1472/G
from collections import defaultdict, deque
import sys
input = sys.stdin.readline
def get_distances(graph):
q = deque()
q.append(1)
q.append(None)
d, distances = 0, {}
while l... | output | 1 | 90,353 | 24 | 180,707 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n cities in Berland. The city numbered 1 is the capital. Some pairs of cities are connected by a one-way road of length 1.
Before the trip, Polycarp for each city found out the value of d_i — the shortest distance from the capital... | instruction | 0 | 90,354 | 24 | 180,708 |
Tags: dfs and similar, dp, graphs, shortest paths
Correct Solution:
```
import sys
input = sys.stdin.readline
sys.setrecursionlimit(100000)
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 | 90,354 | 24 | 180,709 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n cities in Berland. The city numbered 1 is the capital. Some pairs of cities are connected by a one-way road of length 1.
Before the trip, Polycarp for each city found out the value of d_i — the shortest distance from the capital... | instruction | 0 | 90,355 | 24 | 180,710 |
Tags: dfs and similar, dp, graphs, shortest paths
Correct Solution:
```
from collections import deque
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):
sel... | output | 1 | 90,355 | 24 | 180,711 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n cities in Berland. The city numbered 1 is the capital. Some pairs of cities are connected by a one-way road of length 1.
Before the trip, Polycarp for each city found out the value ... | instruction | 0 | 90,356 | 24 | 180,712 |
Yes | output | 1 | 90,356 | 24 | 180,713 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n cities in Berland. The city numbered 1 is the capital. Some pairs of cities are connected by a one-way road of length 1.
Before the trip, Polycarp for each city found out the value ... | instruction | 0 | 90,357 | 24 | 180,714 |
Yes | output | 1 | 90,357 | 24 | 180,715 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n cities in Berland. The city numbered 1 is the capital. Some pairs of cities are connected by a one-way road of length 1.
Before the trip, Polycarp for each city found out the value ... | instruction | 0 | 90,358 | 24 | 180,716 |
Yes | output | 1 | 90,358 | 24 | 180,717 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n cities in Berland. The city numbered 1 is the capital. Some pairs of cities are connected by a one-way road of length 1.
Before the trip, Polycarp for each city found out the value ... | instruction | 0 | 90,359 | 24 | 180,718 |
Yes | output | 1 | 90,359 | 24 | 180,719 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n cities in Berland. The city numbered 1 is the capital. Some pairs of cities are connected by a one-way road of length 1.
Before the trip, Polycarp for each city found out the value ... | instruction | 0 | 90,360 | 24 | 180,720 |
No | output | 1 | 90,360 | 24 | 180,721 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n cities in Berland. The city numbered 1 is the capital. Some pairs of cities are connected by a one-way road of length 1.
Before the trip, Polycarp for each city found out the value ... | instruction | 0 | 90,361 | 24 | 180,722 |
No | output | 1 | 90,361 | 24 | 180,723 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n cities in Berland. The city numbered 1 is the capital. Some pairs of cities are connected by a one-way road of length 1.
Before the trip, Polycarp for each city found out the value ... | instruction | 0 | 90,362 | 24 | 180,724 |
No | output | 1 | 90,362 | 24 | 180,725 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n cities in Berland. The city numbered 1 is the capital. Some pairs of cities are connected by a one-way road of length 1.
Before the trip, Polycarp for each city found out the value ... | instruction | 0 | 90,363 | 24 | 180,726 |
No | output | 1 | 90,363 | 24 | 180,727 |
Provide tags and a correct Python 3 solution for this coding contest problem.
This problem uses a simplified network topology model, please read the problem statement carefully and use it as a formal document as you develop the solution.
Polycarpus continues working as a system administrator in a large corporation. T... | instruction | 0 | 90,435 | 24 | 180,870 |
Tags: graphs, implementation
Correct Solution:
```
from collections import Counter
n, m = map(int, input().split())
g = [[] for _ in range(n)]
for i in range(m):
x, y = map(int, input().split())
g[x - 1].append(y - 1)
g[y - 1].append(x - 1)
bus = ([2] * (n - 2)) + ([1] * 2)
star = [1] * (n - 1) + [n - 1... | output | 1 | 90,435 | 24 | 180,871 |
Provide tags and a correct Python 3 solution for this coding contest problem.
This problem uses a simplified network topology model, please read the problem statement carefully and use it as a formal document as you develop the solution.
Polycarpus continues working as a system administrator in a large corporation. T... | instruction | 0 | 90,436 | 24 | 180,872 |
Tags: graphs, implementation
Correct Solution:
```
from collections import defaultdict
I = lambda: map(int, input().split())
degrees = defaultdict(int)
n, m = I()
for _ in range(m):
u, v = I()
degrees[u] += 1
degrees[v] += 1
values = set(degrees.values())
answer = 'unknown'
if values == {2}:
answer... | output | 1 | 90,436 | 24 | 180,873 |
Provide tags and a correct Python 3 solution for this coding contest problem.
This problem uses a simplified network topology model, please read the problem statement carefully and use it as a formal document as you develop the solution.
Polycarpus continues working as a system administrator in a large corporation. T... | instruction | 0 | 90,437 | 24 | 180,874 |
Tags: graphs, implementation
Correct Solution:
```
n, m = map(int, input().split())
graph = {
i: [] for i in range(1, n+1)
}
for i in range(m):
start, end = map(int, input().split())
graph[start].append(end)
graph[end].append(start)
length_array = []
for i in graph:
length_array.append(len(graph[i... | output | 1 | 90,437 | 24 | 180,875 |
Provide tags and a correct Python 3 solution for this coding contest problem.
This problem uses a simplified network topology model, please read the problem statement carefully and use it as a formal document as you develop the solution.
Polycarpus continues working as a system administrator in a large corporation. T... | instruction | 0 | 90,438 | 24 | 180,876 |
Tags: graphs, implementation
Correct Solution:
```
n, m = [int(i) for i in input().split()]
s = []
for i in range(n + 1):
s.append([])
for i in range(m):
x, y = [int(i) for i in input().split()]
s[x].append(y)
s[y].append(x)
sbool = [False] * (n + 1)
v2 = 0
v1 = 0
other = 0
def dfs(new):
global sboo... | output | 1 | 90,438 | 24 | 180,877 |
Provide tags and a correct Python 3 solution for this coding contest problem.
This problem uses a simplified network topology model, please read the problem statement carefully and use it as a formal document as you develop the solution.
Polycarpus continues working as a system administrator in a large corporation. T... | instruction | 0 | 90,439 | 24 | 180,878 |
Tags: graphs, implementation
Correct Solution:
```
n, m = [int(i) for i in input().split()]
graf = [[] for i in range(n + 1)]
for i in range(m):
k1, k2 = [int(i) for i in input().split()]
graf[k1].append(k2)
graf[k2].append(k1)
seks = [0, 0, 0]
for i in range(1, n + 1):
if len(graf[i]) == 1 or len(graf... | output | 1 | 90,439 | 24 | 180,879 |
Provide tags and a correct Python 3 solution for this coding contest problem.
This problem uses a simplified network topology model, please read the problem statement carefully and use it as a formal document as you develop the solution.
Polycarpus continues working as a system administrator in a large corporation. T... | instruction | 0 | 90,440 | 24 | 180,880 |
Tags: graphs, implementation
Correct Solution:
```
n, m = map(int, input().split())
d = dict()
maxi = 0
maxv = 0
for _ in range(m):
a, b = map(int, input().split())
if a - 1 in d:
d[a - 1] += 1
else:
d[a - 1] = 1
if b - 1 in d:
d[b - 1] += 1
else:
d[b - 1] = 1
if ... | output | 1 | 90,440 | 24 | 180,881 |
Provide tags and a correct Python 3 solution for this coding contest problem.
This problem uses a simplified network topology model, please read the problem statement carefully and use it as a formal document as you develop the solution.
Polycarpus continues working as a system administrator in a large corporation. T... | instruction | 0 | 90,441 | 24 | 180,882 |
Tags: graphs, implementation
Correct Solution:
```
n,m = map(int,input().split())
v = []
def chek_star(v):
t = 0
for i in v:
if i != 1:
t+=1
if t == 1:
return True
return False
for i in range(n):
v.append(0)
for i in range(m):
t1,t2 = map(int,input().split())
v[t1... | output | 1 | 90,441 | 24 | 180,883 |
Provide tags and a correct Python 3 solution for this coding contest problem.
This problem uses a simplified network topology model, please read the problem statement carefully and use it as a formal document as you develop the solution.
Polycarpus continues working as a system administrator in a large corporation. T... | instruction | 0 | 90,442 | 24 | 180,884 |
Tags: graphs, implementation
Correct Solution:
```
# brute force baby
from sys import stdin
node,edge = map(int,input().split())
capt = [0]*node
for l in stdin.readlines():
a,b = map(int,l.split())
capt[a-1] +=1; capt[b-1] += 1
if capt.count(1) == node - 1:
print('star topology')
elif capt.count(2) == node:... | output | 1 | 90,442 | 24 | 180,885 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
This problem uses a simplified network topology model, please read the problem statement carefully and use it as a formal document as you develop the solution.
Polycarpus continues working as a... | instruction | 0 | 90,443 | 24 | 180,886 |
Yes | output | 1 | 90,443 | 24 | 180,887 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
This problem uses a simplified network topology model, please read the problem statement carefully and use it as a formal document as you develop the solution.
Polycarpus continues working as a... | instruction | 0 | 90,444 | 24 | 180,888 |
Yes | output | 1 | 90,444 | 24 | 180,889 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.