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.
Little Dormi received a histogram with n bars of height a_1, a_2, …, a_n for Christmas. However, the more he played with his new histogram, the more he realized its imperfections, so today he wa... | instruction | 0 | 91,988 | 8 | 183,976 |
No | output | 1 | 91,988 | 8 | 183,977 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little Dormi received a histogram with n bars of height a_1, a_2, …, a_n for Christmas. However, the more he played with his new histogram, the more he realized its imperfections, so today he wa... | instruction | 0 | 91,989 | 8 | 183,978 |
No | output | 1 | 91,989 | 8 | 183,979 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little Dormi received a histogram with n bars of height a_1, a_2, …, a_n for Christmas. However, the more he played with his new histogram, the more he realized its imperfections, so today he wa... | instruction | 0 | 91,990 | 8 | 183,980 |
No | output | 1 | 91,990 | 8 | 183,981 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There is a system of n vessels arranged one above the other as shown in the figure below. Assume that the vessels are numbered from 1 to n, in the order from the highest to the lowest, the volume of the i-th vessel is ai liters.
<image>
In... | instruction | 0 | 92,082 | 8 | 184,164 |
Tags: data structures, dsu, implementation, trees
Correct Solution:
```
def get_next_av(next_av, p):
q = p
while next_av[q] != q:
q = next_av[q]
while p != q:
next_av[p], p = q, next_av[p]
return p
def main():
from array import array
from sys import stdin
input = stdin.read... | output | 1 | 92,082 | 8 | 184,165 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There is a system of n vessels arranged one above the other as shown in the figure below. Assume that the vessels are numbered from 1 to n, in the order from the highest to the lowest, the volume of the i-th vessel is ai liters.
<image>
In... | instruction | 0 | 92,083 | 8 | 184,166 |
Tags: data structures, dsu, implementation, trees
Correct Solution:
```
n = int(input())
m = [int(i) for i in input().split()]
k = [0] * n
p = int(input())
l = list(range(1,n + 1))
j = []
for i in range(p):
t = [int(i) for i in input().split()]
if t[0] == 1:
h = []
a ,b= t[1] - 1,t[2]
w... | output | 1 | 92,083 | 8 | 184,167 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There is a system of n vessels arranged one above the other as shown in the figure below. Assume that the vessels are numbered from 1 to n, in the order from the highest to the lowest, the volume of the i-th vessel is ai liters.
<image>
In... | instruction | 0 | 92,084 | 8 | 184,168 |
Tags: data structures, dsu, implementation, trees
Correct Solution:
```
#kylin1993
n=int(input());
water=(n+2)*[0];
vol=[int(i) for i in input().split()];
trace=(n+2)*[0];
next = [i+1 for i in range(n+2)];
m=int(input());
out=[]
for i in range(m):
c=[int(i) for i in input().split()];
if c[0]==1 :
w=c[2];
k=c[1]-1... | output | 1 | 92,084 | 8 | 184,169 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There is a system of n vessels arranged one above the other as shown in the figure below. Assume that the vessels are numbered from 1 to n, in the order from the highest to the lowest, the volume of the i-th vessel is ai liters.
<image>
In... | instruction | 0 | 92,085 | 8 | 184,170 |
Tags: data structures, dsu, implementation, trees
Correct Solution:
```
n=int(input());
water=(n+2)*[0];
vol=[int(i) for i in input().split()];
trace=(n+2)*[0];
next = [i+1 for i in range(n+2)];
m=int(input());
out=[]
for i in range(m):
c=[int(i) for i in input().split()];
if c[0]==1 :
w=c[2];
k=c[1]-1;
r=0;
... | output | 1 | 92,085 | 8 | 184,171 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There is a system of n vessels arranged one above the other as shown in the figure below. Assume that the vessels are numbered from 1 to n, in the order from the highest to the lowest, the volume of the i-th vessel is ai liters.
<image>
In... | instruction | 0 | 92,086 | 8 | 184,172 |
Tags: data structures, dsu, implementation, trees
Correct Solution:
```
n = int(input()) + 1
a = list(map(int, input().split())) + [1 << 50]
l, p, r = [0] * n, list(range(n)), []
for i in range(int(input())):
t = list(map(int, input().split()))
if t[0] == 2:
r.append(l[t[1] - 1])
else:
x = ... | output | 1 | 92,086 | 8 | 184,173 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There is a system of n vessels arranged one above the other as shown in the figure below. Assume that the vessels are numbered from 1 to n, in the order from the highest to the lowest, the volume of the i-th vessel is ai liters.
<image>
In... | instruction | 0 | 92,087 | 8 | 184,174 |
Tags: data structures, dsu, implementation, trees
Correct Solution:
```
n = int(input())
a = list(map(int, input().split()))
m = int(input())
v = [0] * n
f = list(range(1, n + 1))
l = []
for i in range(m):
q = list(map(int, input().split()))
if q[0] == 1:
p, x = q[1], q[2]
u = []
j = p -... | output | 1 | 92,087 | 8 | 184,175 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There is a system of n vessels arranged one above the other as shown in the figure below. Assume that the vessels are numbered from 1 to n, in the order from the highest to the lowest, the volume of the i-th vessel is ai liters.
<image>
In... | instruction | 0 | 92,088 | 8 | 184,176 |
Tags: data structures, dsu, implementation, trees
Correct Solution:
```
from sys import stdin, stdout
n = int(stdin.readline()) + 1
a = list(map(int, stdin.readline().split())) + [1 << 50]
l, p, r = [0] * n, list(range(n)), []
for i in range(int(stdin.readline())):
t = list(map(int, stdin.readline().split()))
... | output | 1 | 92,088 | 8 | 184,177 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There is a system of n vessels arranged one above the other as shown in the figure below. Assume that the vessels are numbered from 1 to n, in the order from the highest to the lowest, the volume of the i-th vessel is ai liters.
<image>
In... | instruction | 0 | 92,089 | 8 | 184,178 |
Tags: data structures, dsu, implementation, trees
Correct Solution:
```
n=int(input())
a=[int(i) for i in input().split()]
v=[0]*n
m=int(input())
f=[i+1 for i in range(n)]
ans=[]
for i in range(m):
q=[int(i) for i in input().split()]
if q[0]==1:
p,x=q[1],q[2]
xyz=[]
j=p-1
while j... | output | 1 | 92,089 | 8 | 184,179 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You have m = n·k wooden staves. The i-th stave has length ai. You have to assemble n barrels consisting of k staves each, you can use any k staves to construct a barrel. Each stave must belong to exactly one barrel.
Let volume vj of barrel ... | instruction | 0 | 92,369 | 8 | 184,738 |
Tags: greedy
Correct Solution:
```
""" 616C """
""" 1152B """
import math
# import sys
def main():
# n ,m= map(int,input().split())
# arr = list(map(int,input().split()))
# b = list(map(int,input().split()))
# n = int(input())
# string = str(input())
n ,k,l = map(int,input().split())
a = list(map(int,input().spl... | output | 1 | 92,369 | 8 | 184,739 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You have m = n·k wooden staves. The i-th stave has length ai. You have to assemble n barrels consisting of k staves each, you can use any k staves to construct a barrel. Each stave must belong to exactly one barrel.
Let volume vj of barrel ... | instruction | 0 | 92,370 | 8 | 184,740 |
Tags: greedy
Correct Solution:
```
s = [int(x) for x in input().split()]
n, k, ll = s[0], s[1], s[2]
s = [int(x) for x in input().split()]
s.sort()
if s[n - 1] - s[0] > ll:
print(0)
else:
x = 0
while x < n * k and s[x] <= ll + s[0]:
x += 1
if x > k * (n - 1):
q = 0
for i in range(n):
q += s[i * k]
print... | output | 1 | 92,370 | 8 | 184,741 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You have m = n·k wooden staves. The i-th stave has length ai. You have to assemble n barrels consisting of k staves each, you can use any k staves to construct a barrel. Each stave must belong to exactly one barrel.
Let volume vj of barrel ... | instruction | 0 | 92,371 | 8 | 184,742 |
Tags: greedy
Correct Solution:
```
n,k,L=map(int,input().split())
l=list(map(int,input().split()))
l=sorted(l)
s=0
v=n-1
p=0
ye=True
for i in range(len(l)-1,-1,-1) :
if abs(l[0]-l[i])>L :
p+=1
else :
if p>=k-1 and p>0 :
p-=k-1
s+=l[i]
else :
v=i
... | output | 1 | 92,371 | 8 | 184,743 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You have m = n·k wooden staves. The i-th stave has length ai. You have to assemble n barrels consisting of k staves each, you can use any k staves to construct a barrel. Each stave must belong to exactly one barrel.
Let volume vj of barrel ... | instruction | 0 | 92,372 | 8 | 184,744 |
Tags: greedy
Correct Solution:
```
import bisect
import sys
input = sys.stdin.readline
n, k, l = map(int, input().split())
a = list(map(int, input().split()))
a = sorted(a)
ans = [[] for i in range(n)]
max_min = a[0] + l
cnt = 0
for i in range(bisect.bisect_right(a, max_min)):
ans[cnt // k].append(a[i])
... | output | 1 | 92,372 | 8 | 184,745 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You have m = n·k wooden staves. The i-th stave has length ai. You have to assemble n barrels consisting of k staves each, you can use any k staves to construct a barrel. Each stave must belong to exactly one barrel.
Let volume vj of barrel ... | instruction | 0 | 92,373 | 8 | 184,746 |
Tags: greedy
Correct Solution:
```
n, k, l = [int(i) for i in input().split()]
arr = sorted([int(i) for i in input().split()])
ma = n*k-1
for i in range(n*k):
if arr[0] + l < arr[i]:
ma = i - 1
break
#print(arr)
#print(ma)
if ma < n-1:
print(0)
exit()
ans = 0
for i in range(0, ma + 1, k):
ans += arr[i]
n-=... | output | 1 | 92,373 | 8 | 184,747 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You have m = n·k wooden staves. The i-th stave has length ai. You have to assemble n barrels consisting of k staves each, you can use any k staves to construct a barrel. Each stave must belong to exactly one barrel.
Let volume vj of barrel ... | instruction | 0 | 92,374 | 8 | 184,748 |
Tags: greedy
Correct Solution:
```
def search(array, i, j, l):
if i > j or array[i] - array[0] > l:
return -1
mid = (i+j)//2
if array[mid] - array[0] > l:
return search(array, i, mid-1, l)
else:
return max(mid, search(array, mid+1, j, l))
if __name__ == '__main__':
n, k, l... | output | 1 | 92,374 | 8 | 184,749 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You have m = n·k wooden staves. The i-th stave has length ai. You have to assemble n barrels consisting of k staves each, you can use any k staves to construct a barrel. Each stave must belong to exactly one barrel.
Let volume vj of barrel ... | instruction | 0 | 92,375 | 8 | 184,750 |
Tags: greedy
Correct Solution:
```
n,k,l=map(int,input().split())
a=sorted(list(map(int,input().split())))
dontuse=0
ans=0
for i in range(n*k-1,-1,-1):
dontuse+=1
if a[i]-a[0]<=l and dontuse>=k:
ans+=a[i]
dontuse-=k
if dontuse>0:
print(0)
else:
print(ans)
``` | output | 1 | 92,375 | 8 | 184,751 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You have m = n·k wooden staves. The i-th stave has length ai. You have to assemble n barrels consisting of k staves each, you can use any k staves to construct a barrel. Each stave must belong to exactly one barrel.
Let volume vj of barrel ... | instruction | 0 | 92,376 | 8 | 184,752 |
Tags: greedy
Correct Solution:
```
n,k,l=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
x=0
while x<n*k-1 and a[x+1]-a[0]<=l:x+=1
if x+1<n:print(0);exit()
o=i=0
u=x-n+1
while i<=x:
o+=a[i]
u+=1
i=min(i+k,u)
print(o)
``` | output | 1 | 92,376 | 8 | 184,753 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have m = n·k wooden staves. The i-th stave has length ai. You have to assemble n barrels consisting of k staves each, you can use any k staves to construct a barrel. Each stave must belong t... | instruction | 0 | 92,377 | 8 | 184,754 |
Yes | output | 1 | 92,377 | 8 | 184,755 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have m = n·k wooden staves. The i-th stave has length ai. You have to assemble n barrels consisting of k staves each, you can use any k staves to construct a barrel. Each stave must belong t... | instruction | 0 | 92,378 | 8 | 184,756 |
Yes | output | 1 | 92,378 | 8 | 184,757 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have m = n·k wooden staves. The i-th stave has length ai. You have to assemble n barrels consisting of k staves each, you can use any k staves to construct a barrel. Each stave must belong t... | instruction | 0 | 92,379 | 8 | 184,758 |
Yes | output | 1 | 92,379 | 8 | 184,759 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have m = n·k wooden staves. The i-th stave has length ai. You have to assemble n barrels consisting of k staves each, you can use any k staves to construct a barrel. Each stave must belong t... | instruction | 0 | 92,380 | 8 | 184,760 |
Yes | output | 1 | 92,380 | 8 | 184,761 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have m = n·k wooden staves. The i-th stave has length ai. You have to assemble n barrels consisting of k staves each, you can use any k staves to construct a barrel. Each stave must belong t... | instruction | 0 | 92,381 | 8 | 184,762 |
No | output | 1 | 92,381 | 8 | 184,763 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have m = n·k wooden staves. The i-th stave has length ai. You have to assemble n barrels consisting of k staves each, you can use any k staves to construct a barrel. Each stave must belong t... | instruction | 0 | 92,382 | 8 | 184,764 |
No | output | 1 | 92,382 | 8 | 184,765 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have m = n·k wooden staves. The i-th stave has length ai. You have to assemble n barrels consisting of k staves each, you can use any k staves to construct a barrel. Each stave must belong t... | instruction | 0 | 92,383 | 8 | 184,766 |
No | output | 1 | 92,383 | 8 | 184,767 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have m = n·k wooden staves. The i-th stave has length ai. You have to assemble n barrels consisting of k staves each, you can use any k staves to construct a barrel. Each stave must belong t... | instruction | 0 | 92,384 | 8 | 184,768 |
No | output | 1 | 92,384 | 8 | 184,769 |
Provide a correct Python 3 solution for this coding contest problem.
The following sorting operation is repeated for the stacked blocks as shown in Fig. A.
1. Stack all the bottom blocks (white blocks in Figure a) on the right edge (the remaining blocks will automatically drop one step down, as shown in Figure b).
2.... | instruction | 0 | 92,532 | 8 | 185,064 |
"Correct Solution:
```
K = [i+1 for i in range(2000)]
while 1:
N = int(input())
if N == 0:
break
*S, = map(int, input().split())
if S == K[:len(S)]:
print(0)
continue
i = 1; s = 0; su = sum(S)
while s < su:
s += i; i += 1
if s != su:
print(-1)
... | output | 1 | 92,532 | 8 | 185,065 |
Provide a correct Python 3 solution for this coding contest problem.
The following sorting operation is repeated for the stacked blocks as shown in Fig. A.
1. Stack all the bottom blocks (white blocks in Figure a) on the right edge (the remaining blocks will automatically drop one step down, as shown in Figure b).
2.... | instruction | 0 | 92,533 | 8 | 185,066 |
"Correct Solution:
```
while True:
N = int(input())
if N == 0 : break
b = list(map(int, input().split()))
cnt = 0
while cnt <= 10000 :
tri_num = True
if b[0] != 1 : tri_num = False
for i in range( 1, len(b) ) :
if b[i] != b[i-1]+1 :
tri_num = Fals... | output | 1 | 92,533 | 8 | 185,067 |
Provide a correct Python 3 solution for this coding contest problem.
The following sorting operation is repeated for the stacked blocks as shown in Fig. A.
1. Stack all the bottom blocks (white blocks in Figure a) on the right edge (the remaining blocks will automatically drop one step down, as shown in Figure b).
2.... | instruction | 0 | 92,534 | 8 | 185,068 |
"Correct Solution:
```
import math
def is_sankaku(v):
x = (math.sqrt(8*v + 1) - 1 ) / 2
return x == int(x)
def check(lst):
for i,v in enumerate(lst):
if v != i + 1:
return False
elif i == len(lst)-1:
return True
while 1:
N = int(input())
if N == 0:break
... | output | 1 | 92,534 | 8 | 185,069 |
Provide a correct Python 3 solution for this coding contest problem.
The following sorting operation is repeated for the stacked blocks as shown in Fig. A.
1. Stack all the bottom blocks (white blocks in Figure a) on the right edge (the remaining blocks will automatically drop one step down, as shown in Figure b).
2.... | instruction | 0 | 92,535 | 8 | 185,070 |
"Correct Solution:
```
tri_nums = [i * (i + 1) // 2 for i in range(1500)]
while True:
n = int(input())
if n == 0:
break
blst = list(map(int, input().split()))
if sum(blst) not in tri_nums:
print(-1)
continue
end = [i + 1 for i in range(tri_nums.index(sum(blst)))]
lenb = n
cnt = 0
while blst ... | output | 1 | 92,535 | 8 | 185,071 |
Provide a correct Python 3 solution for this coding contest problem.
The following sorting operation is repeated for the stacked blocks as shown in Fig. A.
1. Stack all the bottom blocks (white blocks in Figure a) on the right edge (the remaining blocks will automatically drop one step down, as shown in Figure b).
2.... | instruction | 0 | 92,536 | 8 | 185,072 |
"Correct Solution:
```
l = list(range(1, 100000))
tri_num = set(i*(i+1)//2 for i in range(1, 100000))
while True:
N = int(input())
if N==0:
break
b = list(map(int, input().split()))
if sum(b) not in tri_num:
print(-1)
continue
ans = 0
while True:... | output | 1 | 92,536 | 8 | 185,073 |
Provide a correct Python 3 solution for this coding contest problem.
The following sorting operation is repeated for the stacked blocks as shown in Fig. A.
1. Stack all the bottom blocks (white blocks in Figure a) on the right edge (the remaining blocks will automatically drop one step down, as shown in Figure b).
2.... | instruction | 0 | 92,537 | 8 | 185,074 |
"Correct Solution:
```
# Aizu Problem 0267: Triangle of Blocks
import sys, math, os, datetime
# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
sys.stdin = open("sample-input.txt", "rt")
def is_triangle(heights):
if heights[0] != 1:
return False
L = len(heights)
diffs = [height... | output | 1 | 92,537 | 8 | 185,075 |
Provide a correct Python 3 solution for this coding contest problem.
The following sorting operation is repeated for the stacked blocks as shown in Fig. A.
1. Stack all the bottom blocks (white blocks in Figure a) on the right edge (the remaining blocks will automatically drop one step down, as shown in Figure b).
2.... | instruction | 0 | 92,538 | 8 | 185,076 |
"Correct Solution:
```
def Sankakusu(N) :
tmp = 0
i = 1
while tmp < N :
tmp = (i * (i + 1)) / 2
i += 1
if tmp == N :
return True
else :
return False
def Step_Check(List) :
for i in range(len(List)) :
if List[i] != i + 1 :
return False
re... | output | 1 | 92,538 | 8 | 185,077 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of the grid. Her broom is very strange: if she sweeps over a... | instruction | 0 | 93,083 | 8 | 186,166 |
Tags: brute force, greedy, strings
Correct Solution:
```
def deep(arr):
temp = []
for i in arr:
temp.append(list(i))
return temp
n = int(input())
arr = []
for _ in range(n):
arr.append(list(map(int, input())))
temp = deep(arr)
ans = 0
for i in range(n):
arr = deep(temp)
for j in range(n):
if arr[i][j] == 0:
... | output | 1 | 93,083 | 8 | 186,167 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of the grid. Her broom is very strange: if she sweeps over a... | instruction | 0 | 93,084 | 8 | 186,168 |
Tags: brute force, greedy, strings
Correct Solution:
```
n=int(input())
z=[[int(k) for k in input().split()] for i in range(n)]
ans=0
for i in z:
ans=max(ans , z.count(i))
print(ans)
``` | output | 1 | 93,084 | 8 | 186,169 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of the grid. Her broom is very strange: if she sweeps over a... | instruction | 0 | 93,085 | 8 | 186,170 |
Tags: brute force, greedy, strings
Correct Solution:
```
a=int(input())
d={}
for _ in " "*a:
z=input()
t=()
for i in range(a):
if z[i]=='0':t+=(i,)
d[t]=d.get(t,0)+1
print(max(d.values()))
``` | output | 1 | 93,085 | 8 | 186,171 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of the grid. Her broom is very strange: if she sweeps over a... | instruction | 0 | 93,086 | 8 | 186,172 |
Tags: brute force, greedy, strings
Correct Solution:
```
n=int(input())
b=[list(map(int,list(input()))) for _ in range(n)]
print(max(sum(sum(b[j][k]^b[i][k]^1 for k in range(n))==n for j in range(n)) for i in range(n)))
``` | output | 1 | 93,086 | 8 | 186,173 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of the grid. Her broom is very strange: if she sweeps over a... | instruction | 0 | 93,087 | 8 | 186,174 |
Tags: brute force, greedy, strings
Correct Solution:
```
n = int(input())
room = []
for _ in range(n):
row = tuple(input())
room.append(row)
memo = {}
for i in range(n):
try: memo[room[i]] += 1
except KeyError:
memo[room[i]] = 1
max_rows = max([(value, key) for key, value in memo.items()])
pri... | output | 1 | 93,087 | 8 | 186,175 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of the grid. Her broom is very strange: if she sweeps over a... | instruction | 0 | 93,088 | 8 | 186,176 |
Tags: brute force, greedy, strings
Correct Solution:
```
n = int(input())
c = []
for i in range(n):
c.append(input())
max_count = 0
for i in range(n):
count = 0
for j in range(n):
if c[i] == c[j]:
count += 1
if count > max_count:
max_count = count
print(max_count)
... | output | 1 | 93,088 | 8 | 186,177 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of the grid. Her broom is very strange: if she sweeps over a... | instruction | 0 | 93,089 | 8 | 186,178 |
Tags: brute force, greedy, strings
Correct Solution:
```
n = int(input())
cnt = {}
for i in range(n):
line = input()
if line not in cnt:
cnt[line] = 1
else:
cnt[line] += 1
print(max([cnt[r] for r in cnt]))
``` | output | 1 | 93,089 | 8 | 186,179 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of the grid. Her broom is very strange: if she sweeps over a... | instruction | 0 | 93,090 | 8 | 186,180 |
Tags: brute force, greedy, strings
Correct Solution:
```
import sys
n = int(input())
s = [x for x in sys.stdin.read().split()]
m = 0
for a in s:
m = max(m, s.count(a))
print(m)
``` | output | 1 | 93,090 | 8 | 186,181 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of the grid. ... | instruction | 0 | 93,091 | 8 | 186,182 |
Yes | output | 1 | 93,091 | 8 | 186,183 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of the grid. ... | instruction | 0 | 93,092 | 8 | 186,184 |
Yes | output | 1 | 93,092 | 8 | 186,185 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of the grid. ... | instruction | 0 | 93,093 | 8 | 186,186 |
Yes | output | 1 | 93,093 | 8 | 186,187 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of the grid. ... | instruction | 0 | 93,094 | 8 | 186,188 |
Yes | output | 1 | 93,094 | 8 | 186,189 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of the grid. ... | instruction | 0 | 93,095 | 8 | 186,190 |
No | output | 1 | 93,095 | 8 | 186,191 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of the grid. ... | instruction | 0 | 93,096 | 8 | 186,192 |
No | output | 1 | 93,096 | 8 | 186,193 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of the grid. ... | instruction | 0 | 93,097 | 8 | 186,194 |
No | output | 1 | 93,097 | 8 | 186,195 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of the grid. ... | instruction | 0 | 93,098 | 8 | 186,196 |
No | output | 1 | 93,098 | 8 | 186,197 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.