message stringlengths 2 65.1k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 0 108k | cluster float64 14 14 | __index_level_0__ int64 0 217k |
|---|---|---|---|---|---|
Provide a correct Python 3 solution for this coding contest problem.
N people are arranged in a row from left to right.
You are given a string S of length N consisting of `0` and `1`, and a positive integer K.
The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands ... | instruction | 0 | 14,818 | 14 | 29,636 |
"Correct Solution:
```
N,K=map(int,input().split())
S=input()
po=[0]
X=[]
i=0
for i in range(N-1):
if not S[i] == S[i+1]:
po.append(i+1)
po.append(len(S))
for i in range(len(po)):
if 2*K+1>=len(po):
X.append(po[-1])
break
elif 2*K+i+1>=len(po):
X.append(po[2*K+i]-po[i])
break
elif S[po[i]]=='0':
X.appen... | output | 1 | 14,818 | 14 | 29,637 |
Provide a correct Python 3 solution for this coding contest problem.
N people are arranged in a row from left to right.
You are given a string S of length N consisting of `0` and `1`, and a positive integer K.
The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands ... | instruction | 0 | 14,819 | 14 | 29,638 |
"Correct Solution:
```
n, k = map(int, input().split())
s = input()
c = 1
l = []
l += [0,0] if (s[0] == '0') else [0]
for i in range(1, n):
if s[i-1] != s[i]:
l += [c+l[-1]]; c = 1;
else:
c +=1
l += [c+l[-1]]
if s[-1] == '0':
l += [l[-1]]
ll = len(l)
pl = 2 * k + 1
if ll <= pl:
print... | output | 1 | 14,819 | 14 | 29,639 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
N people are arranged in a row from left to right.
You are given a string S of length N consisting of `0` and `1`, and a positive integer K.
The i-th person from the left is standing on feet i... | instruction | 0 | 14,820 | 14 | 29,640 |
Yes | output | 1 | 14,820 | 14 | 29,641 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
N people are arranged in a row from left to right.
You are given a string S of length N consisting of `0` and `1`, and a positive integer K.
The i-th person from the left is standing on feet i... | instruction | 0 | 14,821 | 14 | 29,642 |
Yes | output | 1 | 14,821 | 14 | 29,643 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
N people are arranged in a row from left to right.
You are given a string S of length N consisting of `0` and `1`, and a positive integer K.
The i-th person from the left is standing on feet i... | instruction | 0 | 14,822 | 14 | 29,644 |
Yes | output | 1 | 14,822 | 14 | 29,645 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
N people are arranged in a row from left to right.
You are given a string S of length N consisting of `0` and `1`, and a positive integer K.
The i-th person from the left is standing on feet i... | instruction | 0 | 14,823 | 14 | 29,646 |
Yes | output | 1 | 14,823 | 14 | 29,647 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
N people are arranged in a row from left to right.
You are given a string S of length N consisting of `0` and `1`, and a positive integer K.
The i-th person from the left is standing on feet i... | instruction | 0 | 14,824 | 14 | 29,648 |
No | output | 1 | 14,824 | 14 | 29,649 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
N people are arranged in a row from left to right.
You are given a string S of length N consisting of `0` and `1`, and a positive integer K.
The i-th person from the left is standing on feet i... | instruction | 0 | 14,825 | 14 | 29,650 |
No | output | 1 | 14,825 | 14 | 29,651 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
N people are arranged in a row from left to right.
You are given a string S of length N consisting of `0` and `1`, and a positive integer K.
The i-th person from the left is standing on feet i... | instruction | 0 | 14,826 | 14 | 29,652 |
No | output | 1 | 14,826 | 14 | 29,653 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
N people are arranged in a row from left to right.
You are given a string S of length N consisting of `0` and `1`, and a positive integer K.
The i-th person from the left is standing on feet i... | instruction | 0 | 14,827 | 14 | 29,654 |
No | output | 1 | 14,827 | 14 | 29,655 |
Provide a correct Python 3 solution for this coding contest problem.
A: Taking a Seat-Taking a Seat-
story
Mr. A entered the classroom at the examination site to take an examination. However, Mr. A is a very nervous type. Therefore, depending on the situation, there may be seats that Mr. A does not want to sit in. T... | instruction | 0 | 15,026 | 14 | 30,052 |
"Correct Solution:
```
m,n = map(int,input().split())
seat = [list(input()) for i in range(m)]
dummy = ["0" for i in range(n+2)]
for i in range(m):
seat[i].insert(0,"0")
seat[i].append("0")
seat.insert(0,dummy)
seat.append(dummy)
for i in range(1,m + 1):
for j in range(1,n + 1):
if seat[i][j] == "... | output | 1 | 15,026 | 14 | 30,053 |
Provide a correct Python 3 solution for this coding contest problem.
A: Taking a Seat-Taking a Seat-
story
Mr. A entered the classroom at the examination site to take an examination. However, Mr. A is a very nervous type. Therefore, depending on the situation, there may be seats that Mr. A does not want to sit in. T... | instruction | 0 | 15,027 | 14 | 30,054 |
"Correct Solution:
```
m, n = map(int, input().split())
mp = [list("#" * (n + 2))] + [list("#" + input() + "#") for _ in range(m)] + [list("#" * (n + 2))]
vec = ((1, 0), (1, -1), (0, -1), (-1, -1), (-1, 0), (-1, 1), (0, 1), (1, 1))
for y in range(1, m + 1):
for x in range(1, n + 1):
if mp[y][x] == "x":
for ... | output | 1 | 15,027 | 14 | 30,055 |
Provide tags and a correct Python 3 solution for this coding contest problem.
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snow... | instruction | 0 | 15,252 | 14 | 30,504 |
Tags: binary search, data structures, greedy
Correct Solution:
```
import sys
import math
n = int(sys.stdin.readline())
r = [int(x) for x in sys.stdin.readline().strip().split()]
r = sorted(r)
a = 0
b = n // 3
d = {key:0 for key in r}
for i in range(n):
d[r[i]] += 1
while a != b:
k = math.ceil((a + b) / 2)
... | output | 1 | 15,252 | 14 | 30,505 |
Provide tags and a correct Python 3 solution for this coding contest problem.
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snow... | instruction | 0 | 15,253 | 14 | 30,506 |
Tags: binary search, data structures, greedy
Correct Solution:
```
from heapq import *
from collections import defaultdict
n = int(input())
r = map(int, input().split())
assoc = defaultdict(int)
for ballsize in r:
assoc[ballsize] += 1
available = [(-1 * val, key) for key, val in assoc.items()]
heapify(available... | output | 1 | 15,253 | 14 | 30,507 |
Provide tags and a correct Python 3 solution for this coding contest problem.
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snow... | instruction | 0 | 15,254 | 14 | 30,508 |
Tags: binary search, data structures, greedy
Correct Solution:
```
from io import BytesIO
import os
from collections import Counter
import heapq
input = BytesIO(os.read(0, os.fstat(0).st_size)).readline
def main():
count = int(input())
balls = list(map(int, input().split()))
counter = Counter(balls)
pq = []
... | output | 1 | 15,254 | 14 | 30,509 |
Provide tags and a correct Python 3 solution for this coding contest problem.
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snow... | instruction | 0 | 15,255 | 14 | 30,510 |
Tags: binary search, data structures, greedy
Correct Solution:
```
from collections import Counter as c
from heapq import *
input()
a = dict(c([int(x) for x in input().split()]))
d = [(-1 * v, k) for k, v in a.items()]
heapify(d)
ans = []
while len(d) > 2:
a, b, c = heappop(d), heappop(d), heappop(d)
ans.append... | output | 1 | 15,255 | 14 | 30,511 |
Provide tags and a correct Python 3 solution for this coding contest problem.
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snow... | instruction | 0 | 15,256 | 14 | 30,512 |
Tags: binary search, data structures, greedy
Correct Solution:
```
import heapq
from collections import defaultdict
n=int(input())
b=list(map(int,input().split()))
cnt=defaultdict(lambda:0)
for j in b:
cnt[j]+=1
li=[]
for j in list(set(b)):
li.append([-cnt[j],j])
heapq.heapify(li)
l=len(li)
ans=[]
while(l>=3)... | output | 1 | 15,256 | 14 | 30,513 |
Provide tags and a correct Python 3 solution for this coding contest problem.
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snow... | instruction | 0 | 15,258 | 14 | 30,516 |
Tags: binary search, data structures, greedy
Correct Solution:
```
from collections import defaultdict
n, t = int(input()), input().split()
p = defaultdict(int)
for i in t:
p[i] += 1
if len(p) < 3: print(0)
else:
q = list(p.items())
a, b = q[0][1], q[1][1]
x, y = 0, 1
if a < b: x, y, a, b = y, x, b,... | output | 1 | 15,258 | 14 | 30,517 |
Provide tags and a correct Python 3 solution for this coding contest problem.
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snow... | instruction | 0 | 15,259 | 14 | 30,518 |
Tags: binary search, data structures, greedy
Correct Solution:
```
import os
import sys
from io import BytesIO, IOBase
import math
import itertools
import bisect
import heapq
def main():
pass
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._fd = file.fileno()
... | output | 1 | 15,259 | 14 | 30,519 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A film festival is coming up in the city N. The festival will last for exactly n days and each day will have a premiere of exactly one film. Each film has a genre β an integer from 1 to k.
On the i-th day the festival will show a movie of g... | instruction | 0 | 15,357 | 14 | 30,714 |
Tags: greedy
Correct Solution:
```
import sys
def solve():
n, k = map(int, input().split())
bada = list(map(int, input().split()))
a = list()
for i in range(len(bada)):
if len(a) > 0 and bada[i] == a[-1]: continue
a.append(bada[i])
bad = [0] * (k + 1)
for i, val in enumerate(a):... | output | 1 | 15,357 | 14 | 30,715 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A film festival is coming up in the city N. The festival will last for exactly n days and each day will have a premiere of exactly one film. Each film has a genre β an integer from 1 to k.
On the i-th day the festival will show a movie of g... | instruction | 0 | 15,358 | 14 | 30,716 |
Tags: greedy
Correct Solution:
```
import sys
from math import *
def minp():
return sys.stdin.readline().strip()
def mint():
return int(minp())
def mints():
return map(int, minp().split())
n, k = mints()
a = list(mints())
i = 0
c = [0]*(k+1)
while i < n:
j = i
while j < n and a[j] == a[i]:
j += 1
if i - 1 >... | output | 1 | 15,358 | 14 | 30,717 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A film festival is coming up in the city N. The festival will last for exactly n days and each day will have a premiere of exactly one film. Each film has a genre β an integer from 1 to k.
On the i-th day the festival will show a movie of g... | instruction | 0 | 15,359 | 14 | 30,718 |
Tags: greedy
Correct Solution:
```
import math
#n,m=map(int,input().split())
from collections import Counter
#for i in range(n):
import math
#for _ in range(int(input())):
#n = int(input())
#for _ in range(int(input())):
#n = int(input())
import bisect
'''for _ in range(int(input())):
n=int(input())
n,k=map(i... | output | 1 | 15,359 | 14 | 30,719 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A film festival is coming up in the city N. The festival will last for exactly n days and each day will have a premiere of exactly one film. Each film has a genre β an integer from 1 to k.
On the i-th day the festival will show a movie of g... | instruction | 0 | 15,360 | 14 | 30,720 |
Tags: greedy
Correct Solution:
```
# 1 2 3 2 3 1 3
# 12 23 32 23 31 13
# 1 1 2 3 2 3 3 1 1 3
# 112 123 232 323 233 331 311 113
# 12/21 1 0 0 0 0 1 0 0
# 23/32 0 1 1 1 0 0 0 0
# 13/31 0 1 0 0 0 1 0 0
# 1 2 3 1 2 3 1 2 3| 1
# 123 231 312 123 231 312 123 231
... | output | 1 | 15,360 | 14 | 30,721 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A film festival is coming up in the city N. The festival will last for exactly n days and each day will have a premiere of exactly one film. Each film has a genre β an integer from 1 to k.
On the i-th day the festival will show a movie of g... | instruction | 0 | 15,361 | 14 | 30,722 |
Tags: greedy
Correct Solution:
```
__author__ = 'Michael Ilyin'
def prepare(a):
na = []
last = 0
for i in range(0, len(a)):
if last != a[i]:
na.append(a[i])
last = a[i]
return na
header = input()
films = int(header[:header.find(' ')])
genres = int(header[header.find('... | output | 1 | 15,361 | 14 | 30,723 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A film festival is coming up in the city N. The festival will last for exactly n days and each day will have a premiere of exactly one film. Each film has a genre β an integer from 1 to k.
On the i-th day the festival will show a movie of g... | instruction | 0 | 15,362 | 14 | 30,724 |
Tags: greedy
Correct Solution:
```
import sys
import math
import heapq
import bisect
from collections import Counter
from collections import defaultdict
from io import BytesIO, IOBase
import string
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
import os
self.os = os
sel... | output | 1 | 15,362 | 14 | 30,725 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A film festival is coming up in the city N. The festival will last for exactly n days and each day will have a premiere of exactly one film. Each film has a genre β an integer from 1 to k.
On the i-th day the festival will show a movie of g... | instruction | 0 | 15,363 | 14 | 30,726 |
Tags: greedy
Correct Solution:
```
n, k = map(int, input().split())
a = [int(i) for i in input().split()]
s = [0 for i in range(k)]
b = [a[0]]
for i in range(1, n):
if a[i] == b[-1]:
continue
else:
b.append(a[i])
y = len(b)
for i in range(y):
if i == 0 and b[i] != b[i + 1]:
s[a[0] - ... | output | 1 | 15,363 | 14 | 30,727 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A film festival is coming up in the city N. The festival will last for exactly n days and each day will have a premiere of exactly one film. Each film has a genre β an integer from 1 to k.
On the i-th day the festival will show a movie of g... | instruction | 0 | 15,364 | 14 | 30,728 |
Tags: greedy
Correct Solution:
```
n,k = map(int,input().split())
lis=list(map(int,input().split()))
ans=[]
freq=[0]*(k+1)
for i in range(n-1):
if lis[i]!=lis[i+1]:
ans.append(lis[i])
if lis[-1]!=ans[-1]:
ans.append(lis[-1])
#print(ans,freq)
l=len(ans)
for i in range(1,l-1):
if ans[i-1]==ans[i+1]:
... | output | 1 | 15,364 | 14 | 30,729 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A film festival is coming up in the city N. The festival will last for exactly n days and each day will have a premiere of exactly one film. Each film has a genre β an integer from 1 to k.
On t... | instruction | 0 | 15,365 | 14 | 30,730 |
Yes | output | 1 | 15,365 | 14 | 30,731 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A film festival is coming up in the city N. The festival will last for exactly n days and each day will have a premiere of exactly one film. Each film has a genre β an integer from 1 to k.
On t... | instruction | 0 | 15,366 | 14 | 30,732 |
Yes | output | 1 | 15,366 | 14 | 30,733 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A film festival is coming up in the city N. The festival will last for exactly n days and each day will have a premiere of exactly one film. Each film has a genre β an integer from 1 to k.
On t... | instruction | 0 | 15,367 | 14 | 30,734 |
Yes | output | 1 | 15,367 | 14 | 30,735 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A film festival is coming up in the city N. The festival will last for exactly n days and each day will have a premiere of exactly one film. Each film has a genre β an integer from 1 to k.
On t... | instruction | 0 | 15,368 | 14 | 30,736 |
Yes | output | 1 | 15,368 | 14 | 30,737 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A film festival is coming up in the city N. The festival will last for exactly n days and each day will have a premiere of exactly one film. Each film has a genre β an integer from 1 to k.
On t... | instruction | 0 | 15,369 | 14 | 30,738 |
No | output | 1 | 15,369 | 14 | 30,739 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A film festival is coming up in the city N. The festival will last for exactly n days and each day will have a premiere of exactly one film. Each film has a genre β an integer from 1 to k.
On t... | instruction | 0 | 15,370 | 14 | 30,740 |
No | output | 1 | 15,370 | 14 | 30,741 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A film festival is coming up in the city N. The festival will last for exactly n days and each day will have a premiere of exactly one film. Each film has a genre β an integer from 1 to k.
On t... | instruction | 0 | 15,371 | 14 | 30,742 |
No | output | 1 | 15,371 | 14 | 30,743 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A film festival is coming up in the city N. The festival will last for exactly n days and each day will have a premiere of exactly one film. Each film has a genre β an integer from 1 to k.
On t... | instruction | 0 | 15,372 | 14 | 30,744 |
No | output | 1 | 15,372 | 14 | 30,745 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Famil Door wants to celebrate his birthday with his friends from Far Far Away. He has n friends and each of them can come to the party in a specific range of days of the year from ai to bi. Of course, Famil Door wants to have as many friends... | instruction | 0 | 15,493 | 14 | 30,986 |
Tags: brute force
Correct Solution:
```
n = int(input())
m = [0] * 366
f = [0] * 366
res = 0
for i in range(n):
x, l, r = [i for i in input().split()]
l = int(l)
r = int(r)
if x == 'M':
for j in range(l-1, r):
m[j] += 1
else:
for j in range(l-1, r):
f[j] += 1
... | output | 1 | 15,493 | 14 | 30,987 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Famil Door wants to celebrate his birthday with his friends from Far Far Away. He has n friends and each of them can come to the party in a specific range of days of the year from ai to bi. Of course, Famil Door wants to have as many friends... | instruction | 0 | 15,494 | 14 | 30,988 |
Tags: brute force
Correct Solution:
```
# Description of the problem can be found at http://codeforces.com/problemset/problem/629/B
n = int(input())
a_g = list([0] * 367 for _ in range(2))
a_b = [0] * 367
for _ in range(n):
g, s, e = input().split()
for i in range(int(s), int(e) + 1):
a_g[1 if g == "... | output | 1 | 15,494 | 14 | 30,989 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Famil Door wants to celebrate his birthday with his friends from Far Far Away. He has n friends and each of them can come to the party in a specific range of days of the year from ai to bi. Of course, Famil Door wants to have as many friends... | instruction | 0 | 15,495 | 14 | 30,990 |
Tags: brute force
Correct Solution:
```
readInts=lambda: list(map(int, input().split()))
n = int(input())
num = [[0,0] for i in range(370)]
for i in range(n):
s,u,v = (input().split())
u=int(u)
v=int(v)
c=int(s=='F')
num[u][c]+=1
num[v+1][c]-=1
x=0;y=0
ret=0
for i in range(367):
x+=num[i][0... | output | 1 | 15,495 | 14 | 30,991 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Famil Door wants to celebrate his birthday with his friends from Far Far Away. He has n friends and each of them can come to the party in a specific range of days of the year from ai to bi. Of course, Famil Door wants to have as many friends... | instruction | 0 | 15,496 | 14 | 30,992 |
Tags: brute force
Correct Solution:
```
n = int(input())
m1 = {}
m2 = {}
for x in range(367):
m1[x] = 0
for y in range(367):
m2[y] = 0
for friend in range(n):
g, a, b = input().split()
for bruh in range(int(a), int(b)+1):
if g == "M":
m1[bruh] += 1
elif g == "F":
... | output | 1 | 15,496 | 14 | 30,993 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Famil Door wants to celebrate his birthday with his friends from Far Far Away. He has n friends and each of them can come to the party in a specific range of days of the year from ai to bi. Of course, Famil Door wants to have as many friends... | instruction | 0 | 15,497 | 14 | 30,994 |
Tags: brute force
Correct Solution:
```
n=int(input())
ab=[list(input().split()) for i in range(n)]
man,woman=0,0
day=[]
for i in range(1,367):
for x in range(len(ab)):
if int(ab[x][1])<=i<=int(ab[x][2]):
if ab[x][0]=='M':
man+=1
else:
woman+=1
day... | output | 1 | 15,497 | 14 | 30,995 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Famil Door wants to celebrate his birthday with his friends from Far Far Away. He has n friends and each of them can come to the party in a specific range of days of the year from ai to bi. Of course, Famil Door wants to have as many friends... | instruction | 0 | 15,498 | 14 | 30,996 |
Tags: brute force
Correct Solution:
```
n = int(input())
f = [0]*366
m = [0]*366
for i in range(n):
a,b,c = input().split()
if a=='F':
for j in range(int(b)-1,int(c)):f[j]+=1
if a=='M':
for j in range(int(b)-1,int(c)):m[j]+=1
ans = 0
for i in range(366):
t = min(m[i],f[i])
ans = max(... | output | 1 | 15,498 | 14 | 30,997 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Famil Door wants to celebrate his birthday with his friends from Far Far Away. He has n friends and each of them can come to the party in a specific range of days of the year from ai to bi. Of course, Famil Door wants to have as many friends... | instruction | 0 | 15,499 | 14 | 30,998 |
Tags: brute force
Correct Solution:
```
n = int(input())
male,female = [0]*370,[0]*370
for _ in range(n):
g,l,r = input().split()
if g =='M':
for i in range(int(l),int(r)+1):
male[i]+=1
else:
for i in range(int(l),int(r)+1):
female[i]+=1
ans = 0
for i in range(1,... | output | 1 | 15,499 | 14 | 30,999 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Famil Door wants to celebrate his birthday with his friends from Far Far Away. He has n friends and each of them can come to the party in a specific range of days of the year from ai to bi. Of course, Famil Door wants to have as many friends... | instruction | 0 | 15,500 | 14 | 31,000 |
Tags: brute force
Correct Solution:
```
__author__ = 'aste'
DAYS = 366
def main():
n = int(input())
g_f = [0] * DAYS
g_m = [0] * DAYS
for i in range(0, n):
g, a, b = input().split()
a = int(a)
b = int(b)
for j in range(1, DAYS + 1):
if a <= j <= b:
... | output | 1 | 15,500 | 14 | 31,001 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Famil Door wants to celebrate his birthday with his friends from Far Far Away. He has n friends and each of them can come to the party in a specific range of days of the year from ai to bi. Of c... | instruction | 0 | 15,501 | 14 | 31,002 |
Yes | output | 1 | 15,501 | 14 | 31,003 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Famil Door wants to celebrate his birthday with his friends from Far Far Away. He has n friends and each of them can come to the party in a specific range of days of the year from ai to bi. Of c... | instruction | 0 | 15,502 | 14 | 31,004 |
Yes | output | 1 | 15,502 | 14 | 31,005 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Famil Door wants to celebrate his birthday with his friends from Far Far Away. He has n friends and each of them can come to the party in a specific range of days of the year from ai to bi. Of c... | instruction | 0 | 15,503 | 14 | 31,006 |
Yes | output | 1 | 15,503 | 14 | 31,007 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Famil Door wants to celebrate his birthday with his friends from Far Far Away. He has n friends and each of them can come to the party in a specific range of days of the year from ai to bi. Of c... | instruction | 0 | 15,504 | 14 | 31,008 |
Yes | output | 1 | 15,504 | 14 | 31,009 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Famil Door wants to celebrate his birthday with his friends from Far Far Away. He has n friends and each of them can come to the party in a specific range of days of the year from ai to bi. Of c... | instruction | 0 | 15,505 | 14 | 31,010 |
No | output | 1 | 15,505 | 14 | 31,011 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Famil Door wants to celebrate his birthday with his friends from Far Far Away. He has n friends and each of them can come to the party in a specific range of days of the year from ai to bi. Of c... | instruction | 0 | 15,506 | 14 | 31,012 |
No | output | 1 | 15,506 | 14 | 31,013 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Famil Door wants to celebrate his birthday with his friends from Far Far Away. He has n friends and each of them can come to the party in a specific range of days of the year from ai to bi. Of c... | instruction | 0 | 15,507 | 14 | 31,014 |
No | output | 1 | 15,507 | 14 | 31,015 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.