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. Vanya wants to pass n exams and get the academic scholarship. He will get the scholarship if the average grade mark for all the exams is at least avg. The exam grade cannot exceed r. Vanya has p...
instruction
0
22,467
17
44,934
Yes
output
1
22,467
17
44,935
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vanya wants to pass n exams and get the academic scholarship. He will get the scholarship if the average grade mark for all the exams is at least avg. The exam grade cannot exceed r. Vanya has p...
instruction
0
22,471
17
44,942
No
output
1
22,471
17
44,943
Provide tags and a correct Python 3 solution for this coding contest problem. Berland annual chess tournament is coming! Organizers have gathered 2·n chess players who should be divided into two teams with n people each. The first team is sponsored by BerOil and the second team is sponsored by BerMobile. Obviously, o...
instruction
0
22,559
17
45,118
Tags: implementation, sortings Correct Solution: ``` n=int(input()) l=[] l= [int(x) for x in input().split()] l.sort() s=l[n] t=[] for i in range(n): t.append(l[i]) if s not in t: print("YES") else: print("NO") ```
output
1
22,559
17
45,119
Provide tags and a correct Python 3 solution for this coding contest problem. Berland annual chess tournament is coming! Organizers have gathered 2·n chess players who should be divided into two teams with n people each. The first team is sponsored by BerOil and the second team is sponsored by BerMobile. Obviously, o...
instruction
0
22,560
17
45,120
Tags: implementation, sortings Correct Solution: ``` n = int(input()) a = list(map(int, input().split())) for el in range(2 * n): for i in range(2 * n - el - 1): if a[i] > a[i + 1]: a[i], a[i + 1] = a[i + 1], a[i] k1 = [] k2 = [] for el in range(n): k1.append(a[el]) for el in range(n, n * 2)...
output
1
22,560
17
45,121
Provide tags and a correct Python 3 solution for this coding contest problem. Berland annual chess tournament is coming! Organizers have gathered 2·n chess players who should be divided into two teams with n people each. The first team is sponsored by BerOil and the second team is sponsored by BerMobile. Obviously, o...
instruction
0
22,561
17
45,122
Tags: implementation, sortings Correct Solution: ``` from collections import Counter def Chess_tourney(): n = int(input()) array = list(map(int,input().split())) Quicksort(array,0,2*n-1) if (array[n] == array[n-1]): return "NO" return "YES" # return "YES" def Quicksort(array,p,r): if (p< r): q = Partition...
output
1
22,561
17
45,123
Provide tags and a correct Python 3 solution for this coding contest problem. Berland annual chess tournament is coming! Organizers have gathered 2·n chess players who should be divided into two teams with n people each. The first team is sponsored by BerOil and the second team is sponsored by BerMobile. Obviously, o...
instruction
0
22,562
17
45,124
Tags: implementation, sortings Correct Solution: ``` from sys import stdin n = int(input()) l = list(map(int, stdin.readline().split())) l.sort() flag = 0 for i in range(n): if l[n - i - 1] == l[n + i]: flag = 1 break if flag: print("NO") else: print("YES") ```
output
1
22,562
17
45,125
Provide tags and a correct Python 3 solution for this coding contest problem. Berland annual chess tournament is coming! Organizers have gathered 2·n chess players who should be divided into two teams with n people each. The first team is sponsored by BerOil and the second team is sponsored by BerMobile. Obviously, o...
instruction
0
22,563
17
45,126
Tags: implementation, sortings Correct Solution: ``` n = int(input()) l=[int(i) for i in input().split()] l.sort() if l[n]>l[n-1]: print("YES") else: print("NO") ```
output
1
22,563
17
45,127
Provide tags and a correct Python 3 solution for this coding contest problem. Berland annual chess tournament is coming! Organizers have gathered 2·n chess players who should be divided into two teams with n people each. The first team is sponsored by BerOil and the second team is sponsored by BerMobile. Obviously, o...
instruction
0
22,564
17
45,128
Tags: implementation, sortings Correct Solution: ``` n = int(input()) a = sorted(list(map(int, input().split()))) print(('NO', 'YES')[a[n] > a[n - 1]]) ```
output
1
22,564
17
45,129
Provide tags and a correct Python 3 solution for this coding contest problem. Berland annual chess tournament is coming! Organizers have gathered 2·n chess players who should be divided into two teams with n people each. The first team is sponsored by BerOil and the second team is sponsored by BerMobile. Obviously, o...
instruction
0
22,565
17
45,130
Tags: implementation, sortings Correct Solution: ``` # A. Шахматный турнир n = int(input()) arr = list(map(int, input().split())) n = n * 2 for i in range(n): for j in range(n-1,0,-1): if arr[j] > arr[j-1]: arr[j], arr[j-1] = arr[j-1], arr[j] n = int(n/2) if (arr[n-1]) <= arr[n]: print("NO") # break else: p...
output
1
22,565
17
45,131
Provide tags and a correct Python 3 solution for this coding contest problem. Berland annual chess tournament is coming! Organizers have gathered 2·n chess players who should be divided into two teams with n people each. The first team is sponsored by BerOil and the second team is sponsored by BerMobile. Obviously, o...
instruction
0
22,566
17
45,132
Tags: implementation, sortings Correct Solution: ``` n = int(input()) l = list(map(int, input().split())) l.sort() mid = l[n] r = True for i in range(n): if l[i] >= mid: r = False break if r: print("YES") else: print("NO") ```
output
1
22,566
17
45,133
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Berland annual chess tournament is coming! Organizers have gathered 2·n chess players who should be divided into two teams with n people each. The first team is sponsored by BerOil and the seco...
instruction
0
22,567
17
45,134
Yes
output
1
22,567
17
45,135
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Berland annual chess tournament is coming! Organizers have gathered 2·n chess players who should be divided into two teams with n people each. The first team is sponsored by BerOil and the seco...
instruction
0
22,568
17
45,136
Yes
output
1
22,568
17
45,137
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Berland annual chess tournament is coming! Organizers have gathered 2·n chess players who should be divided into two teams with n people each. The first team is sponsored by BerOil and the seco...
instruction
0
22,569
17
45,138
Yes
output
1
22,569
17
45,139
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Berland annual chess tournament is coming! Organizers have gathered 2·n chess players who should be divided into two teams with n people each. The first team is sponsored by BerOil and the seco...
instruction
0
22,570
17
45,140
Yes
output
1
22,570
17
45,141
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Berland annual chess tournament is coming! Organizers have gathered 2·n chess players who should be divided into two teams with n people each. The first team is sponsored by BerOil and the seco...
instruction
0
22,571
17
45,142
No
output
1
22,571
17
45,143
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Berland annual chess tournament is coming! Organizers have gathered 2·n chess players who should be divided into two teams with n people each. The first team is sponsored by BerOil and the seco...
instruction
0
22,572
17
45,144
No
output
1
22,572
17
45,145
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Berland annual chess tournament is coming! Organizers have gathered 2·n chess players who should be divided into two teams with n people each. The first team is sponsored by BerOil and the seco...
instruction
0
22,573
17
45,146
No
output
1
22,573
17
45,147
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Berland annual chess tournament is coming! Organizers have gathered 2·n chess players who should be divided into two teams with n people each. The first team is sponsored by BerOil and the seco...
instruction
0
22,574
17
45,148
No
output
1
22,574
17
45,149
Provide tags and a correct Python 3 solution for this coding contest problem. Nikolay has only recently started in competitive programming, but already qualified to the finals of one prestigious olympiad. There going to be n participants, one of whom is Nikolay. Like any good olympiad, it consists of two rounds. Tired...
instruction
0
22,992
17
45,984
Tags: constructive algorithms, greedy, implementation, math Correct Solution: ``` # -*- coding: utf-8 -*- import bisect import heapq import math import random import sys from collections import Counter, defaultdict, deque from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal from functools import lru_cache, reduce ...
output
1
22,992
17
45,985
Provide tags and a correct Python 3 solution for this coding contest problem. Nikolay has only recently started in competitive programming, but already qualified to the finals of one prestigious olympiad. There going to be n participants, one of whom is Nikolay. Like any good olympiad, it consists of two rounds. Tired...
instruction
0
22,993
17
45,986
Tags: constructive algorithms, greedy, implementation, math Correct Solution: ``` T = int(input()) for _ in range(T): n, x, y = map(int, input().split()) if x > y: x, y = y, x ans1 = 1 if x + y <= n else x + y - n + 1 if ans1 > n: ans1 -= 1 ans2 = n if x + y > n else x + y - 1 ...
output
1
22,993
17
45,987
Provide tags and a correct Python 3 solution for this coding contest problem. Nikolay has only recently started in competitive programming, but already qualified to the finals of one prestigious olympiad. There going to be n participants, one of whom is Nikolay. Like any good olympiad, it consists of two rounds. Tired...
instruction
0
22,994
17
45,988
Tags: constructive algorithms, greedy, implementation, math Correct Solution: ``` def f(): n, x, y = [int(s) for s in input().split()] bar = x+y if bar >= n+1: bad = n else: bad = bar-1 if bar <= n: good = 1 else: if bar == 2*n: good = n else: ...
output
1
22,994
17
45,989
Provide tags and a correct Python 3 solution for this coding contest problem. Nikolay has only recently started in competitive programming, but already qualified to the finals of one prestigious olympiad. There going to be n participants, one of whom is Nikolay. Like any good olympiad, it consists of two rounds. Tired...
instruction
0
22,995
17
45,990
Tags: constructive algorithms, greedy, implementation, math Correct Solution: ``` test = int(input()) for i in range(test): l = list(map(int,input().split())) #Worst Case n,x,y = l[0] ,l[1] ,l[2] part1 = min(n-x,y-1) part2 = min(n-y,x-1) w = part1 + part2 + min(y-1-part1,x-1-part2) worst = w+1 #including the...
output
1
22,995
17
45,991
Provide tags and a correct Python 3 solution for this coding contest problem. Nikolay has only recently started in competitive programming, but already qualified to the finals of one prestigious olympiad. There going to be n participants, one of whom is Nikolay. Like any good olympiad, it consists of two rounds. Tired...
instruction
0
22,996
17
45,992
Tags: constructive algorithms, greedy, implementation, math Correct Solution: ``` t = int(input()) while t: t -= 1 n, x, y = map(int, input().split()) x, y = max(x, y), min(x, y) _min = min(n, max(x + y - n + 1, 1)) _max = min(x + y - 1, n) print(_min, _max) ```
output
1
22,996
17
45,993
Provide tags and a correct Python 3 solution for this coding contest problem. Nikolay has only recently started in competitive programming, but already qualified to the finals of one prestigious olympiad. There going to be n participants, one of whom is Nikolay. Like any good olympiad, it consists of two rounds. Tired...
instruction
0
22,997
17
45,994
Tags: constructive algorithms, greedy, implementation, math Correct Solution: ``` t = int(input()) for _ in range(t): n,x,y = map(int, input().split()) maxidx = min(x+y-1, n) if x!=1 else min(x+y-2, n) minidx=max(x+y-n, 0) if x!=n else min(x+y-n+1, n) if maxidx<y: ansmax=maxidx+1 else: ...
output
1
22,997
17
45,995
Provide tags and a correct Python 3 solution for this coding contest problem. Nikolay has only recently started in competitive programming, but already qualified to the finals of one prestigious olympiad. There going to be n participants, one of whom is Nikolay. Like any good olympiad, it consists of two rounds. Tired...
instruction
0
22,998
17
45,996
Tags: constructive algorithms, greedy, implementation, math Correct Solution: ``` def main(): t = int(input()) for _ in range(t): n,x,y = map(int,input().split()) a,b = 1,n if x+y < n+1: b = x+y-1 else: a = min(n,x+y+1-n) print(a,b) if __name__ =...
output
1
22,998
17
45,997
Provide tags and a correct Python 3 solution for this coding contest problem. Nikolay has only recently started in competitive programming, but already qualified to the finals of one prestigious olympiad. There going to be n participants, one of whom is Nikolay. Like any good olympiad, it consists of two rounds. Tired...
instruction
0
22,999
17
45,998
Tags: constructive algorithms, greedy, implementation, math Correct Solution: ``` t=int(input()) for i in range(t): N,X,Y=[int(x) for x in input().split()] min_place=max(1,min(N,X+Y-N+1)) max_place=min(N,X+Y-1) print(min_place,max_place) ```
output
1
22,999
17
45,999
Provide tags and a correct Python 3 solution for this coding contest problem. There are n people who want to participate in a boat competition. The weight of the i-th participant is w_i. Only teams consisting of two people can participate in this competition. As an organizer, you think that it's fair to allow only tea...
instruction
0
23,057
17
46,114
Tags: brute force, greedy, two pointers Correct Solution: ``` import sys,os if(os.path.exists("input.txt")): sys.stdin = open("input.txt","r") sys.stdout = open("output.txt","w") input=lambda:sys.stdin.readline().strip() li = lambda:list(map(int,input().split())) I = lambda:int(input()) for _ in range(I()): n = I()...
output
1
23,057
17
46,115
Provide tags and a correct Python 3 solution for this coding contest problem. There are n people who want to participate in a boat competition. The weight of the i-th participant is w_i. Only teams consisting of two people can participate in this competition. As an organizer, you think that it's fair to allow only tea...
instruction
0
23,058
17
46,116
Tags: brute force, greedy, two pointers Correct Solution: ``` from collections import defaultdict for i in range(int(input())): n = int(input()) a = list(map(int,input().split())) d = defaultdict(int) for i in a: d[i]+=1 su = defaultdict(int) for i in d: for j in d: ...
output
1
23,058
17
46,117
Provide tags and a correct Python 3 solution for this coding contest problem. There are n people who want to participate in a boat competition. The weight of the i-th participant is w_i. Only teams consisting of two people can participate in this competition. As an organizer, you think that it's fair to allow only tea...
instruction
0
23,059
17
46,118
Tags: brute force, greedy, two pointers Correct Solution: ``` t = int(input()) for _ in range(t): n = int(input()) w = list(map(int, input().split())) cnt = [0] * (n+1) for x in w: cnt[x] += 1 res = 0 for S in range(2, 2*n + 1): lo, hi = 0, n tmp = 0 w...
output
1
23,059
17
46,119
Provide tags and a correct Python 3 solution for this coding contest problem. There are n people who want to participate in a boat competition. The weight of the i-th participant is w_i. Only teams consisting of two people can participate in this competition. As an organizer, you think that it's fair to allow only tea...
instruction
0
23,060
17
46,120
Tags: brute force, greedy, two pointers Correct Solution: ``` for _ in range(int(input())): n=int(input()) a=list(map(int,input().split())) from collections import Counter b=Counter(a) k=sorted(list(b.keys())) s=set() for i in range(len(k)-1): for j in range(i+1,len(k)): s.add(k[i]+k[j]) gm=0 for i in s: ...
output
1
23,060
17
46,121
Provide tags and a correct Python 3 solution for this coding contest problem. There are n people who want to participate in a boat competition. The weight of the i-th participant is w_i. Only teams consisting of two people can participate in this competition. As an organizer, you think that it's fair to allow only tea...
instruction
0
23,061
17
46,122
Tags: brute force, greedy, two pointers Correct Solution: ``` t=int(input()) for _ in range(t): n=int(input()) arr=[int(x) for x in input().split()] sum1=sum(arr) dp=[0]*(sum1+1) che=[] for i in range(len(dp)): che.append(set()) for i in range(len(arr)): for j in...
output
1
23,061
17
46,123
Provide tags and a correct Python 3 solution for this coding contest problem. There are n people who want to participate in a boat competition. The weight of the i-th participant is w_i. Only teams consisting of two people can participate in this competition. As an organizer, you think that it's fair to allow only tea...
instruction
0
23,062
17
46,124
Tags: brute force, greedy, two pointers Correct Solution: ``` #Consistency is the key. #code by: amrit00 from sys import stdin,stdout import math input=stdin.readline def print(*args,end='\n'): s=[] for i in args: s.append(str(i)+' ') s=''.join(s) stdout.write(s+end) def solve(): n=int...
output
1
23,062
17
46,125
Provide tags and a correct Python 3 solution for this coding contest problem. There are n people who want to participate in a boat competition. The weight of the i-th participant is w_i. Only teams consisting of two people can participate in this competition. As an organizer, you think that it's fair to allow only tea...
instruction
0
23,063
17
46,126
Tags: brute force, greedy, two pointers Correct Solution: ``` #------------------------template--------------------------# import os import sys from math import * from collections import * from fractions import * from bisect import * from heapq import* from io import BytesIO, IOBase def vsInput(): sys.stdin = open(...
output
1
23,063
17
46,127
Provide tags and a correct Python 3 solution for this coding contest problem. There are n people who want to participate in a boat competition. The weight of the i-th participant is w_i. Only teams consisting of two people can participate in this competition. As an organizer, you think that it's fair to allow only tea...
instruction
0
23,064
17
46,128
Tags: brute force, greedy, two pointers Correct Solution: ``` from collections import* for s in[*open(0)][2::2]: c=Counter(map(int,s.split()));r=[0]*101 for x in c: for y in c:r[x+y]+=min(c[x],c[y]) print(max(r)//2) ```
output
1
23,064
17
46,129
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n people who want to participate in a boat competition. The weight of the i-th participant is w_i. Only teams consisting of two people can participate in this competition. As an organi...
instruction
0
23,065
17
46,130
Yes
output
1
23,065
17
46,131
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n people who want to participate in a boat competition. The weight of the i-th participant is w_i. Only teams consisting of two people can participate in this competition. As an organi...
instruction
0
23,066
17
46,132
Yes
output
1
23,066
17
46,133
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n people who want to participate in a boat competition. The weight of the i-th participant is w_i. Only teams consisting of two people can participate in this competition. As an organi...
instruction
0
23,067
17
46,134
Yes
output
1
23,067
17
46,135
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n people who want to participate in a boat competition. The weight of the i-th participant is w_i. Only teams consisting of two people can participate in this competition. As an organi...
instruction
0
23,068
17
46,136
Yes
output
1
23,068
17
46,137
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n people who want to participate in a boat competition. The weight of the i-th participant is w_i. Only teams consisting of two people can participate in this competition. As an organi...
instruction
0
23,069
17
46,138
No
output
1
23,069
17
46,139
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n people who want to participate in a boat competition. The weight of the i-th participant is w_i. Only teams consisting of two people can participate in this competition. As an organi...
instruction
0
23,070
17
46,140
No
output
1
23,070
17
46,141
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n people who want to participate in a boat competition. The weight of the i-th participant is w_i. Only teams consisting of two people can participate in this competition. As an organi...
instruction
0
23,071
17
46,142
No
output
1
23,071
17
46,143
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n people who want to participate in a boat competition. The weight of the i-th participant is w_i. Only teams consisting of two people can participate in this competition. As an organi...
instruction
0
23,072
17
46,144
No
output
1
23,072
17
46,145
Provide tags and a correct Python 3 solution for this coding contest problem. The organizers of a programming contest have decided to present t-shirts to participants. There are six different t-shirts sizes in this problem: S, M, L, XL, XXL, XXXL (sizes are listed in increasing order). The t-shirts are already prepare...
instruction
0
25,236
17
50,472
Tags: constructive algorithms, flows, greedy Correct Solution: ``` #!/usr/bin/python3 szs = ['S', 'M', 'L', 'XL', 'XXL', 'XXXL'] d = {'S':0, 'M':1, 'L':2, 'XL':3, 'XXL':4, 'XXXL':5} neigh = [[] for i in range(5)] of = list(map(int, input().split())) n = int(input()) ans = ['' for i in range(n)] for i in range(n): ...
output
1
25,236
17
50,473
Provide tags and a correct Python 3 solution for this coding contest problem. The organizers of a programming contest have decided to present t-shirts to participants. There are six different t-shirts sizes in this problem: S, M, L, XL, XXL, XXXL (sizes are listed in increasing order). The t-shirts are already prepare...
instruction
0
25,237
17
50,474
Tags: constructive algorithms, flows, greedy Correct Solution: ``` import sys from random import randint class Graph: verticies = {} nodesCount = 0 class Vertex: def __init__(self, label, endPoint=None): self.label = label self.edges = [] self.visitedToken = 0 ...
output
1
25,237
17
50,475
Provide tags and a correct Python 3 solution for this coding contest problem. The organizers of a programming contest have decided to present t-shirts to participants. There are six different t-shirts sizes in this problem: S, M, L, XL, XXL, XXXL (sizes are listed in increasing order). The t-shirts are already prepare...
instruction
0
25,238
17
50,476
Tags: constructive algorithms, flows, greedy Correct Solution: ``` counts = [int(x) for x in input().split()] n = int(input()) sizes = ['S', 'M', 'L', 'XL', 'XXL', 'XXXL'] size_to_i = {size:i for i, size in enumerate(sizes)} two_sizes = {(x,y): [] for x, y in zip(range(6), range(1, 7))} decision = [''] * n for i in r...
output
1
25,238
17
50,477
Provide tags and a correct Python 3 solution for this coding contest problem. The organizers of a programming contest have decided to present t-shirts to participants. There are six different t-shirts sizes in this problem: S, M, L, XL, XXL, XXXL (sizes are listed in increasing order). The t-shirts are already prepare...
instruction
0
25,239
17
50,478
Tags: constructive algorithms, flows, greedy Correct Solution: ``` d = {"S": 0, "M": 1, "L":2,"XL":3,"XXL":4,"XXXL":5} cnt = [int(t) for t in input().split()] n = int(input()) ind = [i for i in range(n)] p = [] for i in range(n): p.append(input().split(',')) ind.sort(key=lambda x:[d[p[x][0]], len(p[x])]) ans = {} ...
output
1
25,239
17
50,479
Provide tags and a correct Python 3 solution for this coding contest problem. The organizers of a programming contest have decided to present t-shirts to participants. There are six different t-shirts sizes in this problem: S, M, L, XL, XXL, XXXL (sizes are listed in increasing order). The t-shirts are already prepare...
instruction
0
25,240
17
50,480
Tags: constructive algorithms, flows, greedy Correct Solution: ``` def solve(a, n): M={'S':0, 'M':1, 'L':2, 'XL':3, 'XXL':4, 'XXXL':5} m={0:'S', 1:'M', 2:'L', 3:'XL', 4:'XXL', 5:'XXXL'} p=[ [] for _ in range(5) ] ans=['']*n for i in range(n): s=input() if ',' in s: p[ M[ ...
output
1
25,240
17
50,481
Provide tags and a correct Python 3 solution for this coding contest problem. The organizers of a programming contest have decided to present t-shirts to participants. There are six different t-shirts sizes in this problem: S, M, L, XL, XXL, XXXL (sizes are listed in increasing order). The t-shirts are already prepare...
instruction
0
25,241
17
50,482
Tags: constructive algorithms, flows, greedy Correct Solution: ``` d={"S":0,"M":1,"L":2,"XL":3,"XXL":4,"XXXL":5} cnt=[int(t) for t in input().split()] n=int(input()) ind=[i for i in range(n)] p=[] for i in range(n):p.append(input().split(',')) ind.sort(key=lambda x:[d[p[x][0]], len(p[x])]) ans={} for i in ind: cur=p[i...
output
1
25,241
17
50,483
Provide tags and a correct Python 3 solution for this coding contest problem. The organizers of a programming contest have decided to present t-shirts to participants. There are six different t-shirts sizes in this problem: S, M, L, XL, XXL, XXXL (sizes are listed in increasing order). The t-shirts are already prepare...
instruction
0
25,242
17
50,484
Tags: constructive algorithms, flows, greedy Correct Solution: ``` SIZES = { "S": 0, "M": 1, "L": 2, "XL": 3, "XXL": 4, "XXXL": 5, } INV_SIZES = {v: k for k, v in SIZES.items()} shirt_count = [int(x) for x in input().split(' ')] n = int(input()) result = [] sizes = { "S": 0, "M": 0, ...
output
1
25,242
17
50,485
Provide tags and a correct Python 3 solution for this coding contest problem. The organizers of a programming contest have decided to present t-shirts to participants. There are six different t-shirts sizes in this problem: S, M, L, XL, XXL, XXXL (sizes are listed in increasing order). The t-shirts are already prepare...
instruction
0
25,243
17
50,486
Tags: constructive algorithms, flows, greedy Correct Solution: ``` shorts = [int(t) for t in input().split()] n = int(input()) d = dict() d["S"] = 0 d["M"] = 1 d["L"] = 2 d["XL"] = 3 d["XXL"] = 4 d["XXXL"] = 5 people = [] order = [t for t in range(n)] for _ in range(n): people.append(input().split(",")) order.sor...
output
1
25,243
17
50,487