message stringlengths 2 22.8k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 16 109k | cluster float64 1 1 | __index_level_0__ int64 32 217k |
|---|---|---|---|---|---|
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is an infinitely long street that runs west to east, which we consider as a number line.
There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X... | instruction | 0 | 51,115 | 1 | 102,230 |
Yes | output | 1 | 51,115 | 1 | 102,231 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is an infinitely long street that runs west to east, which we consider as a number line.
There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X... | instruction | 0 | 51,116 | 1 | 102,232 |
Yes | output | 1 | 51,116 | 1 | 102,233 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is an infinitely long street that runs west to east, which we consider as a number line.
There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X... | instruction | 0 | 51,117 | 1 | 102,234 |
Yes | output | 1 | 51,117 | 1 | 102,235 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is an infinitely long street that runs west to east, which we consider as a number line.
There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X... | instruction | 0 | 51,118 | 1 | 102,236 |
Yes | output | 1 | 51,118 | 1 | 102,237 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is an infinitely long street that runs west to east, which we consider as a number line.
There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X... | instruction | 0 | 51,119 | 1 | 102,238 |
No | output | 1 | 51,119 | 1 | 102,239 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is an infinitely long street that runs west to east, which we consider as a number line.
There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X... | instruction | 0 | 51,120 | 1 | 102,240 |
No | output | 1 | 51,120 | 1 | 102,241 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is an infinitely long street that runs west to east, which we consider as a number line.
There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X... | instruction | 0 | 51,121 | 1 | 102,242 |
No | output | 1 | 51,121 | 1 | 102,243 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is an infinitely long street that runs west to east, which we consider as a number line.
There are N roadworks scheduled on this street. The i-th roadwork blocks the point at coordinate X... | instruction | 0 | 51,122 | 1 | 102,244 |
No | output | 1 | 51,122 | 1 | 102,245 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n cities in Berland. Each city has its index — an integer number from 1 to n. The capital has index r1. All the roads in Berland are two-way. The road system is such that there is exactly one path from the capital to each city, i.e... | instruction | 0 | 51,655 | 1 | 103,310 |
Tags: dfs and similar, graphs
Correct Solution:
```
n,r,r1 = map(int,input().split())
capt,ind= [0]*(n+1),1;ig= r1; capt[0] = r
for u,v in enumerate(map(int,input().split())):
ind += (u+1==r); capt[ind] = v; ind+=1
r0 = capt[r1]
while 1:
temp = capt[r0]
if temp == r1: break
capt[r0] = r1; r1 = r0; r0 = ... | output | 1 | 51,655 | 1 | 103,311 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n cities in Berland. Each city has its index — an integer number from 1 to n. The capital has index r1. All the roads in Berland are two-way. The road system is such that there is exactly one path from the capital to each city, i.e... | instruction | 0 | 51,656 | 1 | 103,312 |
Tags: dfs and similar, graphs
Correct Solution:
```
def put():
return map(int, input().split())
def dfs(r1, r2):
p = -1
curr = r2
while p!=r1:
tmp = parent[curr]
parent[curr]=p
p = curr
curr = tmp
n,r1,r2 = put()
parent = [0]
parent.extend(list(put()))
parent.inser... | output | 1 | 51,656 | 1 | 103,313 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n cities in Berland. Each city has its index — an integer number from 1 to n. The capital has index r1. All the roads in Berland are two-way. The road system is such that there is exactly one path from the capital to each city, i.e... | instruction | 0 | 51,657 | 1 | 103,314 |
Tags: dfs and similar, graphs
Correct Solution:
```
n, r1, r2 = map(int, input().split())
def dfs(u):
x = None
while x != r1:
tmp = prev[u]
prev[u] = x
x = u
u = tmp
prev = [0] + list(map(int, input().split()))
prev.insert(r1, None)
dfs(r2)
prev.remove(... | output | 1 | 51,657 | 1 | 103,315 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n cities in Berland. Each city has its index — an integer number from 1 to n. The capital has index r1. All the roads in Berland are two-way. The road system is such that there is exactly one path from the capital to each city, i.e... | instruction | 0 | 51,658 | 1 | 103,316 |
Tags: dfs and similar, graphs
Correct Solution:
```
import os
import sys
# from io import BytesIO, IOBase
# BUFSIZE = 8192
# class FastIO(IOBase):
# newlines = 0
# def __init__(self, file):
# self._fd = file.fileno()
# self.buffer = BytesIO()
# self.writable = "x" in file.mode or "r" no... | output | 1 | 51,658 | 1 | 103,317 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n cities in Berland. Each city has its index — an integer number from 1 to n. The capital has index r1. All the roads in Berland are two-way. The road system is such that there is exactly one path from the capital to each city, i.e... | instruction | 0 | 51,659 | 1 | 103,318 |
Tags: dfs and similar, graphs
Correct Solution:
```
n,r1,r2=list(map(int,input().split()))
p=list(map(int,input().split()))
a=[0]*n
for i in range(n-1):
a[i+int(i>=r1-1)]=p[i]
s=[r2]
v=r2
while v!=r1:
s.append(a[v-1])
v=a[v-1]
for i in range(1,len(s)):
a[s[i]-1]=s[i-1]
print(*a[:r2-1]+a[r2:])
``` | output | 1 | 51,659 | 1 | 103,319 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n cities in Berland. Each city has its index — an integer number from 1 to n. The capital has index r1. All the roads in Berland are two-way. The road system is such that there is exactly one path from the capital to each city, i.e... | instruction | 0 | 51,660 | 1 | 103,320 |
Tags: dfs and similar, graphs
Correct Solution:
```
def findPath(fr, to, parent):
path = [to]
current = to
while current != fr:
path.append(parent[current])
current = parent[current]
return path
n, r1, r2 = map(int, input().split())
idx = lambda i: i if i < r1 else i + 1
oldPar... | output | 1 | 51,660 | 1 | 103,321 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n cities in Berland. Each city has its index — an integer number from 1 to n. The capital has index r1. All the roads in Berland are two-way. The road system is such that there is exactly one path from the capital to each city, i.e... | instruction | 0 | 51,661 | 1 | 103,322 |
Tags: dfs and similar, graphs
Correct Solution:
```
import sys
sys.setrecursionlimit(100000)
n, r1, r2 = map(int, input().split())
a = list(map(int, input().split()))
g = {}
num = 0
for k, v in enumerate(a):
num += 1
if num == r1:
num += 1
# print(k, num, v)
if num not in g:
g[num] = ... | output | 1 | 51,661 | 1 | 103,323 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n cities in Berland. Each city has its index — an integer number from 1 to n. The capital has index r1. All the roads in Berland are two-way. The road system is such that there is exactly one path from the capital to each city, i.e... | instruction | 0 | 51,662 | 1 | 103,324 |
Tags: dfs and similar, graphs
Correct Solution:
```
import sys
input=sys.stdin.readline
n,r1,r2=map(int,input().split())
r1-=1;r2-=1
p=list(map(int,input().split()))
g=[[] for i in range(n)]
c=0
for i in range(n-1):
if i==r1:
c+=1
g[i+c].append(p[i]-1)
g[p[i]-1].append(i+c)
pre=[-1]*n
q=[[-1,r2]]
pre[r2]=r2
w... | output | 1 | 51,662 | 1 | 103,325 |
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. Each city has its index — an integer number from 1 to n. The capital has index r1. All the roads in Berland are two-way. The road system is such that there is exac... | instruction | 0 | 51,663 | 1 | 103,326 |
Yes | output | 1 | 51,663 | 1 | 103,327 |
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. Each city has its index — an integer number from 1 to n. The capital has index r1. All the roads in Berland are two-way. The road system is such that there is exac... | instruction | 0 | 51,664 | 1 | 103,328 |
Yes | output | 1 | 51,664 | 1 | 103,329 |
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. Each city has its index — an integer number from 1 to n. The capital has index r1. All the roads in Berland are two-way. The road system is such that there is exac... | instruction | 0 | 51,665 | 1 | 103,330 |
Yes | output | 1 | 51,665 | 1 | 103,331 |
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. Each city has its index — an integer number from 1 to n. The capital has index r1. All the roads in Berland are two-way. The road system is such that there is exac... | instruction | 0 | 51,666 | 1 | 103,332 |
Yes | output | 1 | 51,666 | 1 | 103,333 |
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. Each city has its index — an integer number from 1 to n. The capital has index r1. All the roads in Berland are two-way. The road system is such that there is exac... | instruction | 0 | 51,667 | 1 | 103,334 |
No | output | 1 | 51,667 | 1 | 103,335 |
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. Each city has its index — an integer number from 1 to n. The capital has index r1. All the roads in Berland are two-way. The road system is such that there is exac... | instruction | 0 | 51,668 | 1 | 103,336 |
No | output | 1 | 51,668 | 1 | 103,337 |
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. Each city has its index — an integer number from 1 to n. The capital has index r1. All the roads in Berland are two-way. The road system is such that there is exac... | instruction | 0 | 51,669 | 1 | 103,338 |
No | output | 1 | 51,669 | 1 | 103,339 |
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. Each city has its index — an integer number from 1 to n. The capital has index r1. All the roads in Berland are two-way. The road system is such that there is exac... | instruction | 0 | 51,670 | 1 | 103,340 |
No | output | 1 | 51,670 | 1 | 103,341 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Once upon a time a little frog whose name was Vasya decided to travel around his home swamp. Overall there are n mounds on the swamp, located on one line. The distance between the neighboring mounds is one meter. Vasya wants to visit all the... | instruction | 0 | 51,708 | 1 | 103,416 |
Tags: constructive algorithms
Correct Solution:
```
def main():
t = int(input())
l = 1
r = t
while l < r:
print(f'{l} {r}', end=' ')
l += 1
r -= 1
else:
if l == r:
print(f'{l}')
main()
``` | output | 1 | 51,708 | 1 | 103,417 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Once upon a time a little frog whose name was Vasya decided to travel around his home swamp. Overall there are n mounds on the swamp, located on one line. The distance between the neighboring mounds is one meter. Vasya wants to visit all the... | instruction | 0 | 51,709 | 1 | 103,418 |
Tags: constructive algorithms
Correct Solution:
```
n = int(input())
for i in range(1, n + 1):
if i < n - i + 1:
print(i, n - i + 1)
else:
if n % 2 != 0:
print(i)
break
``` | output | 1 | 51,709 | 1 | 103,419 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Once upon a time a little frog whose name was Vasya decided to travel around his home swamp. Overall there are n mounds on the swamp, located on one line. The distance between the neighboring mounds is one meter. Vasya wants to visit all the... | instruction | 0 | 51,710 | 1 | 103,420 |
Tags: constructive algorithms
Correct Solution:
```
n=int(input())
ans=[0]*n
l=1
r=n
i=0
while i<n:
if i%2==0:
ans[i]=l
l=l+1
else:
ans[i]=r
r=r-1
i=i+1
for i in ans:
print(i,end=" ")
``` | output | 1 | 51,710 | 1 | 103,421 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Once upon a time a little frog whose name was Vasya decided to travel around his home swamp. Overall there are n mounds on the swamp, located on one line. The distance between the neighboring mounds is one meter. Vasya wants to visit all the... | instruction | 0 | 51,711 | 1 | 103,422 |
Tags: constructive algorithms
Correct Solution:
```
n=int(input())
arr=[None]*n
low=1
top=n
for i in range(n):
if i%2==0:
print(low,end=' ')
low+=1
else:
print(top,end=' ')
top-=1
``` | output | 1 | 51,711 | 1 | 103,423 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Once upon a time a little frog whose name was Vasya decided to travel around his home swamp. Overall there are n mounds on the swamp, located on one line. The distance between the neighboring mounds is one meter. Vasya wants to visit all the... | instruction | 0 | 51,712 | 1 | 103,424 |
Tags: constructive algorithms
Correct Solution:
```
n=int(input())
l=1
r=n
x=0
ans=[]
while l<=r:
if x%2!=0:
ans.append(r)
r-=1
else:
ans.append(l)
l+=1
x+=1
print(*ans)
``` | output | 1 | 51,712 | 1 | 103,425 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Once upon a time a little frog whose name was Vasya decided to travel around his home swamp. Overall there are n mounds on the swamp, located on one line. The distance between the neighboring mounds is one meter. Vasya wants to visit all the... | instruction | 0 | 51,713 | 1 | 103,426 |
Tags: constructive algorithms
Correct Solution:
```
import sys
from math import log2,floor,ceil,sqrt
# import bisect
# from collections import deque
Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()
def input(): return sys.stdin.readline().strip()
def list2d(a, b... | output | 1 | 51,713 | 1 | 103,427 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Once upon a time a little frog whose name was Vasya decided to travel around his home swamp. Overall there are n mounds on the swamp, located on one line. The distance between the neighboring mounds is one meter. Vasya wants to visit all the... | instruction | 0 | 51,714 | 1 | 103,428 |
Tags: constructive algorithms
Correct Solution:
```
# import atexit
# import io
# import sys
#
# _INPUT_LINES = sys.stdin.read().splitlines()
# input = iter(_INPUT_LINES).__next__
# _OUTPUT_BUFFER = io.StringIO()
# sys.stdout = _OUTPUT_BUFFER
#
#
# @atexit.register
# def write():
# sys.__stdout__.write(_OUTPUT_BUFF... | output | 1 | 51,714 | 1 | 103,429 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Once upon a time a little frog whose name was Vasya decided to travel around his home swamp. Overall there are n mounds on the swamp, located on one line. The distance between the neighboring mounds is one meter. Vasya wants to visit all the... | instruction | 0 | 51,715 | 1 | 103,430 |
Tags: constructive algorithms
Correct Solution:
```
n = int(input())
x = 1
y = n
while 1:
if x > n // 2:
if n % 2: print(x)
break
print(x, y, end = " ")
x += 1
y -= 1
``` | output | 1 | 51,715 | 1 | 103,431 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Berland has n cities, the capital is located in city s, and the historic home town of the President is in city t (s ≠ t). The cities are connected by one-way roads, the travel time for each of the road is a positive integer.
Once a year the... | instruction | 0 | 51,724 | 1 | 103,448 |
Tags: dfs and similar, graphs, hashing, shortest paths
Correct Solution:
```
from heapq import *
import sys
MOD1 = 1000000007
MOD2 = 1000000123
def addM(a,b):
return ((a[0]+b[0])%MOD1,(a[1]+b[1])%MOD2)
def mulM(a,b):
return ((a[0]*b[0])%MOD1,(a[1]*b[1])%MOD2)
def dijk(adj,n,s):
dist = [10**18]*n
ways... | output | 1 | 51,724 | 1 | 103,449 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Berland has n cities, the capital is located in city s, and the historic home town of the President is in city t (s ≠ t). The cities are connected by one-way roads, the travel time for each of the road is a positive integer.
Once a year the... | instruction | 0 | 51,725 | 1 | 103,450 |
Tags: dfs and similar, graphs, hashing, shortest paths
Correct Solution:
```
from heapq import *
from collections import defaultdict
def D(v,g):
h,p,o=[],defaultdict(lambda:1e99),[]
heappush(h,(0,v))
while h:
l,w=heappop(h)
if w in p:continue
p[w]=l
o.append(w)
for u,L in g[w]:
heappush(h,(L+l,u))
retu... | output | 1 | 51,725 | 1 | 103,451 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Berland has n cities, the capital is located in city s, and the historic home town of the President is in city t (s ≠ t). The cities are connected by one-way roads, the travel time for each of the road is a positive integer.
Once a year the... | instruction | 0 | 51,726 | 1 | 103,452 |
Tags: dfs and similar, graphs, hashing, shortest paths
Correct Solution:
```
from heapq import *
import sys
MOD = 1000000181
def addM(a,b):
return (a+b)%MOD
def mulM(a,b):
return (a*b)%MOD
def dijk(adj,n,s):
dist = [10**18]*n
ways = [0]*n
frontier = []
dist[s] = 0
ways[s] = 1
heappush... | output | 1 | 51,726 | 1 | 103,453 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Berland has n cities, the capital is located in city s, and the historic home town of the President is in city t (s ≠ t). The cities are connected by one-way roads, the travel time for each of the road is a positive integer.
Once a year the... | instruction | 0 | 51,727 | 1 | 103,454 |
Tags: dfs and similar, graphs, hashing, shortest paths
Correct Solution:
```
#!/usr/bin/env python3
import heapq
INF = int(1e18)
MOD = (1 << 64) - 1
class MinHeap:
def __init__(self): self.h = []
def push(self, x): heapq.heappush(self.h, x)
def pop(self): return heapq.heappop(self.h)
def isEmpty(self)... | output | 1 | 51,727 | 1 | 103,455 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Berland has n cities, the capital is located in city s, and the historic home town of the President is in city t (s ≠ t). The cities are connected by one-way roads, the travel time for each of the road is a positive integer.
Once a year the... | instruction | 0 | 51,728 | 1 | 103,456 |
Tags: dfs and similar, graphs, hashing, shortest paths
Correct Solution:
```
import heapq
def dijkstra(a, graph):
shortestPaths = [None] * len(graph)
priorityQueue = []
heapq.heappush(priorityQueue, (0, a))
while len(priorityQueue) != 0:
length, endpoint = heapq.heappop(priorityQueue)
... | output | 1 | 51,728 | 1 | 103,457 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Berland has n cities, the capital is located in city s, and the historic home town of the President is in city t (s ≠ t). The cities are connected by one-way roads, the travel time for each of the road is a positive integer.
Once a year the... | instruction | 0 | 51,729 | 1 | 103,458 |
Tags: dfs and similar, graphs, hashing, shortest paths
Correct Solution:
```
#!/usr/bin/env python3
import heapq
INF = int(1e18)
MOD = (1 << 32) - 1
class MinHeap:
def __init__(self): self.h = []
def push(self, x): heapq.heappush(self.h, x)
def pop(self): return heapq.heappop(self.h)
def isEmpty(self)... | output | 1 | 51,729 | 1 | 103,459 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Berland has n cities, the capital is located in city s, and the historic home town of the President is in city t (s ≠ t). The cities are connected by one-way roads, the travel time for each of t... | instruction | 0 | 51,730 | 1 | 103,460 |
No | output | 1 | 51,730 | 1 | 103,461 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Berland has n cities, the capital is located in city s, and the historic home town of the President is in city t (s ≠ t). The cities are connected by one-way roads, the travel time for each of t... | instruction | 0 | 51,731 | 1 | 103,462 |
No | output | 1 | 51,731 | 1 | 103,463 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Berland has n cities, the capital is located in city s, and the historic home town of the President is in city t (s ≠ t). The cities are connected by one-way roads, the travel time for each of t... | instruction | 0 | 51,732 | 1 | 103,464 |
No | output | 1 | 51,732 | 1 | 103,465 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Berland has n cities, the capital is located in city s, and the historic home town of the President is in city t (s ≠ t). The cities are connected by one-way roads, the travel time for each of t... | instruction | 0 | 51,733 | 1 | 103,466 |
No | output | 1 | 51,733 | 1 | 103,467 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The Department of economic development of IT City created a model of city development till year 2100.
To prepare report about growth perspectives it is required to get growth estimates from the model.
To get the growth estimates it is requ... | instruction | 0 | 51,738 | 1 | 103,476 |
Tags: math
Correct Solution:
```
a, b, c = map(int, input().split())
b /= 2 * a
d = (b * b - c / a) ** 0.5
print(d - b, - b - d)
``` | output | 1 | 51,738 | 1 | 103,477 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The Department of economic development of IT City created a model of city development till year 2100.
To prepare report about growth perspectives it is required to get growth estimates from the model.
To get the growth estimates it is requ... | instruction | 0 | 51,739 | 1 | 103,478 |
Tags: math
Correct Solution:
```
a, b, c = map(int, input().split())
d = (b * b - 4 * a * c)**0.5
x1, x2 = (-b - d) / (2 * a), (-b + d) / (2 * a)
print(max(x1, x2))
print(min(x1, x2))
``` | output | 1 | 51,739 | 1 | 103,479 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The Department of economic development of IT City created a model of city development till year 2100.
To prepare report about growth perspectives it is required to get growth estimates from the model.
To get the growth estimates it is requ... | instruction | 0 | 51,741 | 1 | 103,482 |
Tags: math
Correct Solution:
```
def main():
a, b, c = map(float, input().split())
b *= .5
d = (b * b - a * c) ** .5
res = ((d - b) / a, -(d + b) / a)
print(max(res))
print(min(res))
if __name__ == '__main__':
main()
``` | output | 1 | 51,741 | 1 | 103,483 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The Department of economic development of IT City created a model of city development till year 2100.
To prepare report about growth perspectives it is required to get growth estimates from the model.
To get the growth estimates it is requ... | instruction | 0 | 51,743 | 1 | 103,486 |
Tags: math
Correct Solution:
```
import math
a,b,c = map(int,input().split())
d = b*b - 4*a*c
x1 = (-b+math.sqrt(d))/(2*a)
x2 = (-b-math.sqrt(d))/(2*a)
print(max(x1,x2),min(x1,x2))
``` | output | 1 | 51,743 | 1 | 103,487 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The Department of economic development of IT City created a model of city development till year 2100.
To prepare report about growth perspectives it is required to get growth estimates from the model.
To get the growth estimates it is requ... | instruction | 0 | 51,744 | 1 | 103,488 |
Tags: math
Correct Solution:
```
import math
a,b,c=map(int,input().split())
p=(-1*b + (b**2 - 4*a*c)**0.5)/(2*a)
q=(-1*b - (b**2 - 4*a*c)**0.5)/(2*a)
print(max(p,q))
print(min(p,q))
``` | output | 1 | 51,744 | 1 | 103,489 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The country Treeland consists of n cities connected with n - 1 bidirectional roads in such a way that it's possible to reach every city starting from any other city using these roads. There will... | instruction | 0 | 51,793 | 1 | 103,586 |
No | output | 1 | 51,793 | 1 | 103,587 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Petya loves volleyball very much. One day he was running late for a volleyball match. Petya hasn't bought his own car yet, that's why he had to take a taxi. The city has n junctions, some of which are connected by two-way roads. The length o... | instruction | 0 | 51,892 | 1 | 103,784 |
Tags: shortest paths
Correct Solution:
```
from heapq import *
f = lambda: map(int, input().split())
inf = 1e13
n, m = f()
x, y = f()
p = [[] for i in range(n + 1)]
for j in range(m):
u, v, w = f()
p[u].append((v, w))
p[v].append((u, w))
d = [(0, 0)] + [tuple(f()) for k in range(n)]
C, T = {x: 0}, {x: 0}... | output | 1 | 51,892 | 1 | 103,785 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Petya loves volleyball very much. One day he was running late for a volleyball match. Petya hasn't bought his own car yet, that's why he had to take a taxi. The city has n junctions, some of which are connected by two-way roads. The length o... | instruction | 0 | 51,893 | 1 | 103,786 |
Tags: shortest paths
Correct Solution:
```
import os
import sys
from io import BytesIO, IOBase
# region fastio
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._fd = file.fileno()
self.buffer = BytesIO()
self.writable = "x" in file.mode or "r" not in fi... | output | 1 | 51,893 | 1 | 103,787 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.