message stringlengths 2 48.6k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 318 108k | cluster float64 8 8 | __index_level_0__ int64 636 217k |
|---|---|---|---|---|---|
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
For god's sake, you're boxes with legs! It is literally your only purpose! Walking onto buttons! How can you not do the one thing you were designed for?
Oh, that's funny, is it? Oh it's funny? ... | instruction | 0 | 1,841 | 8 | 3,682 |
Yes | output | 1 | 1,841 | 8 | 3,683 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
For god's sake, you're boxes with legs! It is literally your only purpose! Walking onto buttons! How can you not do the one thing you were designed for?
Oh, that's funny, is it? Oh it's funny? ... | instruction | 0 | 1,842 | 8 | 3,684 |
Yes | output | 1 | 1,842 | 8 | 3,685 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
For god's sake, you're boxes with legs! It is literally your only purpose! Walking onto buttons! How can you not do the one thing you were designed for?
Oh, that's funny, is it? Oh it's funny? ... | instruction | 0 | 1,843 | 8 | 3,686 |
Yes | output | 1 | 1,843 | 8 | 3,687 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
For god's sake, you're boxes with legs! It is literally your only purpose! Walking onto buttons! How can you not do the one thing you were designed for?
Oh, that's funny, is it? Oh it's funny? ... | instruction | 0 | 1,844 | 8 | 3,688 |
Yes | output | 1 | 1,844 | 8 | 3,689 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
For god's sake, you're boxes with legs! It is literally your only purpose! Walking onto buttons! How can you not do the one thing you were designed for?
Oh, that's funny, is it? Oh it's funny? ... | instruction | 0 | 1,845 | 8 | 3,690 |
No | output | 1 | 1,845 | 8 | 3,691 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
For god's sake, you're boxes with legs! It is literally your only purpose! Walking onto buttons! How can you not do the one thing you were designed for?
Oh, that's funny, is it? Oh it's funny? ... | instruction | 0 | 1,846 | 8 | 3,692 |
No | output | 1 | 1,846 | 8 | 3,693 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
For god's sake, you're boxes with legs! It is literally your only purpose! Walking onto buttons! How can you not do the one thing you were designed for?
Oh, that's funny, is it? Oh it's funny? ... | instruction | 0 | 1,847 | 8 | 3,694 |
No | output | 1 | 1,847 | 8 | 3,695 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
For god's sake, you're boxes with legs! It is literally your only purpose! Walking onto buttons! How can you not do the one thing you were designed for?
Oh, that's funny, is it? Oh it's funny? ... | instruction | 0 | 1,848 | 8 | 3,696 |
No | output | 1 | 1,848 | 8 | 3,697 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
This is an interactive problem.
Igor wants to find the key to Olha's heart. The problem is, that it's at the root of a binary tree.
There is a perfect binary tree of height h consisting of n =... | instruction | 0 | 1,849 | 8 | 3,698 |
No | output | 1 | 1,849 | 8 | 3,699 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
This is an interactive problem.
Igor wants to find the key to Olha's heart. The problem is, that it's at the root of a binary tree.
There is a perfect binary tree of height h consisting of n =... | instruction | 0 | 1,850 | 8 | 3,700 |
No | output | 1 | 1,850 | 8 | 3,701 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
This is an interactive problem.
Igor wants to find the key to Olha's heart. The problem is, that it's at the root of a binary tree.
There is a perfect binary tree of height h consisting of n =... | instruction | 0 | 1,851 | 8 | 3,702 |
No | output | 1 | 1,851 | 8 | 3,703 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
This is an interactive problem.
Igor wants to find the key to Olha's heart. The problem is, that it's at the root of a binary tree.
There is a perfect binary tree of height h consisting of n =... | instruction | 0 | 1,852 | 8 | 3,704 |
No | output | 1 | 1,852 | 8 | 3,705 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
During her tantrums the princess usually smashes some collectable porcelain. Every furious shriek is accompanied with one item smashed.
The collection of porcelain is arranged neatly on n shelv... | instruction | 0 | 1,877 | 8 | 3,754 |
Yes | output | 1 | 1,877 | 8 | 3,755 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
During her tantrums the princess usually smashes some collectable porcelain. Every furious shriek is accompanied with one item smashed.
The collection of porcelain is arranged neatly on n shelv... | instruction | 0 | 1,878 | 8 | 3,756 |
Yes | output | 1 | 1,878 | 8 | 3,757 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
During her tantrums the princess usually smashes some collectable porcelain. Every furious shriek is accompanied with one item smashed.
The collection of porcelain is arranged neatly on n shelv... | instruction | 0 | 1,879 | 8 | 3,758 |
Yes | output | 1 | 1,879 | 8 | 3,759 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
During her tantrums the princess usually smashes some collectable porcelain. Every furious shriek is accompanied with one item smashed.
The collection of porcelain is arranged neatly on n shelv... | instruction | 0 | 1,880 | 8 | 3,760 |
Yes | output | 1 | 1,880 | 8 | 3,761 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
During her tantrums the princess usually smashes some collectable porcelain. Every furious shriek is accompanied with one item smashed.
The collection of porcelain is arranged neatly on n shelv... | instruction | 0 | 1,881 | 8 | 3,762 |
No | output | 1 | 1,881 | 8 | 3,763 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
During her tantrums the princess usually smashes some collectable porcelain. Every furious shriek is accompanied with one item smashed.
The collection of porcelain is arranged neatly on n shelv... | instruction | 0 | 1,882 | 8 | 3,764 |
No | output | 1 | 1,882 | 8 | 3,765 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
During her tantrums the princess usually smashes some collectable porcelain. Every furious shriek is accompanied with one item smashed.
The collection of porcelain is arranged neatly on n shelv... | instruction | 0 | 1,883 | 8 | 3,766 |
No | output | 1 | 1,883 | 8 | 3,767 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
During her tantrums the princess usually smashes some collectable porcelain. Every furious shriek is accompanied with one item smashed.
The collection of porcelain is arranged neatly on n shelv... | instruction | 0 | 1,884 | 8 | 3,768 |
No | output | 1 | 1,884 | 8 | 3,769 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today you are to solve the problem even the famous Hercule Poirot can't cope with! That's why this crime has not yet been solved and this story was never included in Agatha Christie's detective story books.
You are not informed on what cri... | instruction | 0 | 1,987 | 8 | 3,974 |
Tags: dsu, graphs
Correct Solution:
```
def solve(n,m,k,edge_list,house_members):
room_sets=[i for i in range(n)]
valid_move=[True for i in range(n)]
room_status=[ [1<<i,0,[]] for i in range(n)]
# room_status[i]->informacion de todo otro cuarto,persona y llave alcanzable para el cuarto i
# room_stat... | output | 1 | 1,987 | 8 | 3,975 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today you are to solve the problem even the famous Hercule Poirot can't cope with! That's why this crime has not yet been solved and this story was never included in Agatha Christie's detective ... | instruction | 0 | 1,988 | 8 | 3,976 |
No | output | 1 | 1,988 | 8 | 3,977 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they couldn't stay in the right places.
The robber gir... | instruction | 0 | 2,091 | 8 | 4,182 |
Tags: constructive algorithms, implementation, sortings
Correct Solution:
```
def main():
n = int(input())
seq = [int(c) for c in input().split()]
ans = []
m = n - 1
while m > 0:
for i in range(m):
if seq[i + 1] < seq[i]:
seq[i + 1], seq[i] = seq[i], seq[i + 1]
... | output | 1 | 2,091 | 8 | 4,183 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they couldn't stay in the right places.
The robber gir... | instruction | 0 | 2,092 | 8 | 4,184 |
Tags: constructive algorithms, implementation, sortings
Correct Solution:
```
n=int(input())
t=list(map(int,input().split()))
for i in range(n):
a=sorted((t[j],j) for j in range(n))
x,j=a[i]
if j>i:
for k in range(j,i,-1):
print(k,k+1)
t[k],t[k-1]=t[k-1],t[k]
``` | output | 1 | 2,092 | 8 | 4,185 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they couldn't stay in the right places.
The robber gir... | instruction | 0 | 2,093 | 8 | 4,186 |
Tags: constructive algorithms, implementation, sortings
Correct Solution:
```
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
for j in range(n - i - 1):
if a[j] > a[j + 1]:
a[j], a[j + 1] = a[j + 1], a[j]
print(j + 1, j + 2)
``` | output | 1 | 2,093 | 8 | 4,187 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they couldn't stay in the right places.
The robber gir... | instruction | 0 | 2,094 | 8 | 4,188 |
Tags: constructive algorithms, implementation, sortings
Correct Solution:
```
import os
n = int(input())
a = list(map(int, input().split(' ')))
s = []
for i in range (n, -1, -1):
for j in range(i-1):
if a[j] <= a[j+1]:
continue
a[j], a[j+1] = a[j+1], a[j]
s.append('{} {}'.format(... | output | 1 | 2,094 | 8 | 4,189 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they couldn't stay in the right places.
The robber gir... | instruction | 0 | 2,095 | 8 | 4,190 |
Tags: constructive algorithms, implementation, sortings
Correct Solution:
```
n = int(input())
l = list(map(int, input().split()))
while l != list(sorted(l)):
for i in range(len(l)-1):
if l[i] > l[i+1]:
temp = l[i]
l[i] = l[i+1]
l[i+1] = temp
print(i+1, i+2)
... | output | 1 | 2,095 | 8 | 4,191 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they couldn't stay in the right places.
The robber gir... | instruction | 0 | 2,096 | 8 | 4,192 |
Tags: constructive algorithms, implementation, sortings
Correct Solution:
```
n = int(input())
a = [int(s) for s in input().split()]
for j in range(n):
k = 0
i = 0
while i < n-1:
if a[i] > a[i+1]:
k += 1
tmp = a[i]
a[i] = a[i+1]
a[i+1] = tmp
... | output | 1 | 2,096 | 8 | 4,193 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they couldn't stay in the right places.
The robber gir... | instruction | 0 | 2,097 | 8 | 4,194 |
Tags: constructive algorithms, implementation, sortings
Correct Solution:
```
from sys import stdin,stdout
n=int(stdin.readline().strip())
#n,m=map(int,stdin.readline().strip().split())
s=list(map(int,stdin.readline().strip().split()))
flag=True
while flag:
flag=False
x=0
while x<n-1:
if s[x]>s[x+1... | output | 1 | 2,097 | 8 | 4,195 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they cou... | instruction | 0 | 2,099 | 8 | 4,198 |
Yes | output | 1 | 2,099 | 8 | 4,199 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they cou... | instruction | 0 | 2,100 | 8 | 4,200 |
Yes | output | 1 | 2,100 | 8 | 4,201 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they cou... | instruction | 0 | 2,101 | 8 | 4,202 |
Yes | output | 1 | 2,101 | 8 | 4,203 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they cou... | instruction | 0 | 2,102 | 8 | 4,204 |
Yes | output | 1 | 2,102 | 8 | 4,205 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they cou... | instruction | 0 | 2,103 | 8 | 4,206 |
No | output | 1 | 2,103 | 8 | 4,207 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they cou... | instruction | 0 | 2,104 | 8 | 4,208 |
No | output | 1 | 2,104 | 8 | 4,209 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they cou... | instruction | 0 | 2,105 | 8 | 4,210 |
No | output | 1 | 2,105 | 8 | 4,211 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they cou... | instruction | 0 | 2,106 | 8 | 4,212 |
No | output | 1 | 2,106 | 8 | 4,213 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Arkadiy has lots square photos with size a Γ a. He wants to put some of them on a rectangular wall with size h Γ w.
The photos which Arkadiy will put on the wall must form a rectangular grid and the distances between neighboring vertically... | instruction | 0 | 2,140 | 8 | 4,280 |
Tags: *special, number theory
Correct Solution:
```
def gcd(x,y):
if y==0:return x
else:return gcd(y,x%y)
A,H,W=map(int,input().split())
G=gcd(A+H,A+W)
S=(A+W)//G
T=((W//A+1)//S)*S-1
if T<=0:print(-1)
else:print("%.10lf"%((W-T*A)/(T+1)))
``` | output | 1 | 2,140 | 8 | 4,281 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Arkadiy has lots square photos with size a Γ a. He wants to put some of them on a rectangular wall with size h Γ w.
The photos which Arkadiy will put on the wall must form a rectangular grid and the distances between neighboring vertically... | instruction | 0 | 2,141 | 8 | 4,282 |
Tags: *special, number theory
Correct Solution:
```
def gcd(x,y):
if (x%y==0): return y
return gcd(y,x%y)
a,h,w=input().split()
a=int(a)
h=int(h)
w=int(w)
g=gcd(h+a,w+a)
if (g<a or h<a or w<a):
print("-1")
else:
print(g/(g//a)-a)
``` | output | 1 | 2,141 | 8 | 4,283 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Arkadiy has lots square photos with size a Γ a. He wants to put some of them on a rectangular wall with size h Γ w.
The photos which Arkadiy will put on the wall must form a rectangular grid and the distances between neighboring vertically... | instruction | 0 | 2,142 | 8 | 4,284 |
Tags: *special, number theory
Correct Solution:
```
a,h,w=(int(x) for x in input().split())
if h==w:
if a<h:
n=w//a
x=(w-a*n)/(n+1)
print(x)
elif a==h:
print(0)
else:
print(-1)
else:
for i in range(100):
if h>w:
w,h=h,w
if w>h+a*2:
... | output | 1 | 2,142 | 8 | 4,285 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Arkadiy has lots square photos with size a Γ a. He wants to put some of them on a rectangular wall with size h Γ w.
The photos which Arkadiy will put on the wall must form a rectangular grid and the distances between neighboring vertically... | instruction | 0 | 2,143 | 8 | 4,286 |
Tags: *special, number theory
Correct Solution:
```
def gcd(a,b):
if(b==0):return a;
else: return gcd(b,a%b);
def main():
a,h,w=map(int,input().split());
x=gcd(a+h,a+w);
y=(a+w)//x;
z=((w//a+1)//y)*y-1;
if(z<=0): print("-1");
else: print("%.10lf"%((1.00*w-z*a)/(z+1)));
main();
``` | output | 1 | 2,143 | 8 | 4,287 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Arkadiy has lots square photos with size a Γ a. He wants to put some of them on a rectangular wall with size h Γ w.
The photos which Arkadiy will put on the wall must form a rectangular grid and the distances between neighboring vertically... | instruction | 0 | 2,144 | 8 | 4,288 |
Tags: *special, number theory
Correct Solution:
```
def gcd(n,m):
if m==0:return n
else:return gcd(m,n%m)
a,h,w=map(int,input().split())
g=gcd(a+h,a+w)
s=(a+w)//g
t=((w//a+1)//s)*s-1
if t<=0:print(-1)
else:print("%.10lf"%((w-t*a)/(t+1)))
``` | output | 1 | 2,144 | 8 | 4,289 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Arkadiy has lots square photos with size a Γ a. He wants to put some of them on a rectangular wall with size h Γ w.
The photos which Arkadiy will put on the wall must form a rectangular grid and the distances between neighboring vertically... | instruction | 0 | 2,145 | 8 | 4,290 |
Tags: *special, number theory
Correct Solution:
```
def gcd(a,b):
if b==0:return a
else:return gcd(b,a%b)
a,h,w=map(int,input().split())
g=gcd(a+h,a+w)
t=(a+w)//g
q=((w//a+1)//t)*t-1
if q<=0:print(-1)
else:print("%.9lf"%((w-q*a)/(q+1)))
``` | output | 1 | 2,145 | 8 | 4,291 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Arkadiy has lots square photos with size a Γ a. He wants to put some of them on a rectangular wall with size h Γ w.
The photos which Arkadiy will put on the wall must form a rectangular grid a... | instruction | 0 | 2,146 | 8 | 4,292 |
No | output | 1 | 2,146 | 8 | 4,293 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Arkadiy has lots square photos with size a Γ a. He wants to put some of them on a rectangular wall with size h Γ w.
The photos which Arkadiy will put on the wall must form a rectangular grid a... | instruction | 0 | 2,147 | 8 | 4,294 |
No | output | 1 | 2,147 | 8 | 4,295 |
Provide a correct Python 3 solution for this coding contest problem.
There are N balls in a two-dimensional plane. The i-th ball is at coordinates (x_i, y_i).
We will collect all of these balls, by choosing two integers p and q such that p \neq 0 or q \neq 0 and then repeating the following operation:
* Choose a bal... | instruction | 0 | 2,272 | 8 | 4,544 |
"Correct Solution:
```
from collections import Counter
n = int(input())
ball = sorted([list(map(int,input().split())) for i in range(n)])
diff = []
for k in range(1,n):
for i in range(1,n):
if i-k>=0:
p,q = ball[i][0]-ball[i-k][0],ball[i][1]-ball[i-k][1]
diff.append((p,q))
D = Counte... | output | 1 | 2,272 | 8 | 4,545 |
Provide a correct Python 3 solution for this coding contest problem.
An old document says that a Ninja House in Kanazawa City was in fact a defensive fortress, which was designed like a maze. Its rooms were connected by hidden doors in a complicated manner, so that any invader would become lost. Each room has at least... | instruction | 0 | 2,399 | 8 | 4,798 |
"Correct Solution:
```
N = int(input())
for i in range(N):
L = []
while 1:
*s, = map(int, input().split())
if s[-1] == 0:
L.extend(s[:-1])
break
L.extend(s)
G = []
st = []
cur = 0
for s in L:
if s > 0:
G.append([])
i... | output | 1 | 2,399 | 8 | 4,799 |
Provide a correct Python 3 solution for this coding contest problem.
An old document says that a Ninja House in Kanazawa City was in fact a defensive fortress, which was designed like a maze. Its rooms were connected by hidden doors in a complicated manner, so that any invader would become lost. Each room has at least... | instruction | 0 | 2,400 | 8 | 4,800 |
"Correct Solution:
```
#1236
q=int(input())
for _ in range(q):
data=[]
while 1:
data+=list(map(int,input().split()))
if data[-1]==0:
break
rooms=[(-1,1,[])]
now=0
i=0
st=[]
counter=[-1 for i in range(1000)]
while data[i]!=0:
while rooms[now][1]<=len(ro... | output | 1 | 2,400 | 8 | 4,801 |
Provide a correct Python 3 solution for this coding contest problem.
An old document says that a Ninja House in Kanazawa City was in fact a defensive fortress, which was designed like a maze. Its rooms were connected by hidden doors in a complicated manner, so that any invader would become lost. Each room has at least... | instruction | 0 | 2,401 | 8 | 4,802 |
"Correct Solution:
```
import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15
def solve():
record = list(map(int,input().split()))
while record[-1] != 0:
record += list(map(int,input().split()))
number_of_room = sum(1 if r > 0 else 0 for r in record) + 1
G = [[] for _ in ra... | output | 1 | 2,401 | 8 | 4,803 |
Provide a correct Python 3 solution for this coding contest problem.
An old document says that a Ninja House in Kanazawa City was in fact a defensive fortress, which was designed like a maze. Its rooms were connected by hidden doors in a complicated manner, so that any invader would become lost. Each room has at least... | instruction | 0 | 2,402 | 8 | 4,804 |
"Correct Solution:
```
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**13
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
def LI(): return [int... | output | 1 | 2,402 | 8 | 4,805 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.