message stringlengths 2 43.5k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 853 107k | cluster float64 24 24 | __index_level_0__ int64 1.71k 214k |
|---|---|---|---|---|---|
Provide tags and a correct Python 3 solution for this coding contest problem.
Polycarp lives on a coordinate line at the point x = 0. He goes to his friend that lives at the point x = a. Polycarp can move only from left to right, he can pass one unit of length each second.
Now it's raining, so some segments of his wa... | instruction | 0 | 102,675 | 24 | 205,350 |
Tags: dp
Correct Solution:
```
from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush,heappop,heapify
import math
from collections import *
from functools import reduce,cmp_to_key
import sys
input = sys.stdin.readline
from itertools import accumulate
from functools import... | output | 1 | 102,675 | 24 | 205,351 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Polycarp lives on a coordinate line at the point x = 0. He goes to his friend that lives at the point x = a. Polycarp can move only from left to right, he can pass one unit of length each second.
Now it's raining, so some segments of his wa... | instruction | 0 | 102,676 | 24 | 205,352 |
Tags: dp
Correct Solution:
```
import io
import os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
INF = 10**15
def dp_min(dp, pos, new_val):
if pos not in dp:
dp[pos] = new_val
else:
dp[pos] = min(dp[pos], new_val)
def solve():
a, n, m = list(map(int, input().split()))
... | output | 1 | 102,676 | 24 | 205,353 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Polycarp lives on a coordinate line at the point x = 0. He goes to his friend that lives at the point x = a. Polycarp can move only from left to right, he can pass one unit of length each second.
Now it's raining, so some segments of his wa... | instruction | 0 | 102,677 | 24 | 205,354 |
Tags: dp
Correct Solution:
```
import sys
a, n, m = map(int, input().split(' '))
seg = []
for i in range(n):
rained = tuple(map(int, input().split(' ')))
for k in range(rained[0], rained[1]):
seg.append(k+1)
umbrella = []
for j in range(m):
u = tuple(map(int, input().split(' ')))
umbrella.appe... | output | 1 | 102,677 | 24 | 205,355 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Polycarp lives on a coordinate line at the point x = 0. He goes to his friend that lives at the point x = a. Polycarp can move only from left to right, he can pass one unit of length each second.
Now it's raining, so some segments of his wa... | instruction | 0 | 102,678 | 24 | 205,356 |
Tags: dp
Correct Solution:
```
# Codeforces Round #486 (Div. 3)
from functools import cmp_to_key
#key=cmp_to_key(lambda x,y: 1 if x not in y else -1 )
import sys
def getIntList():
return list(map(int, input().split()))
a,n,m = getIntList()
rainend = set()
umbr = {}
keyPointSet = set([0,a])
for i in ran... | output | 1 | 102,678 | 24 | 205,357 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Polycarp lives on a coordinate line at the point x = 0. He goes to his friend that lives at the point x = a. Polycarp can move only from left to right, he can pass one unit of length each second.
Now it's raining, so some segments of his wa... | instruction | 0 | 102,679 | 24 | 205,358 |
Tags: dp
Correct Solution:
```
import sys
a,m,n=list(map(int,input().split()))
aux=[0]*(a+1)
inf=10**15
dp=[aux.copy() for i in range(n+1)]
m1=10**12
m2=10**12
for i in range(m):
l,r=list(map(int,input().split()))
if l<m1:
m1=l
for j in range(l,r):
dp[0][j+1]=inf
s=[]
for i in range(1,n+1):
... | output | 1 | 102,679 | 24 | 205,359 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Polycarp lives on a coordinate line at the point x = 0. He goes to his friend that lives at the point x = a. Polycarp can move only from left to right, he can pass one unit of length each second.
Now it's raining, so some segments of his wa... | instruction | 0 | 102,680 | 24 | 205,360 |
Tags: dp
Correct Solution:
```
import sys
def input():
return sys.stdin.readline().strip()
def input_l():
return map(int, input().split())
def input_t():
return tuple(input_l())
def main():
a, s, d = input_l()
q = []
e = []
z = [0] * (a + 1)
for i in range(s):
w = in... | output | 1 | 102,680 | 24 | 205,361 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Polycarp lives on a coordinate line at the point x = 0. He goes to his friend that lives at the point x = a. Polycarp can move only from left to right, he can pass one unit of length each second... | instruction | 0 | 102,681 | 24 | 205,362 |
Yes | output | 1 | 102,681 | 24 | 205,363 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Polycarp lives on a coordinate line at the point x = 0. He goes to his friend that lives at the point x = a. Polycarp can move only from left to right, he can pass one unit of length each second... | instruction | 0 | 102,682 | 24 | 205,364 |
Yes | output | 1 | 102,682 | 24 | 205,365 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Polycarp lives on a coordinate line at the point x = 0. He goes to his friend that lives at the point x = a. Polycarp can move only from left to right, he can pass one unit of length each second... | instruction | 0 | 102,683 | 24 | 205,366 |
Yes | output | 1 | 102,683 | 24 | 205,367 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Polycarp lives on a coordinate line at the point x = 0. He goes to his friend that lives at the point x = a. Polycarp can move only from left to right, he can pass one unit of length each second... | instruction | 0 | 102,684 | 24 | 205,368 |
No | output | 1 | 102,684 | 24 | 205,369 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Polycarp lives on a coordinate line at the point x = 0. He goes to his friend that lives at the point x = a. Polycarp can move only from left to right, he can pass one unit of length each second... | instruction | 0 | 102,685 | 24 | 205,370 |
No | output | 1 | 102,685 | 24 | 205,371 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Polycarp lives on a coordinate line at the point x = 0. He goes to his friend that lives at the point x = a. Polycarp can move only from left to right, he can pass one unit of length each second... | instruction | 0 | 102,686 | 24 | 205,372 |
No | output | 1 | 102,686 | 24 | 205,373 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Polycarp lives on a coordinate line at the point x = 0. He goes to his friend that lives at the point x = a. Polycarp can move only from left to right, he can pass one unit of length each second... | instruction | 0 | 102,687 | 24 | 205,374 |
No | output | 1 | 102,687 | 24 | 205,375 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Now you can take online courses in the Berland State University! Polycarp needs to pass k main online courses of his specialty to get a diploma. In total n courses are availiable for the passage.
The situation is complicated by the dependen... | instruction | 0 | 103,362 | 24 | 206,724 |
Tags: *special, dfs and similar, graphs, implementation
Correct Solution:
```
cycle = False
def DFS(s):
global cycle
visited[s] = 1
stack = [s]
while len(stack) != 0:
u = stack[-1]
visited[u] = 1
if len(graph[u]) != 0:
v = graph[u].pop()
if visited[v] == 1:
cycle = True
r... | output | 1 | 103,362 | 24 | 206,725 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Now you can take online courses in the Berland State University! Polycarp needs to pass k main online courses of his specialty to get a diploma. In total n courses are availiable for the passage.
The situation is complicated by the dependen... | instruction | 0 | 103,363 | 24 | 206,726 |
Tags: *special, dfs and similar, graphs, implementation
Correct Solution:
```
# https://codeforces.com/problemset/problem/770/C
n, k = map(int, input().split())
K = set(list(map(int, input().split())))
g = {}
rg = {}
deg = {}
def push_d(deg, u, val):
if u not in deg:
deg[u] = 0
deg[u] += val
... | output | 1 | 103,363 | 24 | 206,727 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Now you can take online courses in the Berland State University! Polycarp needs to pass k main online courses of his specialty to get a diploma. In total n courses are availiable for the passage.
The situation is complicated by the dependen... | instruction | 0 | 103,364 | 24 | 206,728 |
Tags: *special, dfs and similar, graphs, implementation
Correct Solution:
```
def dfs(start_node, edges, colors, result):
stack = [start_node]
while stack:
current_node = stack[-1]
if colors[current_node] == 2:
stack.pop()
continue
colors[current_node] = 1
... | output | 1 | 103,364 | 24 | 206,729 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Now you can take online courses in the Berland State University! Polycarp needs to pass k main online courses of his specialty to get a diploma. In total n courses are availiable for the passage.
The situation is complicated by the dependen... | instruction | 0 | 103,365 | 24 | 206,730 |
Tags: *special, dfs and similar, graphs, implementation
Correct Solution:
```
n,k=list(map(lambda x: int(x), input().split()))
m=list(map(lambda x: int(x), input().split()))
from types import GeneratorType
def bootstrap(f, stack=[]):
def wrappedfunc(*args, **kwargs):
if stack:
return f(*args, **... | output | 1 | 103,365 | 24 | 206,731 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Now you can take online courses in the Berland State University! Polycarp needs to pass k main online courses of his specialty to get a diploma. In total n courses are availiable for the passage.
The situation is complicated by the dependen... | instruction | 0 | 103,366 | 24 | 206,732 |
Tags: *special, dfs and similar, graphs, implementation
Correct Solution:
```
import sys
def main():
n,k = map(int,sys.stdin.readline().split())
courses = list(map(int,sys.stdin.readline().split()))
courses = [x-1 for x in courses]
visited = [False]*n
used = [False]*n
ans = []
t = []
... | output | 1 | 103,366 | 24 | 206,733 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Now you can take online courses in the Berland State University! Polycarp needs to pass k main online courses of his specialty to get a diploma. In total n courses are availiable for the passage.
The situation is complicated by the dependen... | instruction | 0 | 103,367 | 24 | 206,734 |
Tags: *special, dfs and similar, graphs, implementation
Correct Solution:
```
import collections as col
import itertools as its
import sys
import operator
from copy import copy, deepcopy
class Solver:
def __init__(self):
pass
def solve(self):
n, k = map(int, input().split())
q = l... | output | 1 | 103,367 | 24 | 206,735 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Now you can take online courses in the Berland State University! Polycarp needs to pass k main online courses of his specialty to get a diploma. In total n courses are availiable for the passage.
The situation is complicated by the dependen... | instruction | 0 | 103,368 | 24 | 206,736 |
Tags: *special, dfs and similar, graphs, implementation
Correct Solution:
```
f = lambda: map(int, input().split())
g = lambda: [int(q) - 1 for q in f()]
class T:
def __init__(s, i):
s.i, s.t = i, g()[1:]
s.a = s.q = 0
n, k = f()
d = g()
p = [T(i) for i in range(n)]
s = []
while d:
x = p[d.po... | output | 1 | 103,368 | 24 | 206,737 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Now you can take online courses in the Berland State University! Polycarp needs to pass k main online courses of his specialty to get a diploma. In total n courses are availiable for the passage.
The situation is complicated by the dependen... | instruction | 0 | 103,369 | 24 | 206,738 |
Tags: *special, dfs and similar, graphs, implementation
Correct Solution:
```
from sys import *
f = lambda: list(map(int, stdin.readline().split()))
class T:
def __init__(self, i):
self.i, self.t = i, f()[1:]
self.a = self.q = 0
n, k = f()
d = f()
p = [None] + [T(i + 1) for i in range(n)]
s = []
... | output | 1 | 103,369 | 24 | 206,739 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Now you can take online courses in the Berland State University! Polycarp needs to pass k main online courses of his specialty to get a diploma. In total n courses are availiable for the passage... | instruction | 0 | 103,370 | 24 | 206,740 |
Yes | output | 1 | 103,370 | 24 | 206,741 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Now you can take online courses in the Berland State University! Polycarp needs to pass k main online courses of his specialty to get a diploma. In total n courses are availiable for the passage... | instruction | 0 | 103,371 | 24 | 206,742 |
Yes | output | 1 | 103,371 | 24 | 206,743 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Now you can take online courses in the Berland State University! Polycarp needs to pass k main online courses of his specialty to get a diploma. In total n courses are availiable for the passage... | instruction | 0 | 103,372 | 24 | 206,744 |
Yes | output | 1 | 103,372 | 24 | 206,745 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Now you can take online courses in the Berland State University! Polycarp needs to pass k main online courses of his specialty to get a diploma. In total n courses are availiable for the passage... | instruction | 0 | 103,373 | 24 | 206,746 |
Yes | output | 1 | 103,373 | 24 | 206,747 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Now you can take online courses in the Berland State University! Polycarp needs to pass k main online courses of his specialty to get a diploma. In total n courses are availiable for the passage... | instruction | 0 | 103,374 | 24 | 206,748 |
No | output | 1 | 103,374 | 24 | 206,749 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Now you can take online courses in the Berland State University! Polycarp needs to pass k main online courses of his specialty to get a diploma. In total n courses are availiable for the passage... | instruction | 0 | 103,375 | 24 | 206,750 |
No | output | 1 | 103,375 | 24 | 206,751 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Now you can take online courses in the Berland State University! Polycarp needs to pass k main online courses of his specialty to get a diploma. In total n courses are availiable for the passage... | instruction | 0 | 103,376 | 24 | 206,752 |
No | output | 1 | 103,376 | 24 | 206,753 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Now you can take online courses in the Berland State University! Polycarp needs to pass k main online courses of his specialty to get a diploma. In total n courses are availiable for the passage... | instruction | 0 | 103,377 | 24 | 206,754 |
No | output | 1 | 103,377 | 24 | 206,755 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Polycarp found on the street an array a of n elements.
Polycarp invented his criterion for the beauty of an array. He calls an array a beautiful if at least one of the following conditions must be met for each different pair of indices i β ... | instruction | 0 | 103,903 | 24 | 207,806 |
Tags: dp, math, number theory, sortings
Correct Solution:
```
for _ in range(int(input())):
length=int(input())
array=list(map(int,input().split()))
array.sort()
cnt=[0]*(max(array)+1)
dp=[0]*(max(array)+1)
for x in array:
cnt[x]+=1
"""
[3, 7, 9, 14, 63]
"""
f... | output | 1 | 103,903 | 24 | 207,807 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Polycarp found on the street an array a of n elements.
Polycarp invented his criterion for the beauty of an array. He calls an array a beautiful if at least one of the following conditions must be met for each different pair of indices i β ... | instruction | 0 | 103,904 | 24 | 207,808 |
Tags: dp, math, number theory, sortings
Correct Solution:
```
# Legends Always Come Up with Solution
# Author: Manvir Singh
import os
from io import BytesIO, IOBase
import sys
from collections import defaultdict, deque, Counter
from math import sqrt, pi, ceil, log, inf, gcd, floor
from itertools import combinations, p... | output | 1 | 103,904 | 24 | 207,809 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Polycarp found on the street an array a of n elements.
Polycarp invented his criterion for the beauty of an array. He calls an array a beautiful if at least one of the following conditions must be met for each different pair of indices i β ... | instruction | 0 | 103,905 | 24 | 207,810 |
Tags: dp, math, number theory, sortings
Correct Solution:
```
import os,io
input=io.BytesIO(os.read(0,os.fstat(0).st_size)).readline
from collections import deque
for i in range(int(input())):
n=int(input())
alist=list(map(int,input().split()))
maxN=int(2e5+1)
anslist=[0]*maxN
blist=[0]*maxN
f... | output | 1 | 103,905 | 24 | 207,811 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Polycarp found on the street an array a of n elements.
Polycarp invented his criterion for the beauty of an array. He calls an array a beautiful if at least one of the following conditions must be met for each different pair of indices i β ... | instruction | 0 | 103,906 | 24 | 207,812 |
Tags: dp, math, number theory, sortings
Correct Solution:
```
import sys
import math
def II():
return int(sys.stdin.readline())
def LI():
return list(map(int, sys.stdin.readline().split()))
def MI():
return map(int, sys.stdin.readline().split())
def SI():
return sys.stdin.readline().strip()
def FACT(n, mod)... | output | 1 | 103,906 | 24 | 207,813 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Polycarp found on the street an array a of n elements.
Polycarp invented his criterion for the beauty of an array. He calls an array a beautiful if at least one of the following conditions must be met for each different pair of indices i β ... | instruction | 0 | 103,907 | 24 | 207,814 |
Tags: dp, math, number theory, sortings
Correct Solution:
```
import sys
import copy
input=sys.stdin.readline
for z in range(int(input())):
n=int(input())
a=list(map(int,input().split()))
cnt=[0]*(2*10**5+10)
cnt2=[0]*(2*10**5+10)
a.sort()
num10=-1
cnt10=0
a2=[]
for i in range(n):
... | output | 1 | 103,907 | 24 | 207,815 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Polycarp found on the street an array a of n elements.
Polycarp invented his criterion for the beauty of an array. He calls an array a beautiful if at least one of the following conditions must be met for each different pair of indices i β ... | instruction | 0 | 103,908 | 24 | 207,816 |
Tags: dp, math, number theory, sortings
Correct Solution:
```
from sys import stdin
from collections import Counter
input = stdin.readline
for test in range(int(input())):
n = int(input())
lst = list(map(int, input().strip().split()))
N = max(lst) + 1
po = [0] * N
cnt = Counter(lst)
for k in r... | output | 1 | 103,908 | 24 | 207,817 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Polycarp found on the street an array a of n elements.
Polycarp invented his criterion for the beauty of an array. He calls an array a beautiful if at least one of the following conditions must be met for each different pair of indices i β ... | instruction | 0 | 103,909 | 24 | 207,818 |
Tags: dp, math, number theory, sortings
Correct Solution:
```
from bisect import bisect_left
for _ in range(int(input())):
n = int(input())
l = list(map(int, input().split()))
l.sort()
m = max(l)
z = [0] * (m+1)
f = [0] * (m+1)
for i in range(n):
z[l[i]] += 1
for i in sorted(set... | output | 1 | 103,909 | 24 | 207,819 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Polycarp found on the street an array a of n elements.
Polycarp invented his criterion for the beauty of an array. He calls an array a beautiful if at least one of the following conditions must be met for each different pair of indices i β ... | instruction | 0 | 103,910 | 24 | 207,820 |
Tags: dp, math, number theory, sortings
Correct Solution:
```
from collections import Counter
#fk this shit
def f(arr):
cnt=Counter(arr)
mxn=max(arr)+100
factor=[0]*(mxn)
for i in range(1,len(factor)):
factor[i]+=cnt.get(i,0)
for j in range(2*i,mxn,i):
factor[j]=max(factor[i],factor[j])
return len(arr)-ma... | output | 1 | 103,910 | 24 | 207,821 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Polycarp found on the street an array a of n elements.
Polycarp invented his criterion for the beauty of an array. He calls an array a beautiful if at least one of the following conditions must... | instruction | 0 | 103,911 | 24 | 207,822 |
Yes | output | 1 | 103,911 | 24 | 207,823 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Polycarp found on the street an array a of n elements.
Polycarp invented his criterion for the beauty of an array. He calls an array a beautiful if at least one of the following conditions must... | instruction | 0 | 103,912 | 24 | 207,824 |
Yes | output | 1 | 103,912 | 24 | 207,825 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Polycarp found on the street an array a of n elements.
Polycarp invented his criterion for the beauty of an array. He calls an array a beautiful if at least one of the following conditions must... | instruction | 0 | 103,913 | 24 | 207,826 |
Yes | output | 1 | 103,913 | 24 | 207,827 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Polycarp found on the street an array a of n elements.
Polycarp invented his criterion for the beauty of an array. He calls an array a beautiful if at least one of the following conditions must... | instruction | 0 | 103,914 | 24 | 207,828 |
Yes | output | 1 | 103,914 | 24 | 207,829 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Polycarp found on the street an array a of n elements.
Polycarp invented his criterion for the beauty of an array. He calls an array a beautiful if at least one of the following conditions must... | instruction | 0 | 103,915 | 24 | 207,830 |
No | output | 1 | 103,915 | 24 | 207,831 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Polycarp found on the street an array a of n elements.
Polycarp invented his criterion for the beauty of an array. He calls an array a beautiful if at least one of the following conditions must... | instruction | 0 | 103,916 | 24 | 207,832 |
No | output | 1 | 103,916 | 24 | 207,833 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Polycarp found on the street an array a of n elements.
Polycarp invented his criterion for the beauty of an array. He calls an array a beautiful if at least one of the following conditions must... | instruction | 0 | 103,917 | 24 | 207,834 |
No | output | 1 | 103,917 | 24 | 207,835 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Polycarp found on the street an array a of n elements.
Polycarp invented his criterion for the beauty of an array. He calls an array a beautiful if at least one of the following conditions must... | instruction | 0 | 103,918 | 24 | 207,836 |
No | output | 1 | 103,918 | 24 | 207,837 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Polycarp has a cat and his cat is a real gourmet! Dependent on a day of the week he eats certain type of food:
* on Mondays, Thursdays and Sundays he eats fish food;
* on Tuesdays and Saturdays he eats rabbit stew;
* on other days o... | instruction | 0 | 105,305 | 24 | 210,610 |
Tags: implementation, math
Correct Solution:
```
a,b,c=map(int,input().split())
fu=0
fu=min(a//3,b//2,c//2)
a-=3*fu
b-=2*fu
c-=2*fu
x=[1,2,3,1,3,2,1]
k=0
m=0
for i in range(len(x)):
d=0
f=0
j=i
a1=a
b1=b
c1=c
z=1
while z==1:
k=x[j]
if (k==1)&(a1>0):
a1-=1
... | output | 1 | 105,305 | 24 | 210,611 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Polycarp has a cat and his cat is a real gourmet! Dependent on a day of the week he eats certain type of food:
* on Mondays, Thursdays and Sundays he eats fish food;
* on Tuesdays and Saturdays he eats rabbit stew;
* on other days o... | instruction | 0 | 105,306 | 24 | 210,612 |
Tags: implementation, math
Correct Solution:
```
def dfs(day_l,day_r,a,b,c):
global span
if day_l<1 or day_r>14:
return
if a<0 or b<0 or c<0:
return
#print(day_l,day_r,a,b,c)
span=max(span,day_r-day_l+1)
if day_l-1 in [1,4,7,8,11,14]:
dfs(day_l-1,day_r,a-1,b,c)
eli... | output | 1 | 105,306 | 24 | 210,613 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Polycarp has a cat and his cat is a real gourmet! Dependent on a day of the week he eats certain type of food:
* on Mondays, Thursdays and Sundays he eats fish food;
* on Tuesdays and Saturdays he eats rabbit stew;
* on other days o... | instruction | 0 | 105,307 | 24 | 210,614 |
Tags: implementation, math
Correct Solution:
```
a, b, c = map(int, input().split())
x = min(a//3, b//2, c//2)
a,b,c = a-3*x, b-2*x, c-2*x
z = [1,1,2,3,1,3,2]
m = 0
for i in range(7):
lis = [0,a,b,c]
j = i
cnt = 0
while(lis[1]>=0 and lis[2]>=0 and lis[3]>=0):
lis[z[j]] -= 1
j = (j+1)%7
... | output | 1 | 105,307 | 24 | 210,615 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Polycarp has a cat and his cat is a real gourmet! Dependent on a day of the week he eats certain type of food:
* on Mondays, Thursdays and Sundays he eats fish food;
* on Tuesdays and Saturdays he eats rabbit stew;
* on other days o... | instruction | 0 | 105,308 | 24 | 210,616 |
Tags: implementation, math
Correct Solution:
```
a = [int(i) for i in input().split()]
days = [0, 1, 2, 0, 2, 1, 0]
week = min(a[0] // 3, a[1] // 2, a[2] // 2)
a[0], a[1], a[2] = a[0] - week * 3, a[1] - week * 2, a[2] - week * 2
m = 0
for day in range(7):
b = a.copy()
c = 0
for this_day in range(7):
... | output | 1 | 105,308 | 24 | 210,617 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Polycarp has a cat and his cat is a real gourmet! Dependent on a day of the week he eats certain type of food:
* on Mondays, Thursdays and Sundays he eats fish food;
* on Tuesdays and Saturdays he eats rabbit stew;
* on other days o... | instruction | 0 | 105,309 | 24 | 210,618 |
Tags: implementation, math
Correct Solution:
```
a,b,c = map(int,input().strip().split())
ans = 0
basi = min(c//2,min(b//2,a//3))
#print(basi)
aa = a- 3*basi
bb = b - 2*basi
cc = c - 2*basi
mp = {0:'aa',1:'aa',2:'bb',3:'cc',4:'aa',5:'cc',6:'bb'}
#print(aa,bb,cc)
for i in range(7):
aaa = aa
bbb = bb
cc... | output | 1 | 105,309 | 24 | 210,619 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.