message
stringlengths
2
20.1k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
1.95k
109k
cluster
float64
17
17
__index_level_0__
int64
3.91k
217k
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Manao works on a sports TV. He's spent much time watching the football games of some country. After a while he began to notice different patterns. For example, each team has two sets of uniforms...
instruction
0
57,405
17
114,810
Yes
output
1
57,405
17
114,811
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Manao works on a sports TV. He's spent much time watching the football games of some country. After a while he began to notice different patterns. For example, each team has two sets of uniforms...
instruction
0
57,406
17
114,812
Yes
output
1
57,406
17
114,813
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Manao works on a sports TV. He's spent much time watching the football games of some country. After a while he began to notice different patterns. For example, each team has two sets of uniforms...
instruction
0
57,407
17
114,814
Yes
output
1
57,407
17
114,815
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Manao works on a sports TV. He's spent much time watching the football games of some country. After a while he began to notice different patterns. For example, each team has two sets of uniforms...
instruction
0
57,408
17
114,816
No
output
1
57,408
17
114,817
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Manao works on a sports TV. He's spent much time watching the football games of some country. After a while he began to notice different patterns. For example, each team has two sets of uniforms...
instruction
0
57,409
17
114,818
No
output
1
57,409
17
114,819
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Manao works on a sports TV. He's spent much time watching the football games of some country. After a while he began to notice different patterns. For example, each team has two sets of uniforms...
instruction
0
57,410
17
114,820
No
output
1
57,410
17
114,821
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Manao works on a sports TV. He's spent much time watching the football games of some country. After a while he began to notice different patterns. For example, each team has two sets of uniforms...
instruction
0
57,411
17
114,822
No
output
1
57,411
17
114,823
Provide tags and a correct Python 3 solution for this coding contest problem. Demonstrative competitions will be held in the run-up to the 20NN Berlatov Olympic Games. Today is the day for the running competition! Berlatov team consists of 2n runners which are placed on two running tracks; n runners are placed on eac...
instruction
0
58,138
17
116,276
Tags: constructive algorithms, greedy, math Correct Solution: ``` import sys import os input = sys.stdin.readline def sum1n(n): return (n*(n+1))//2 def count_max(n): k1 = n//2 k2 = n - k1 return 2*sum1n(n) - sum1n(k1) - sum1n(k2) n, k = map(int, input().split()) mn = n*(n+1) // 2 if k < mn: ...
output
1
58,138
17
116,277
Provide tags and a correct Python 3 solution for this coding contest problem. Demonstrative competitions will be held in the run-up to the 20NN Berlatov Olympic Games. Today is the day for the running competition! Berlatov team consists of 2n runners which are placed on two running tracks; n runners are placed on eac...
instruction
0
58,139
17
116,278
Tags: constructive algorithms, greedy, math Correct Solution: ``` import sys import os input = sys.stdin.readline def sum1n(n): return (n*(n+1))//2 def count_max(n): k1 = n//2 k2 = n - k1 return 2*sum1n(n) - sum1n(k1) - sum1n(k2) n, k = map(int, input().split()) mn = n*(n+1) // 2 if k < mn: ...
output
1
58,139
17
116,279
Provide tags and a correct Python 3 solution for this coding contest problem. Demonstrative competitions will be held in the run-up to the 20NN Berlatov Olympic Games. Today is the day for the running competition! Berlatov team consists of 2n runners which are placed on two running tracks; n runners are placed on eac...
instruction
0
58,140
17
116,280
Tags: constructive algorithms, greedy, math Correct Solution: ``` import os, sys try: fin = open('in') except: fin = sys.stdin input = fin.readline n, k = map(int, input().split()) l, h = 0, 0 for i in range(1, n + 1): l += i h += max(i, n - i + 1) if k < l: print (-1) elif k > h: os.write(1, ('{}\n{}\n{}'.format(h...
output
1
58,140
17
116,281
Provide tags and a correct Python 3 solution for this coding contest problem. Demonstrative competitions will be held in the run-up to the 20NN Berlatov Olympic Games. Today is the day for the running competition! Berlatov team consists of 2n runners which are placed on two running tracks; n runners are placed on eac...
instruction
0
58,141
17
116,282
Tags: constructive algorithms, greedy, math Correct Solution: ``` n, t = [int(i) for i in input().split()] import os def tr(qq): return (qq*(qq+1))//2 if t < tr(n): print(-1) exit() upp = 2 * (tr(n) - tr(n//2)) if n % 2 == 1: upp -= (n+1)//2 if t >= upp: # print(upp) # exit() os.write(1,...
output
1
58,141
17
116,283
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Demonstrative competitions will be held in the run-up to the 20NN Berlatov Olympic Games. Today is the day for the running competition! Berlatov team consists of 2n runners which are placed on ...
instruction
0
58,142
17
116,284
No
output
1
58,142
17
116,285
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Demonstrative competitions will be held in the run-up to the 20NN Berlatov Olympic Games. Today is the day for the running competition! Berlatov team consists of 2n runners which are placed on ...
instruction
0
58,143
17
116,286
No
output
1
58,143
17
116,287
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Demonstrative competitions will be held in the run-up to the 20NN Berlatov Olympic Games. Today is the day for the running competition! Berlatov team consists of 2n runners which are placed on ...
instruction
0
58,144
17
116,288
No
output
1
58,144
17
116,289
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Demonstrative competitions will be held in the run-up to the 20NN Berlatov Olympic Games. Today is the day for the running competition! Berlatov team consists of 2n runners which are placed on ...
instruction
0
58,145
17
116,290
No
output
1
58,145
17
116,291
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n boys and m girls studying in the class. They should stand in a line so that boys and girls alternated there as much as possible. Let's assume that positions in the line are indexed f...
instruction
0
58,312
17
116,624
No
output
1
58,312
17
116,625
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n boys and m girls studying in the class. They should stand in a line so that boys and girls alternated there as much as possible. Let's assume that positions in the line are indexed f...
instruction
0
58,313
17
116,626
No
output
1
58,313
17
116,627
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n boys and m girls studying in the class. They should stand in a line so that boys and girls alternated there as much as possible. Let's assume that positions in the line are indexed f...
instruction
0
58,314
17
116,628
No
output
1
58,314
17
116,629
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The Berland State University is hosting a ballroom dance in celebration of its 100500-th anniversary! n boys and m girls are already busy rehearsing waltz, minuet, polonaise and quadrille moves....
instruction
0
58,413
17
116,826
Yes
output
1
58,413
17
116,827
Provide tags and a correct Python 3 solution for this coding contest problem. The All-Berland National Olympiad in Informatics has just ended! Now Vladimir wants to upload the contest from the Olympiad as a gym to a popular Codehorses website. Unfortunately, the archive with Olympiad's data is a mess. For example, th...
instruction
0
58,588
17
117,176
Tags: greedy, implementation Correct Solution: ``` n = int(input()) t = [1] + [0] * n b, a = d = [], [] h, s = [], [] for i in range(n): f, k = input().split() d[int(k)].append(f) m = len(a) for i in a: if i.isdigit() and i[0] != '0': j = int(i) if 0 < j <= m: t[j] = 1 ...
output
1
58,588
17
117,177
Provide tags and a correct Python 3 solution for this coding contest problem. The All-Berland National Olympiad in Informatics has just ended! Now Vladimir wants to upload the contest from the Olympiad as a gym to a popular Codehorses website. Unfortunately, the archive with Olympiad's data is a mess. For example, th...
instruction
0
58,589
17
117,178
Tags: greedy, implementation Correct Solution: ``` def print_all(): print(top) print(free_top) print(busy_top) print(bottom) print(free_bottom) print(busy_bottom) n = int(input()) top = set() bottom = set() for i in range(n): name, type = input().split() if type == '1': top.add(...
output
1
58,589
17
117,179
Provide tags and a correct Python 3 solution for this coding contest problem. The All-Berland National Olympiad in Informatics has just ended! Now Vladimir wants to upload the contest from the Olympiad as a gym to a popular Codehorses website. Unfortunately, the archive with Olympiad's data is a mess. For example, th...
instruction
0
58,590
17
117,180
Tags: greedy, implementation 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**10 mod = 10**9+7 def LI(): return [int(x) for x in sys.stdin.readline().split()] def LI_(): return [int(x...
output
1
58,590
17
117,181
Provide tags and a correct Python 3 solution for this coding contest problem. The All-Berland National Olympiad in Informatics has just ended! Now Vladimir wants to upload the contest from the Olympiad as a gym to a popular Codehorses website. Unfortunately, the archive with Olympiad's data is a mess. For example, th...
instruction
0
58,591
17
117,182
Tags: greedy, implementation Correct Solution: ``` import random def genTemp(): sl = "" firstTime = True while firstTime or sl in pre or sl in post: sl = "" firstTime = False for i in range(6): sl += chr(random.randint(ord("a"), ord("z"))) return sl n = int(input())...
output
1
58,591
17
117,183
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya has been playing Plane of Tanks with his friends the whole year. Now it is time to divide the participants into several categories depending on their results. A player is given a non-negative integer number of points in each round of...
instruction
0
59,097
17
118,194
Tags: implementation Correct Solution: ``` class Player: def __init__(self, name, score): self.name = name self.score = score class Tier: def __init__(self, label, percentile): self.label = label self.percentile = percentile tier_data = [ ('pro', 99), ('hardcore', 90), ...
output
1
59,097
17
118,195
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya has been playing Plane of Tanks with his friends the whole year. Now it is time to divide the participants into several categories depending on their results. A player is given a non-negative integer number of points in each round of...
instruction
0
59,098
17
118,196
Tags: implementation Correct Solution: ``` from collections import defaultdict n = int(input()) p = defaultdict(int) for i in range(n): a, b = input().split() p[a] = max(p[a], int(b)) b = sorted(p.values()) n = len(b) noob = b[(n - 1) // 2] random = b[n - 1 - n // 5] average = b[n - 1 - n // 10] hardcore = b[n ...
output
1
59,098
17
118,197
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya has been playing Plane of Tanks with his friends the whole year. Now it is time to divide the participants into several categories depending on their results. A player is given a non-negative integer number of points in each round of...
instruction
0
59,099
17
118,198
Tags: implementation Correct Solution: ``` from collections import defaultdict R = lambda: map(int, input().split()) n = int(input()) mp = defaultdict(int) for i in range(n): name, sc = input().split() sc = int(sc) mp[name] = max(sc, mp[name]) players = sorted([(k, v) for k, v in mp.items()], key=lambda x:...
output
1
59,099
17
118,199
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya has been playing Plane of Tanks with his friends the whole year. Now it is time to divide the participants into several categories depending on their results. A player is given a non-negative integer number of points in each round of...
instruction
0
59,100
17
118,200
Tags: implementation Correct Solution: ``` import sys import math from heapq import *; input = sys.stdin.readline from functools import cmp_to_key; def pi(): return(int(input())) def pl(): return(int(input(), 16)) def ti(): return(list(map(int,input().split()))) def ts(): s = input() return(list(s[...
output
1
59,100
17
118,201
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya has been playing Plane of Tanks with his friends the whole year. Now it is time to divide the participants into several categories depending on their results. A player is given a non-negative integer number of points in each round of...
instruction
0
59,101
17
118,202
Tags: implementation Correct Solution: ``` def t(g, n): for x, y in ((50, 'noob'), (20, 'random'), (10, 'average'), (1, 'hardcore')): if g > x * n // 100: return y return 'pro' p, st = {}, {} for i in range(int(input())): n, s = input().split() if n not in p or int(s) > p[n]: ...
output
1
59,101
17
118,203
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya has been playing Plane of Tanks with his friends the whole year. Now it is time to divide the participants into several categories depending on their results. A player is given a non-negative integer number of points in each round of...
instruction
0
59,102
17
118,204
Tags: implementation Correct Solution: ``` from collections import defaultdict from bisect import bisect_left p, n = defaultdict(int), int(input()) for i in range(n): a, b = input().split() p[a] = max(p[a], int(b)) p, n = sorted((b, a) for a, b in p.items()), len(p) t = [0] + [bisect_left(p, (p[n - 1 - n // k][...
output
1
59,102
17
118,205
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya has been playing Plane of Tanks with his friends the whole year. Now it is time to divide the participants into several categories depending on their results. A player is given a non-negative integer number of points in each round of...
instruction
0
59,103
17
118,206
Tags: implementation Correct Solution: ``` I=input P=print d={} for _ in'0'*int(I()):a,b=I().split();d[a]=max(d.get(a,0),int(b)) v=d.values() n=len(d) P(n) for k in d: a=b=0 for x in v:a+=x<=d[k];b+=x>d[k] s='noob';a/=n;b/=n if a>=.5and b>=.2:s='random' if a>=.8and b>=.1:s='average' if a>=.9and b>=.01:s='hardcore...
output
1
59,103
17
118,207
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya has been playing Plane of Tanks with his friends the whole year. Now it is time to divide the participants into several categories depending on their results. A player is given a non-negative integer number of points in each round of...
instruction
0
59,104
17
118,208
Tags: implementation Correct Solution: ``` n = int(input()) d = {} for _ in '0' * n: s, v = input().split() d[s] = max(d.get(s, 0), int(v)) v = d.values() res = str(len(d)) + '\n' for k in d: a, b = 0, 0 for x in v: a += x <= d[k] b += x > d[k] s = 'noob' a /= len(d) b /= len...
output
1
59,104
17
118,209
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vasya has been playing Plane of Tanks with his friends the whole year. Now it is time to divide the participants into several categories depending on their results. A player is given a non-neg...
instruction
0
59,105
17
118,210
Yes
output
1
59,105
17
118,211
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vasya has been playing Plane of Tanks with his friends the whole year. Now it is time to divide the participants into several categories depending on their results. A player is given a non-neg...
instruction
0
59,106
17
118,212
Yes
output
1
59,106
17
118,213
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vasya has been playing Plane of Tanks with his friends the whole year. Now it is time to divide the participants into several categories depending on their results. A player is given a non-neg...
instruction
0
59,107
17
118,214
No
output
1
59,107
17
118,215
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vasya has been playing Plane of Tanks with his friends the whole year. Now it is time to divide the participants into several categories depending on their results. A player is given a non-neg...
instruction
0
59,108
17
118,216
No
output
1
59,108
17
118,217
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vasya has been playing Plane of Tanks with his friends the whole year. Now it is time to divide the participants into several categories depending on their results. A player is given a non-neg...
instruction
0
59,109
17
118,218
No
output
1
59,109
17
118,219
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vasya has been playing Plane of Tanks with his friends the whole year. Now it is time to divide the participants into several categories depending on their results. A player is given a non-neg...
instruction
0
59,110
17
118,220
No
output
1
59,110
17
118,221
Provide tags and a correct Python 3 solution for this coding contest problem. Two boys decided to compete in text typing on the site "Key races". During the competition, they have to type a text consisting of s characters. The first participant types one character in v1 milliseconds and has ping t1 milliseconds. The s...
instruction
0
60,316
17
120,632
Tags: math Correct Solution: ``` a = list(map(int, input().split(' '))) c = (a[0] * a[1] + 2*a[3]) - (a[0]*a[2] + 2*a[4]) if(c < 0): print('First') elif (c > 0): print('Second') else: print('Friendship') ```
output
1
60,316
17
120,633
Provide tags and a correct Python 3 solution for this coding contest problem. Two boys decided to compete in text typing on the site "Key races". During the competition, they have to type a text consisting of s characters. The first participant types one character in v1 milliseconds and has ping t1 milliseconds. The s...
instruction
0
60,317
17
120,634
Tags: math Correct Solution: ``` x = list(map(int, input().split())) a = (x[0]*x[1]) + (2*x[3]) b = (x[0]*x[2]) + (2*x[4]) if a < b: print("First") elif a > b: print("Second") else: print("Friendship") ```
output
1
60,317
17
120,635
Provide tags and a correct Python 3 solution for this coding contest problem. Two boys decided to compete in text typing on the site "Key races". During the competition, they have to type a text consisting of s characters. The first participant types one character in v1 milliseconds and has ping t1 milliseconds. The s...
instruction
0
60,318
17
120,636
Tags: math Correct Solution: ``` a,b,c,d,e=map(int,input().split()) f =a/(1/b)+2*d g=a/(1/c)+2*e if f<g: print("First") elif f==g: print("Friendship") else: print("Second") ```
output
1
60,318
17
120,637
Provide tags and a correct Python 3 solution for this coding contest problem. Two boys decided to compete in text typing on the site "Key races". During the competition, they have to type a text consisting of s characters. The first participant types one character in v1 milliseconds and has ping t1 milliseconds. The s...
instruction
0
60,319
17
120,638
Tags: math Correct Solution: ``` s, v1, v2, t1, t2 = map(int, input().split()) if s * v1 + 2 * t1 == s * v2 + 2 * t2: print('Friendship') else: if s * v1 + 2 * t1 < s * v2 + 2 * t2: print('First') else: print('Second') ```
output
1
60,319
17
120,639
Provide tags and a correct Python 3 solution for this coding contest problem. Two boys decided to compete in text typing on the site "Key races". During the competition, they have to type a text consisting of s characters. The first participant types one character in v1 milliseconds and has ping t1 milliseconds. The s...
instruction
0
60,320
17
120,640
Tags: math Correct Solution: ``` s,v1,v2,t1,t2 = map(int,input().split()) if t1 * 2 + v1 * s < t2 * 2 + v2 * s: print('First') elif t1 * 2 + v1 * s > t2 * 2 + v2 * s: print('Second') else: print('Friendship') ```
output
1
60,320
17
120,641
Provide tags and a correct Python 3 solution for this coding contest problem. Two boys decided to compete in text typing on the site "Key races". During the competition, they have to type a text consisting of s characters. The first participant types one character in v1 milliseconds and has ping t1 milliseconds. The s...
instruction
0
60,321
17
120,642
Tags: math Correct Solution: ``` s, v1, v2, t1, t2 = list(map(int, input().split())) tt1, tt2 = (s*v1)+(2*t1), (s*v2)+(2*t2) if tt1==tt2: print('Friendship') else: print(['First','Second'][tt2<tt1]) ```
output
1
60,321
17
120,643
Provide tags and a correct Python 3 solution for this coding contest problem. Two boys decided to compete in text typing on the site "Key races". During the competition, they have to type a text consisting of s characters. The first participant types one character in v1 milliseconds and has ping t1 milliseconds. The s...
instruction
0
60,322
17
120,644
Tags: math Correct Solution: ``` s,v1,v2,t1,t2=map(int, input().split()) a=(s*v1+2*t1)-(s*v2+2*t2) if a<0: print("First") elif a>0: print("Second") else: print("Friendship") ```
output
1
60,322
17
120,645
Provide tags and a correct Python 3 solution for this coding contest problem. Two boys decided to compete in text typing on the site "Key races". During the competition, they have to type a text consisting of s characters. The first participant types one character in v1 milliseconds and has ping t1 milliseconds. The s...
instruction
0
60,323
17
120,646
Tags: math Correct Solution: ``` s,v1,v2,t1,t2=input().split() time_1=int(t1)+int(s)*int(v1)+int(t1) time_2=int(t2)++int(s)*int(v2)+int(t2) if(time_1<time_2): print("First") elif(time_2<time_1): print("Second") else: print("Friendship") ```
output
1
60,323
17
120,647
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Two boys decided to compete in text typing on the site "Key races". During the competition, they have to type a text consisting of s characters. The first participant types one character in v1 m...
instruction
0
60,324
17
120,648
Yes
output
1
60,324
17
120,649
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Two boys decided to compete in text typing on the site "Key races". During the competition, they have to type a text consisting of s characters. The first participant types one character in v1 m...
instruction
0
60,325
17
120,650
Yes
output
1
60,325
17
120,651
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Two boys decided to compete in text typing on the site "Key races". During the competition, they have to type a text consisting of s characters. The first participant types one character in v1 m...
instruction
0
60,326
17
120,652
Yes
output
1
60,326
17
120,653
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Two boys decided to compete in text typing on the site "Key races". During the competition, they have to type a text consisting of s characters. The first participant types one character in v1 m...
instruction
0
60,327
17
120,654
Yes
output
1
60,327
17
120,655
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Two boys decided to compete in text typing on the site "Key races". During the competition, they have to type a text consisting of s characters. The first participant types one character in v1 m...
instruction
0
60,328
17
120,656
No
output
1
60,328
17
120,657