message stringlengths 2 45.8k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 254 108k | cluster float64 3 3 | __index_level_0__ int64 508 217k |
|---|---|---|---|---|---|
Provide a correct Python 3 solution for this coding contest problem.
problem
A mysterious $ X $ [cm] plant grows in one place. This plant has the following mysterious properties.
* Say "nobiro" to this plant and it will grow $ A $ [cm].
* Say "tidime" to this plant and it will grow $ B $ [cm].
* If you say "karero" ... | instruction | 0 | 43,781 | 3 | 87,562 |
"Correct Solution:
```
X,A,B = map(int,input().split())
N = int(input())
for i in range(N):
S = input()
if S == "nobiro":
X += A
elif S == "tidime":
X += B
else:
X = 0
if X < 0:
X = 0
print(X)
``` | output | 1 | 43,781 | 3 | 87,563 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Jack is working on his jumping skills recently. Currently he's located at point zero of the number line. He would like to get to the point x. In order to train, he has decided that he'll first j... | instruction | 0 | 43,919 | 3 | 87,838 |
Yes | output | 1 | 43,919 | 3 | 87,839 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Jack is working on his jumping skills recently. Currently he's located at point zero of the number line. He would like to get to the point x. In order to train, he has decided that he'll first j... | instruction | 0 | 43,921 | 3 | 87,842 |
Yes | output | 1 | 43,921 | 3 | 87,843 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Jack is working on his jumping skills recently. Currently he's located at point zero of the number line. He would like to get to the point x. In order to train, he has decided that he'll first j... | instruction | 0 | 43,922 | 3 | 87,844 |
Yes | output | 1 | 43,922 | 3 | 87,845 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Jack is working on his jumping skills recently. Currently he's located at point zero of the number line. He would like to get to the point x. In order to train, he has decided that he'll first j... | instruction | 0 | 43,923 | 3 | 87,846 |
No | output | 1 | 43,923 | 3 | 87,847 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Jack is working on his jumping skills recently. Currently he's located at point zero of the number line. He would like to get to the point x. In order to train, he has decided that he'll first j... | instruction | 0 | 43,924 | 3 | 87,848 |
No | output | 1 | 43,924 | 3 | 87,849 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Jack is working on his jumping skills recently. Currently he's located at point zero of the number line. He would like to get to the point x. In order to train, he has decided that he'll first j... | instruction | 0 | 43,925 | 3 | 87,850 |
No | output | 1 | 43,925 | 3 | 87,851 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Jack is working on his jumping skills recently. Currently he's located at point zero of the number line. He would like to get to the point x. In order to train, he has decided that he'll first j... | instruction | 0 | 43,926 | 3 | 87,852 |
No | output | 1 | 43,926 | 3 | 87,853 |
Provide tags and a correct Python 3 solution for this coding contest problem.
In the evenings Donkey would join Shrek to look at the stars. They would sit on a log, sipping tea and they would watch the starry sky. The sky hung above the roof, right behind the chimney. Shrek's stars were to the right of the chimney and... | instruction | 0 | 44,124 | 3 | 88,248 |
Tags: data structures, dp, geometry, math, sortings
Correct Solution:
```
from bisect import *
from math import *
n = int(input())
a, b, c, d = map(int,input().replace('/',' ').split())
alpha = atan2(c,d) - atan2(a,b)
tan_alpha = tan(alpha)
lis = []
for x,y in sorted((y/tan_alpha - x,y) for x,y in [ (x,y) for x,y i... | output | 1 | 44,124 | 3 | 88,249 |
Provide tags and a correct Python 3 solution for this coding contest problem.
In the evenings Donkey would join Shrek to look at the stars. They would sit on a log, sipping tea and they would watch the starry sky. The sky hung above the roof, right behind the chimney. Shrek's stars were to the right of the chimney and... | instruction | 0 | 44,125 | 3 | 88,250 |
Tags: data structures, dp, geometry, math, sortings
Correct Solution:
```
import bisect
def INPUT():
global n, a, b, c, d
n = int(input())
a, b, c, d = [int(j) for i in input().split() for j in i.split("/")]
global y_alpha
y_alpha = []
for _ in range(n):
x, y = [int(x) for x in input().split()]
y_alpha.appen... | output | 1 | 44,125 | 3 | 88,251 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In the evenings Donkey would join Shrek to look at the stars. They would sit on a log, sipping tea and they would watch the starry sky. The sky hung above the roof, right behind the chimney. Shr... | instruction | 0 | 44,126 | 3 | 88,252 |
No | output | 1 | 44,126 | 3 | 88,253 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In the evenings Donkey would join Shrek to look at the stars. They would sit on a log, sipping tea and they would watch the starry sky. The sky hung above the roof, right behind the chimney. Shr... | instruction | 0 | 44,127 | 3 | 88,254 |
No | output | 1 | 44,127 | 3 | 88,255 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In the evenings Donkey would join Shrek to look at the stars. They would sit on a log, sipping tea and they would watch the starry sky. The sky hung above the roof, right behind the chimney. Shr... | instruction | 0 | 44,128 | 3 | 88,256 |
No | output | 1 | 44,128 | 3 | 88,257 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In the evenings Donkey would join Shrek to look at the stars. They would sit on a log, sipping tea and they would watch the starry sky. The sky hung above the roof, right behind the chimney. Shr... | instruction | 0 | 44,129 | 3 | 88,258 |
No | output | 1 | 44,129 | 3 | 88,259 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Amr lives in Lala Land. Lala Land is a very beautiful country that is located on a coordinate line. Lala Land is famous with its apple trees growing everywhere.
Lala Land has exactly n apple tr... | instruction | 0 | 44,247 | 3 | 88,494 |
Yes | output | 1 | 44,247 | 3 | 88,495 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Amr lives in Lala Land. Lala Land is a very beautiful country that is located on a coordinate line. Lala Land is famous with its apple trees growing everywhere.
Lala Land has exactly n apple tr... | instruction | 0 | 44,248 | 3 | 88,496 |
Yes | output | 1 | 44,248 | 3 | 88,497 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Amr lives in Lala Land. Lala Land is a very beautiful country that is located on a coordinate line. Lala Land is famous with its apple trees growing everywhere.
Lala Land has exactly n apple tr... | instruction | 0 | 44,249 | 3 | 88,498 |
Yes | output | 1 | 44,249 | 3 | 88,499 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Amr lives in Lala Land. Lala Land is a very beautiful country that is located on a coordinate line. Lala Land is famous with its apple trees growing everywhere.
Lala Land has exactly n apple tr... | instruction | 0 | 44,250 | 3 | 88,500 |
Yes | output | 1 | 44,250 | 3 | 88,501 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Amr lives in Lala Land. Lala Land is a very beautiful country that is located on a coordinate line. Lala Land is famous with its apple trees growing everywhere.
Lala Land has exactly n apple tr... | instruction | 0 | 44,251 | 3 | 88,502 |
No | output | 1 | 44,251 | 3 | 88,503 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Amr lives in Lala Land. Lala Land is a very beautiful country that is located on a coordinate line. Lala Land is famous with its apple trees growing everywhere.
Lala Land has exactly n apple tr... | instruction | 0 | 44,252 | 3 | 88,504 |
No | output | 1 | 44,252 | 3 | 88,505 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Amr lives in Lala Land. Lala Land is a very beautiful country that is located on a coordinate line. Lala Land is famous with its apple trees growing everywhere.
Lala Land has exactly n apple tr... | instruction | 0 | 44,253 | 3 | 88,506 |
No | output | 1 | 44,253 | 3 | 88,507 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Amr lives in Lala Land. Lala Land is a very beautiful country that is located on a coordinate line. Lala Land is famous with its apple trees growing everywhere.
Lala Land has exactly n apple tr... | instruction | 0 | 44,254 | 3 | 88,508 |
No | output | 1 | 44,254 | 3 | 88,509 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Real Cosmic Communications is the largest telecommunication company on a far far away planet, located at the very edge of the universe. RCC launches communication satellites.
The planet is at t... | instruction | 0 | 44,364 | 3 | 88,728 |
No | output | 1 | 44,364 | 3 | 88,729 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Andrew's favourite Krakozyabra has recenly fled away and now he's eager to bring it back!
At the moment the refugee is inside an icy cave with n icicles dangling from the ceiling located in int... | instruction | 0 | 44,401 | 3 | 88,802 |
No | output | 1 | 44,401 | 3 | 88,803 |
Provide a correct Python 3 solution for this coding contest problem.
Nathan O. Davis is challenging a kind of shooter game. In this game, enemies emit laser beams from outside of the screen. A laser beam is a straight line with a certain thickness. Nathan moves a circular-shaped machine within the screen, in such a wa... | instruction | 0 | 44,609 | 3 | 89,218 |
"Correct Solution:
```
import sys
readline = sys.stdin.readline
write = sys.stdout.write
def cross_point(p0, q0, p1, q1):
x0, y0 = p0; x1, y1 = q0
x2, y2 = p1; x3, y3 = q1
dx0 = x1 - x0
dy0 = y1 - y0
dx1 = x3 - x2
dy1 = y3 - y2
s = (y0-y2)*dx1 - (x0-x2)*dy1
sm = dx0*dy1 - dy0*dx1
i... | output | 1 | 44,609 | 3 | 89,219 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
As you know, lemmings like jumping. For the next spectacular group jump n lemmings gathered near a high rock with k comfortable ledges on it. The first ledge is situated at the height of h meter... | instruction | 0 | 44,853 | 3 | 89,706 |
No | output | 1 | 44,853 | 3 | 89,707 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
As you know, lemmings like jumping. For the next spectacular group jump n lemmings gathered near a high rock with k comfortable ledges on it. The first ledge is situated at the height of h meter... | instruction | 0 | 44,854 | 3 | 89,708 |
No | output | 1 | 44,854 | 3 | 89,709 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
As you know, lemmings like jumping. For the next spectacular group jump n lemmings gathered near a high rock with k comfortable ledges on it. The first ledge is situated at the height of h meter... | instruction | 0 | 44,855 | 3 | 89,710 |
No | output | 1 | 44,855 | 3 | 89,711 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
As you know, lemmings like jumping. For the next spectacular group jump n lemmings gathered near a high rock with k comfortable ledges on it. The first ledge is situated at the height of h meter... | instruction | 0 | 44,856 | 3 | 89,712 |
No | output | 1 | 44,856 | 3 | 89,713 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Goa'uld Apophis captured Jack O'Neill's team again! Jack himself was able to escape, but by that time Apophis's ship had already jumped to hyperspace. But Jack knows on what planet will Apophis land. In order to save his friends, Jack must r... | instruction | 0 | 44,857 | 3 | 89,714 |
Tags: binary search, data structures, graphs, shortest paths
Correct Solution:
```
from heapq import *
n, m = map(int, input().split())
l = []
from copy import *
from bisect import *
from math import *
from sys import *
for _ in range(0, n + 2):
l.append([])
for i in range(0, m):
a, b, c = map(int, stdin.readl... | output | 1 | 44,857 | 3 | 89,715 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Goa'uld Apophis captured Jack O'Neill's team again! Jack himself was able to escape, but by that time Apophis's ship had already jumped to hyperspace. But Jack knows on what planet will Apophis ... | instruction | 0 | 44,858 | 3 | 89,716 |
No | output | 1 | 44,858 | 3 | 89,717 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Goa'uld Apophis captured Jack O'Neill's team again! Jack himself was able to escape, but by that time Apophis's ship had already jumped to hyperspace. But Jack knows on what planet will Apophis ... | instruction | 0 | 44,859 | 3 | 89,718 |
No | output | 1 | 44,859 | 3 | 89,719 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Scott Lang is at war with Darren Cross. There are n chairs in a hall where they are, numbered with 1, 2, ..., n from left to right. The i-th chair is located at coordinate xi. Scott is on chair ... | instruction | 0 | 45,011 | 3 | 90,022 |
No | output | 1 | 45,011 | 3 | 90,023 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Scott Lang is at war with Darren Cross. There are n chairs in a hall where they are, numbered with 1, 2, ..., n from left to right. The i-th chair is located at coordinate xi. Scott is on chair ... | instruction | 0 | 45,012 | 3 | 90,024 |
No | output | 1 | 45,012 | 3 | 90,025 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Scott Lang is at war with Darren Cross. There are n chairs in a hall where they are, numbered with 1, 2, ..., n from left to right. The i-th chair is located at coordinate xi. Scott is on chair ... | instruction | 0 | 45,013 | 3 | 90,026 |
No | output | 1 | 45,013 | 3 | 90,027 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Scott Lang is at war with Darren Cross. There are n chairs in a hall where they are, numbered with 1, 2, ..., n from left to right. The i-th chair is located at coordinate xi. Scott is on chair ... | instruction | 0 | 45,014 | 3 | 90,028 |
No | output | 1 | 45,014 | 3 | 90,029 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You have n devices that you want to use simultaneously.
The i-th device uses ai units of power per second. This usage is continuous. That is, in λ seconds, the device will use λ·ai units of power. The i-th device currently has bi units of p... | instruction | 0 | 45,047 | 3 | 90,094 |
Tags: binary search, math
Correct Solution:
```
class SmartReader:
def __init__(self):
self.buf = iter([])
def read(self, *factories):
for factory in factories:
yield self._next(factory)
def _next(self, factory=str):
res = next(self.buf, None)
if res is None:
... | output | 1 | 45,047 | 3 | 90,095 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You have n devices that you want to use simultaneously.
The i-th device uses ai units of power per second. This usage is continuous. That is, in λ seconds, the device will use λ·ai units of power. The i-th device currently has bi units of p... | instruction | 0 | 45,048 | 3 | 90,096 |
Tags: binary search, math
Correct Solution:
```
def f(N,P,A,B):
sa = sum(A) - P
if(sa<=0):
return -1
sb = sum(B)
AB = sorted([(A[i],B[i]) for i in range(N)], key = lambda x: -(x[1]/x[0]))
for a, b in AB:
if sa -a <= 0.0:
continue
if((sb-b)/(sa-a)) <= b/a:
... | output | 1 | 45,048 | 3 | 90,097 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You have n devices that you want to use simultaneously.
The i-th device uses ai units of power per second. This usage is continuous. That is, in λ seconds, the device will use λ·ai units of power. The i-th device currently has bi units of p... | instruction | 0 | 45,049 | 3 | 90,098 |
Tags: binary search, math
Correct Solution:
```
def check_infinite(N,P,A,B):
if sum(A) <= P:
return True
return False
def f(N,P,A,B):
if check_infinite(N,P,A,B) == True:
return -1
AB = [(i,A[i],B[i]) for i in range(N)]
AB.sort(key = lambda x: -(x[2]/x[1]))
Ord = [x[0] for x in ... | output | 1 | 45,049 | 3 | 90,099 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You have n devices that you want to use simultaneously.
The i-th device uses ai units of power per second. This usage is continuous. That is, in λ seconds, the device will use λ·ai units of power. The i-th device currently has bi units of p... | instruction | 0 | 45,050 | 3 | 90,100 |
Tags: binary search, math
Correct Solution:
```
f = lambda: map(int, input().split())
n, p = f()
s = [0] * n
x, y = -p, 0
for i in range(n):
a, b = f()
x += a
y += b
s[i] = (a, b)
s.sort(key=lambda q: q[0] / q[1])
for a, b in s:
if b * x > a * y:
x -= a
y -= b
print(y / x if x > 0 e... | output | 1 | 45,050 | 3 | 90,101 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You have n devices that you want to use simultaneously.
The i-th device uses ai units of power per second. This usage is continuous. That is, in λ seconds, the device will use λ·ai units of power. The i-th device currently has bi units of p... | instruction | 0 | 45,051 | 3 | 90,102 |
Tags: binary search, math
Correct Solution:
```
from math import inf
n, p = [int(x) for x in input().split()]
l = []
for i in range(n):
a, b = [int(x) for x in input().split()]
l.append((a, b, b/a))
l.sort(key=lambda x: x[2])
asum = 0
bsum = 0
sumt = 0
for i in range(n):
a0, b0, _ = l[i]
c1 = inf if i =... | output | 1 | 45,051 | 3 | 90,103 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You have n devices that you want to use simultaneously.
The i-th device uses ai units of power per second. This usage is continuous. That is, in λ seconds, the device will use λ·ai units of power. The i-th device currently has bi units of p... | instruction | 0 | 45,052 | 3 | 90,104 |
Tags: binary search, math
Correct Solution:
```
def check_infinite(N,P,A,B):
if sum(A) <= P:
return True
return False
def f(N,P,A,B):
if check_infinite(N,P,A,B) == True:
return -1
AB = [(i,A[i],B[i]) for i in range(N)]
AB.sort(key = lambda x: -(x[2]/x[1]))
Ord = [x[0] for x in ... | output | 1 | 45,052 | 3 | 90,105 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You have n devices that you want to use simultaneously.
The i-th device uses ai units of power per second. This usage is continuous. That is, in λ seconds, the device will use λ·ai units of power. The i-th device currently has bi units of p... | instruction | 0 | 45,053 | 3 | 90,106 |
Tags: binary search, math
Correct Solution:
```
import sys
input=sys.stdin.readline
n,p=map(int,input().split())
a=[0]*n
b=[0]*n
for i in range(n):
a[i],b[i]=map(int,input().split())
s=sum(a)
if s<=p:
print(-1)
exit()
t=[b[i]/a[i] for i in range(n)]
INF=10**10+1
l=0
r=INF
while r-l>10**(-5):
x=l+(r-l)/2... | output | 1 | 45,053 | 3 | 90,107 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You have n devices that you want to use simultaneously.
The i-th device uses ai units of power per second. This usage is continuous. That is, in λ seconds, the device will use λ·ai units of power. The i-th device currently has bi units of p... | instruction | 0 | 45,054 | 3 | 90,108 |
Tags: binary search, math
Correct Solution:
```
from sys import stdin, stdout
n,p = map(int, stdin.readline().rstrip().split())
powerData = []
powerList = []
for i in range(n):
a,b = map(int, stdin.readline().rstrip().split())
deathTime = b/a
powerData.append((a,b,deathTime))
powerList.append(a)
pow... | output | 1 | 45,054 | 3 | 90,109 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have n devices that you want to use simultaneously.
The i-th device uses ai units of power per second. This usage is continuous. That is, in λ seconds, the device will use λ·ai units of pow... | instruction | 0 | 45,055 | 3 | 90,110 |
Yes | output | 1 | 45,055 | 3 | 90,111 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have n devices that you want to use simultaneously.
The i-th device uses ai units of power per second. This usage is continuous. That is, in λ seconds, the device will use λ·ai units of pow... | instruction | 0 | 45,056 | 3 | 90,112 |
Yes | output | 1 | 45,056 | 3 | 90,113 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have n devices that you want to use simultaneously.
The i-th device uses ai units of power per second. This usage is continuous. That is, in λ seconds, the device will use λ·ai units of pow... | instruction | 0 | 45,057 | 3 | 90,114 |
Yes | output | 1 | 45,057 | 3 | 90,115 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have n devices that you want to use simultaneously.
The i-th device uses ai units of power per second. This usage is continuous. That is, in λ seconds, the device will use λ·ai units of pow... | instruction | 0 | 45,058 | 3 | 90,116 |
Yes | output | 1 | 45,058 | 3 | 90,117 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have n devices that you want to use simultaneously.
The i-th device uses ai units of power per second. This usage is continuous. That is, in λ seconds, the device will use λ·ai units of pow... | instruction | 0 | 45,059 | 3 | 90,118 |
No | output | 1 | 45,059 | 3 | 90,119 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have n devices that you want to use simultaneously.
The i-th device uses ai units of power per second. This usage is continuous. That is, in λ seconds, the device will use λ·ai units of pow... | instruction | 0 | 45,060 | 3 | 90,120 |
No | output | 1 | 45,060 | 3 | 90,121 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.