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
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Once Vasya needed to transport m goats and m wolves from riverbank to the other as quickly as possible. The boat can hold n animals and Vasya, in addition, he is permitted to put less than n ani...
instruction
0
3,740
14
7,480
No
output
1
3,740
14
7,481
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Once Vasya needed to transport m goats and m wolves from riverbank to the other as quickly as possible. The boat can hold n animals and Vasya, in addition, he is permitted to put less than n ani...
instruction
0
3,741
14
7,482
No
output
1
3,741
14
7,483
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Once Vasya needed to transport m goats and m wolves from riverbank to the other as quickly as possible. The boat can hold n animals and Vasya, in addition, he is permitted to put less than n ani...
instruction
0
3,742
14
7,484
No
output
1
3,742
14
7,485
Provide tags and a correct Python 3 solution for this coding contest problem. Note that girls in Arpa’s land are really attractive. Arpa loves overnight parties. In the middle of one of these parties Mehrdad suddenly appeared. He saw n pairs of friends sitting around a table. i-th pair consisted of a boy, sitting on ...
instruction
0
3,829
14
7,658
Tags: constructive algorithms, dfs and similar, graphs Correct Solution: ``` import sys n = int(input()) A = [0]*(2*n) B = [] for line in sys.stdin: x, y = [int(x)-1 for x in line.split()] A[x] = y A[y] = x B.append(x) C = [0]*(2*n) for i in range(2*n): while not C[i]: C[i] = 1 C[i...
output
1
3,829
14
7,659
Provide tags and a correct Python 3 solution for this coding contest problem. Note that girls in Arpa’s land are really attractive. Arpa loves overnight parties. In the middle of one of these parties Mehrdad suddenly appeared. He saw n pairs of friends sitting around a table. i-th pair consisted of a boy, sitting on ...
instruction
0
3,830
14
7,660
Tags: constructive algorithms, dfs and similar, graphs Correct Solution: ``` import sys def solve(): n = int(input()) partner = [0]*(2*n) pacani = [] for line in sys.stdin: pacan, telka = [int(x) - 1 for x in line.split()] partner[pacan] = telka partner[telka] = pacan pa...
output
1
3,830
14
7,661
Provide a correct Python 3 solution for this coding contest problem. Peter is a senior manager of Agile Change Management (ACM) Inc., where each employee is a member of one or more task groups. Since ACM is agile, task groups are often reorganized and their members frequently change, so membership management is his co...
instruction
0
4,111
14
8,222
"Correct Solution: ``` #!/usr/bin/env python3 from queue import Queue def input_split(line): group, members = line.rstrip('.').split(':') members = members.split(',') return group, members while True: n = int(input()) if n == 0: exit() data = [input() for _ in range(n)] to = {} ...
output
1
4,111
14
8,223
Provide a correct Python 3 solution for this coding contest problem. Peter is a senior manager of Agile Change Management (ACM) Inc., where each employee is a member of one or more task groups. Since ACM is agile, task groups are often reorganized and their members frequently change, so membership management is his co...
instruction
0
4,112
14
8,224
"Correct Solution: ``` # coding: utf-8 def addset(args): global a for m in args: if dic[m]==1: a.add(m) else: if m not in used: used.add(m) addset(dc[m]) while True: n=int(input()) if n==0: break dic={} first=[] ...
output
1
4,112
14
8,225
Provide a correct Python 3 solution for this coding contest problem. Peter is a senior manager of Agile Change Management (ACM) Inc., where each employee is a member of one or more task groups. Since ACM is agile, task groups are often reorganized and their members frequently change, so membership management is his co...
instruction
0
4,113
14
8,226
"Correct Solution: ``` while True: N = int(input()) if N == 0: break first_group_menbers = set(input()[:-1].split(":")[1].split(",")) d = {} for i in range(N-1): group, members = input()[:-1].split(":") d[group] = set(members.split(",")) for i in range(N-1):...
output
1
4,113
14
8,227
Provide a correct Python 3 solution for this coding contest problem. Peter is a senior manager of Agile Change Management (ACM) Inc., where each employee is a member of one or more task groups. Since ACM is agile, task groups are often reorganized and their members frequently change, so membership management is his co...
instruction
0
4,114
14
8,228
"Correct Solution: ``` while True: N = int(input()) if N == 0: break first_group_menbers = set(input()[:-1].split(":")[1].split(",")) d = {} for i in range(N-1): group, members = input()[:-1].split(":") d[group] = set(members.split(",")) for i in range(...
output
1
4,114
14
8,229
Provide a correct Python 3 solution for this coding contest problem. Peter is a senior manager of Agile Change Management (ACM) Inc., where each employee is a member of one or more task groups. Since ACM is agile, task groups are often reorganized and their members frequently change, so membership management is his co...
instruction
0
4,115
14
8,230
"Correct Solution: ``` while True: N = int(input()) if N == 0: break first_group_menbers = set(input()[:-1].split(":")[1].split(",")) d = {} for i in range(N-1): group, members = input()[:-1].split(":") d[group] = set(members.split(",")) for i in range(N-2):...
output
1
4,115
14
8,231
Provide a correct Python 3 solution for this coding contest problem. Peter is a senior manager of Agile Change Management (ACM) Inc., where each employee is a member of one or more task groups. Since ACM is agile, task groups are often reorganized and their members frequently change, so membership management is his co...
instruction
0
4,116
14
8,232
"Correct Solution: ``` import re N = 1 while True: N = int(input()) if not N: break tmp, groups, firstgroup = [], {}, [] for i in range(N): tmp = re.split(r"[\,\.\:]", input()) if not i: firstgroup = tmp[1:] else: groups[tmp[0]] = tmp[1:] wh...
output
1
4,116
14
8,233
Provide a correct Python 3 solution for this coding contest problem. Peter is a senior manager of Agile Change Management (ACM) Inc., where each employee is a member of one or more task groups. Since ACM is agile, task groups are often reorganized and their members frequently change, so membership management is his co...
instruction
0
4,117
14
8,234
"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 = 998244353 dd = [(0,-1),(1,0),(0,1),(-1,0)] ddn = [(0,-1),(1,-1),(1,0),(1,1),(0,1),(-1,-1),(-1,0),(-1,1)] def LI(): return [i...
output
1
4,117
14
8,235
Provide a correct Python 3 solution for this coding contest problem. Peter is a senior manager of Agile Change Management (ACM) Inc., where each employee is a member of one or more task groups. Since ACM is agile, task groups are often reorganized and their members frequently change, so membership management is his co...
instruction
0
4,118
14
8,236
"Correct Solution: ``` #!/usr/bin/env python3 import sys import math import re from bisect import bisect_right as br from bisect import bisect_left as bl sys.setrecursionlimit(1000000) from heapq import heappush, heappop,heappushpop from collections import defaultdict from itertools import accumulate from collections ...
output
1
4,118
14
8,237
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Peter is a senior manager of Agile Change Management (ACM) Inc., where each employee is a member of one or more task groups. Since ACM is agile, task groups are often reorganized and their membe...
instruction
0
4,119
14
8,238
Yes
output
1
4,119
14
8,239
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Peter is a senior manager of Agile Change Management (ACM) Inc., where each employee is a member of one or more task groups. Since ACM is agile, task groups are often reorganized and their membe...
instruction
0
4,120
14
8,240
Yes
output
1
4,120
14
8,241
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Peter is a senior manager of Agile Change Management (ACM) Inc., where each employee is a member of one or more task groups. Since ACM is agile, task groups are often reorganized and their membe...
instruction
0
4,121
14
8,242
Yes
output
1
4,121
14
8,243
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Peter is a senior manager of Agile Change Management (ACM) Inc., where each employee is a member of one or more task groups. Since ACM is agile, task groups are often reorganized and their membe...
instruction
0
4,122
14
8,244
Yes
output
1
4,122
14
8,245
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Peter is a senior manager of Agile Change Management (ACM) Inc., where each employee is a member of one or more task groups. Since ACM is agile, task groups are often reorganized and their membe...
instruction
0
4,123
14
8,246
No
output
1
4,123
14
8,247
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Peter is a senior manager of Agile Change Management (ACM) Inc., where each employee is a member of one or more task groups. Since ACM is agile, task groups are often reorganized and their membe...
instruction
0
4,124
14
8,248
No
output
1
4,124
14
8,249
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Peter is a senior manager of Agile Change Management (ACM) Inc., where each employee is a member of one or more task groups. Since ACM is agile, task groups are often reorganized and their membe...
instruction
0
4,125
14
8,250
No
output
1
4,125
14
8,251
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Peter is a senior manager of Agile Change Management (ACM) Inc., where each employee is a member of one or more task groups. Since ACM is agile, task groups are often reorganized and their membe...
instruction
0
4,126
14
8,252
No
output
1
4,126
14
8,253
Provide tags and a correct Python 3 solution for this coding contest problem. Vova has taken his summer practice this year and now he should write a report on how it went. Vova has already drawn all the tables and wrote down all the formulas. Moreover, he has already decided that the report will consist of exactly n ...
instruction
0
4,179
14
8,358
Tags: dp, greedy Correct Solution: ``` def get(px, py, x, y): ans = 10**18 global k if px <= k: cnt = (px + x + k - 1) // k - 1 if y == cnt: ans = min(ans, px + x - cnt * k) elif y > cnt and y <= x * k: ans = min(ans, 1) if py <= k: cnt = (x + k - 1) // k - 1 if y == cnt: ans = min(ans, x - cnt *...
output
1
4,179
14
8,359
Provide tags and a correct Python 3 solution for this coding contest problem. Vova has taken his summer practice this year and now he should write a report on how it went. Vova has already drawn all the tables and wrote down all the formulas. Moreover, he has already decided that the report will consist of exactly n ...
instruction
0
4,180
14
8,360
Tags: dp, greedy Correct Solution: ``` def max(a, b): if a > b: return a return b n, k = map(int, input().split()) o = [int(t) for t in (input()+' '+input()).split()] f, s = 0, 0 for i in range(n): f = max(0, o[i] + f - k * o[i+n]) s = max(0, o[i+n] + s - k * o[i]) if f > k or s > k: print('NO')...
output
1
4,180
14
8,361
Provide tags and a correct Python 3 solution for this coding contest problem. Vova has taken his summer practice this year and now he should write a report on how it went. Vova has already drawn all the tables and wrote down all the formulas. Moreover, he has already decided that the report will consist of exactly n ...
instruction
0
4,181
14
8,362
Tags: dp, greedy Correct Solution: ``` n, k = map(int, input().split()) o = [int(t) for t in (input()+' '+input()).split()] f, s = 0, 0 for i in range(n): f = max(0, o[i] + f - k * o[i+n]) s = max(0, o[i+n] + s - k * o[i]) if f > k or s > k: print('NO') exit(0) print('YES') ```
output
1
4,181
14
8,363
Provide tags and a correct Python 3 solution for this coding contest problem. Vova has taken his summer practice this year and now he should write a report on how it went. Vova has already drawn all the tables and wrote down all the formulas. Moreover, he has already decided that the report will consist of exactly n ...
instruction
0
4,182
14
8,364
Tags: dp, greedy Correct Solution: ``` def max(a, b): if a > b: return a else: return b n, k = map(int, input().split()) x = [int(t) for t in input().split()] y = [int(t) for t in input().split()] f, s = 0, 0 for i in range(n): f = max(0, x[i] + f - k * y[i]) s = max(0, y[i] + s - k * x[i]) if f > k o...
output
1
4,182
14
8,365
Provide tags and a correct Python 3 solution for this coding contest problem. Sayaka Saeki is a member of the student council, which has n other members (excluding Sayaka). The i-th member has a height of a_i millimeters. It's the end of the school year and Sayaka wants to take a picture of all other members of the s...
instruction
0
4,420
14
8,840
Tags: constructive algorithms Correct Solution: ``` for _ in range(int(input())): n=int(input()) l=list(map(int,input().split())) a=[] for i in range(n): if(l[i]%2!=0): a.append(l[i]) for i in range(n): if (l[i] % 2 == 0): a.append(l[i]) print(*a ,end=" ")...
output
1
4,420
14
8,841
Provide tags and a correct Python 3 solution for this coding contest problem. Sayaka Saeki is a member of the student council, which has n other members (excluding Sayaka). The i-th member has a height of a_i millimeters. It's the end of the school year and Sayaka wants to take a picture of all other members of the s...
instruction
0
4,421
14
8,842
Tags: constructive algorithms Correct Solution: ``` import sys input = sys.stdin.buffer.readline t = int(input()) for _ in range(t): n = input() O = [] E = [] A = map(int, input().split()) for a in A: if a % 2 == 0: E.append(a) else: O.append(a) ans = ...
output
1
4,421
14
8,843
Provide tags and a correct Python 3 solution for this coding contest problem. Sayaka Saeki is a member of the student council, which has n other members (excluding Sayaka). The i-th member has a height of a_i millimeters. It's the end of the school year and Sayaka wants to take a picture of all other members of the s...
instruction
0
4,422
14
8,844
Tags: constructive algorithms Correct Solution: ``` for i in range(int(input())): n=int(input()) l=list(map(int,input().split())) odd=[str(i) for i in l if i%2!=0] even =[str(i) for i in l if i%2==0] x=odd+even print(" ".join(x)) ```
output
1
4,422
14
8,845
Provide tags and a correct Python 3 solution for this coding contest problem. Sayaka Saeki is a member of the student council, which has n other members (excluding Sayaka). The i-th member has a height of a_i millimeters. It's the end of the school year and Sayaka wants to take a picture of all other members of the s...
instruction
0
4,423
14
8,846
Tags: constructive algorithms Correct Solution: ``` T = int(input()) for t in range(T): N = int(input()) arr = list(map(int, input().split())) ans = [] for i in arr: if i%2: ans.append(i) for i in arr: if i%2 == 0: ans.append(i) print(" ".join(list(map(str...
output
1
4,423
14
8,847
Provide tags and a correct Python 3 solution for this coding contest problem. Sayaka Saeki is a member of the student council, which has n other members (excluding Sayaka). The i-th member has a height of a_i millimeters. It's the end of the school year and Sayaka wants to take a picture of all other members of the s...
instruction
0
4,424
14
8,848
Tags: constructive algorithms Correct Solution: ``` n=int(input()) for i in range(n): a=int(input()) l=list(map(int,input().split())) e=[] o=[] for i in range(len(l)): if(l[i]%2==0): e.append(l[i]) else: o.append(l[i]) print(*(o+e)) ```
output
1
4,424
14
8,849
Provide tags and a correct Python 3 solution for this coding contest problem. Sayaka Saeki is a member of the student council, which has n other members (excluding Sayaka). The i-th member has a height of a_i millimeters. It's the end of the school year and Sayaka wants to take a picture of all other members of the s...
instruction
0
4,425
14
8,850
Tags: constructive algorithms Correct Solution: ``` n = int(input()) while n: input() nums = [] for i in map(int, input().split(' ')): if i % 2: nums += [i] else: nums = [i] + nums print(' '.join(map(str, nums))) n -= 1 ```
output
1
4,425
14
8,851
Provide tags and a correct Python 3 solution for this coding contest problem. Sayaka Saeki is a member of the student council, which has n other members (excluding Sayaka). The i-th member has a height of a_i millimeters. It's the end of the school year and Sayaka wants to take a picture of all other members of the s...
instruction
0
4,426
14
8,852
Tags: constructive algorithms Correct Solution: ``` # Programmers_Hive import os import sys from io import BytesIO, IOBase def main(): # main code t=int(input()) for x in range(t): n=int(input()) l=list(map(int,input().split())) even=[] odd=[] for i in l: ...
output
1
4,426
14
8,853
Provide tags and a correct Python 3 solution for this coding contest problem. Sayaka Saeki is a member of the student council, which has n other members (excluding Sayaka). The i-th member has a height of a_i millimeters. It's the end of the school year and Sayaka wants to take a picture of all other members of the s...
instruction
0
4,427
14
8,854
Tags: constructive algorithms Correct Solution: ``` t = int(input()) while t: n = int(input()) s = input().strip().split() s = [int(s[i]) for i in range(len(s))] odd = [s[i] for i in range(len(s)) if s[i] & 1 == 1 ] even = [s[i] for i in range(len(s)) if s[i] & 1 == 0] odd.sort(reverse = True) ...
output
1
4,427
14
8,855
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Sayaka Saeki is a member of the student council, which has n other members (excluding Sayaka). The i-th member has a height of a_i millimeters. It's the end of the school year and Sayaka wants ...
instruction
0
4,428
14
8,856
Yes
output
1
4,428
14
8,857
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Sayaka Saeki is a member of the student council, which has n other members (excluding Sayaka). The i-th member has a height of a_i millimeters. It's the end of the school year and Sayaka wants ...
instruction
0
4,429
14
8,858
Yes
output
1
4,429
14
8,859
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Sayaka Saeki is a member of the student council, which has n other members (excluding Sayaka). The i-th member has a height of a_i millimeters. It's the end of the school year and Sayaka wants ...
instruction
0
4,430
14
8,860
Yes
output
1
4,430
14
8,861
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Sayaka Saeki is a member of the student council, which has n other members (excluding Sayaka). The i-th member has a height of a_i millimeters. It's the end of the school year and Sayaka wants ...
instruction
0
4,431
14
8,862
Yes
output
1
4,431
14
8,863
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Sayaka Saeki is a member of the student council, which has n other members (excluding Sayaka). The i-th member has a height of a_i millimeters. It's the end of the school year and Sayaka wants ...
instruction
0
4,432
14
8,864
No
output
1
4,432
14
8,865
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Sayaka Saeki is a member of the student council, which has n other members (excluding Sayaka). The i-th member has a height of a_i millimeters. It's the end of the school year and Sayaka wants ...
instruction
0
4,433
14
8,866
No
output
1
4,433
14
8,867
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Sayaka Saeki is a member of the student council, which has n other members (excluding Sayaka). The i-th member has a height of a_i millimeters. It's the end of the school year and Sayaka wants ...
instruction
0
4,434
14
8,868
No
output
1
4,434
14
8,869
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Sayaka Saeki is a member of the student council, which has n other members (excluding Sayaka). The i-th member has a height of a_i millimeters. It's the end of the school year and Sayaka wants ...
instruction
0
4,435
14
8,870
No
output
1
4,435
14
8,871
Provide tags and a correct Python 3 solution for this coding contest problem. Greg is a beginner bodybuilder. Today the gym coach gave him the training plan. All it had was n integers a1, a2, ..., an. These numbers mean that Greg needs to do exactly n exercises today. Besides, Greg should repeat the i-th in order exer...
instruction
0
4,484
14
8,968
Tags: implementation Correct Solution: ``` input() ar = list(map(int, input().split())) cur = 0 ch, bi, ba = 0, 0, 0 for a in ar: if cur % 3 == 0: ch += a elif cur % 3 == 1: bi += a else: ba += a cur += 1 if ch == max([ch, bi, ba]): print("chest") elif bi == max(...
output
1
4,484
14
8,969
Provide tags and a correct Python 3 solution for this coding contest problem. Greg is a beginner bodybuilder. Today the gym coach gave him the training plan. All it had was n integers a1, a2, ..., an. These numbers mean that Greg needs to do exactly n exercises today. Besides, Greg should repeat the i-th in order exer...
instruction
0
4,485
14
8,970
Tags: implementation Correct Solution: ``` #n, k = map(int, input().split(" ")) #LA = [int(x) for x in input().split()] n = int(input()) L = [int(x) for x in input().split()] c = [0,0,0] for i in range(n) : c[i % 3] += L[i] if (c[0] == max(c)) : print("chest") if (c[1] == max(c)) : print("biceps") if (c[2] == m...
output
1
4,485
14
8,971
Provide tags and a correct Python 3 solution for this coding contest problem. Greg is a beginner bodybuilder. Today the gym coach gave him the training plan. All it had was n integers a1, a2, ..., an. These numbers mean that Greg needs to do exactly n exercises today. Besides, Greg should repeat the i-th in order exer...
instruction
0
4,486
14
8,972
Tags: implementation Correct Solution: ``` n = int(input()) a = list(map(int, input().split())) answer = {0: 'chest', 1:'biceps', 2:'back'} repitation = [0, 0, 0] for i in range(n): if (i+1) % 3 == 0: repitation[2] += a[i] elif (i+1) % 3 == 2: repitation[1] += a[i] else: repitation...
output
1
4,486
14
8,973
Provide tags and a correct Python 3 solution for this coding contest problem. Greg is a beginner bodybuilder. Today the gym coach gave him the training plan. All it had was n integers a1, a2, ..., an. These numbers mean that Greg needs to do exactly n exercises today. Besides, Greg should repeat the i-th in order exer...
instruction
0
4,487
14
8,974
Tags: implementation Correct Solution: ``` # -*- coding: utf-8 -*- import math import collections import bisect import heapq import time import random import itertools import sys """ created by shhuan at 2017/11/24 23:13 """ N = int(input()) A = [int(x) for x in input().split()] c = sum(A[::3] or [0]) b = sum(A[1:...
output
1
4,487
14
8,975
Provide tags and a correct Python 3 solution for this coding contest problem. Greg is a beginner bodybuilder. Today the gym coach gave him the training plan. All it had was n integers a1, a2, ..., an. These numbers mean that Greg needs to do exactly n exercises today. Besides, Greg should repeat the i-th in order exer...
instruction
0
4,488
14
8,976
Tags: implementation Correct Solution: ``` def check(l): chest = 0 biceps = 0 back = 0 for i in range(0,2): if len(l) % 3 == 0: break l.append(0) for i in range(0,len(l),3): chest += l[i] biceps += l[i+1] back +=l[i+2] if chest > biceps and...
output
1
4,488
14
8,977
Provide tags and a correct Python 3 solution for this coding contest problem. Greg is a beginner bodybuilder. Today the gym coach gave him the training plan. All it had was n integers a1, a2, ..., an. These numbers mean that Greg needs to do exactly n exercises today. Besides, Greg should repeat the i-th in order exer...
instruction
0
4,489
14
8,978
Tags: implementation Correct Solution: ``` n=int(input()) arr=list(map(int,input().split(' '))) ex=[0]*3 for i in range(0,len(arr)): ex[i%3]+=arr[i] exc=(ex.index(max(ex))) if(exc==0): print('chest') elif(exc==1): print('biceps') elif(exc==2): print('back') ```
output
1
4,489
14
8,979
Provide tags and a correct Python 3 solution for this coding contest problem. Greg is a beginner bodybuilder. Today the gym coach gave him the training plan. All it had was n integers a1, a2, ..., an. These numbers mean that Greg needs to do exactly n exercises today. Besides, Greg should repeat the i-th in order exer...
instruction
0
4,490
14
8,980
Tags: implementation Correct Solution: ``` t=int(input()) a=list(map(int,input().split())) x=y=z=0 for i in range(t): if(i%3==0): x+=a[i] elif(i%3==1): y+=a[i] else: z+=a[i] d=max(x,y,z) if(d==x): print("chest") elif(d==y): print("biceps") else: print("back") ```
output
1
4,490
14
8,981
Provide tags and a correct Python 3 solution for this coding contest problem. Greg is a beginner bodybuilder. Today the gym coach gave him the training plan. All it had was n integers a1, a2, ..., an. These numbers mean that Greg needs to do exactly n exercises today. Besides, Greg should repeat the i-th in order exer...
instruction
0
4,491
14
8,982
Tags: implementation Correct Solution: ``` n=input() mas=list(map(int,input().split())) sm=[sum(mas[::3]),sum(mas[1::3]),sum(mas[2::3])] ans=["chest","biceps","back"] print(ans[sm.index(max(sm))]) ```
output
1
4,491
14
8,983
Provide tags and a correct Python 3 solution for this coding contest problem. To quickly hire highly skilled specialists one of the new IT City companies made an unprecedented move. Every employee was granted a car, and an employee can choose one of four different car makes. The parking lot before the office consists...
instruction
0
4,619
14
9,238
Tags: combinatorics, math Correct Solution: ``` n=int(input()) print(6*(4**(n-3) * 4) + (n-3)*9*4**(n-3)) ```
output
1
4,619
14
9,239