message
stringlengths
2
30.5k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
237
109k
cluster
float64
10
10
__index_level_0__
int64
474
217k
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan). In how many ways can we select some of these coins so that they are X yen in total? Coins of the sam...
instruction
0
42,748
10
85,496
No
output
1
42,748
10
85,497
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan). In how many ways can we select some of these coins so that they are X yen in total? Coins of the sam...
instruction
0
42,749
10
85,498
No
output
1
42,749
10
85,499
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan). In how many ways can we select some of these coins so that they are X yen in total? Coins of the sam...
instruction
0
42,750
10
85,500
No
output
1
42,750
10
85,501
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan). In how many ways can we select some of these coins so that they are X yen in total? Coins of the sam...
instruction
0
42,751
10
85,502
No
output
1
42,751
10
85,503
Provide a correct Python 3 solution for this coding contest problem. problem At the JOI pasta shop, the recommended pasta for lunch and the set menu of freshly squeezed juice are popular. When ordering this set menu, choose one from each of the three pasta and two juices of the day. The price is the total price of pa...
instruction
0
42,831
10
85,662
"Correct Solution: ``` L = [int(input()) for i in range(5)] print( min(L[0],L[1],L[2])+ min(L[3],L[4])-50) ```
output
1
42,831
10
85,663
Provide a correct Python 3 solution for this coding contest problem. problem At the JOI pasta shop, the recommended pasta for lunch and the set menu of freshly squeezed juice are popular. When ordering this set menu, choose one from each of the three pasta and two juices of the day. The price is the total price of pa...
instruction
0
42,832
10
85,664
"Correct Solution: ``` # -*- coding: utf-8 -*- """ http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0565 """ import sys from sys import stdin input = stdin.readline def main(args): pastas = [int(input()) for _ in range(3)] drinks = [int(input()) for _ in range(2)] total = min(pastas) + min(drinks...
output
1
42,832
10
85,665
Provide a correct Python 3 solution for this coding contest problem. problem At the JOI pasta shop, the recommended pasta for lunch and the set menu of freshly squeezed juice are popular. When ordering this set menu, choose one from each of the three pasta and two juices of the day. The price is the total price of pa...
instruction
0
42,833
10
85,666
"Correct Solution: ``` a=[int(input())for _ in[0]*5] print(min(a[:3])+min(a[3:])-50) ```
output
1
42,833
10
85,667
Provide a correct Python 3 solution for this coding contest problem. problem At the JOI pasta shop, the recommended pasta for lunch and the set menu of freshly squeezed juice are popular. When ordering this set menu, choose one from each of the three pasta and two juices of the day. The price is the total price of pa...
instruction
0
42,834
10
85,668
"Correct Solution: ``` import sys import math p1=int(input()) p2=int(input()) p3=int(input()) j1=int(input()) j2=int(input()) p_min=min(p1,p2,p3) J_min=min(j1,j2) min_sum=p_min+J_min-50 print(min_sum) ```
output
1
42,834
10
85,669
Provide a correct Python 3 solution for this coding contest problem. problem At the JOI pasta shop, the recommended pasta for lunch and the set menu of freshly squeezed juice are popular. When ordering this set menu, choose one from each of the three pasta and two juices of the day. The price is the total price of pa...
instruction
0
42,835
10
85,670
"Correct Solution: ``` def main(): a = int(input()) b = int(input()) c = int(input()) d = int(input()) e = int(input()) ans = -50 if a <= b: if a <= c: ans += a else: ans += c else: if b <= c: ans += b else: ans += c if d <= e: ans += d else: ans...
output
1
42,835
10
85,671
Provide a correct Python 3 solution for this coding contest problem. problem At the JOI pasta shop, the recommended pasta for lunch and the set menu of freshly squeezed juice are popular. When ordering this set menu, choose one from each of the three pasta and two juices of the day. The price is the total price of pa...
instruction
0
42,836
10
85,672
"Correct Solution: ``` num_list = [] daikin = 0 for num in range(3): i = int(input()) num_list.append(i) num_list.sort() daikin += num_list[0] num_list = [] for num1 in range(2): i = int(input()) num_list.append(i) num_list.sort() daikin += num_list[0] daikin -= 50 print(daikin) ```
output
1
42,836
10
85,673
Provide a correct Python 3 solution for this coding contest problem. problem At the JOI pasta shop, the recommended pasta for lunch and the set menu of freshly squeezed juice are popular. When ordering this set menu, choose one from each of the three pasta and two juices of the day. The price is the total price of pa...
instruction
0
42,837
10
85,674
"Correct Solution: ``` menu = [] for _ in range(5): price = int(input()) menu.append(price) pasta = menu[:3] drink = menu[3:] print(min(pasta) + min(drink) - 50) ```
output
1
42,837
10
85,675
Provide a correct Python 3 solution for this coding contest problem. problem At the JOI pasta shop, the recommended pasta for lunch and the set menu of freshly squeezed juice are popular. When ordering this set menu, choose one from each of the three pasta and two juices of the day. The price is the total price of pa...
instruction
0
42,838
10
85,676
"Correct Solution: ``` # AOJ 0565: Lunch # Python3 2018.6.30 bal4u p = [int(input()) for i in range(5)] print(min(p[:3])+min(p[3:])-50) ```
output
1
42,838
10
85,677
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. problem At the JOI pasta shop, the recommended pasta for lunch and the set menu of freshly squeezed juice are popular. When ordering this set menu, choose one from each of the three pasta and t...
instruction
0
42,840
10
85,680
Yes
output
1
42,840
10
85,681
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. problem At the JOI pasta shop, the recommended pasta for lunch and the set menu of freshly squeezed juice are popular. When ordering this set menu, choose one from each of the three pasta and t...
instruction
0
42,841
10
85,682
Yes
output
1
42,841
10
85,683
Provide tags and a correct Python 3 solution for this coding contest problem. There is a country with n citizens. The i-th of them initially has a_{i} money. The government strictly controls the wealth of its citizens. Whenever a citizen makes a purchase or earns some money, they must send a receipt to the social serv...
instruction
0
43,005
10
86,010
Tags: binary search, brute force, data structures, sortings Correct Solution: ``` R=lambda:map(int,input().split()) n = int(input ()) a=list(R()) q =int(input()) p=[] ax= [-1]*n for _ in range (q):p.append(list (R())) temp=0 for i in range(q-1,-1,-1): if p[i][0]==2:temp = max(temp,p[i][1]) elif ax[p[i][1]-1]==...
output
1
43,005
10
86,011
Provide tags and a correct Python 3 solution for this coding contest problem. There is a country with n citizens. The i-th of them initially has a_{i} money. The government strictly controls the wealth of its citizens. Whenever a citizen makes a purchase or earns some money, they must send a receipt to the social serv...
instruction
0
43,006
10
86,012
Tags: binary search, brute force, data structures, sortings Correct Solution: ``` import sys import bisect input = sys.stdin.readline n = int(input()) a = list(map(int, input().split())) b = [0] * n q = int(input()) x = [] t = [] for i in range(q): inp = list(map(int, input().split())) if len(inp) == 2: ...
output
1
43,006
10
86,013
Provide tags and a correct Python 3 solution for this coding contest problem. There is a country with n citizens. The i-th of them initially has a_{i} money. The government strictly controls the wealth of its citizens. Whenever a citizen makes a purchase or earns some money, they must send a receipt to the social serv...
instruction
0
43,007
10
86,014
Tags: binary search, brute force, data structures, sortings Correct Solution: ``` n = int(input()) a = [int(item) for item in input().split()] q = int(input()) qu = list() an = [-1]*n m = 0 for i in range(q): qu.append(tuple(map(int, input().split()))) for i in range(q): if qu[q-i-1][0] == 2: m = max(m,...
output
1
43,007
10
86,015
Provide tags and a correct Python 3 solution for this coding contest problem. There is a country with n citizens. The i-th of them initially has a_{i} money. The government strictly controls the wealth of its citizens. Whenever a citizen makes a purchase or earns some money, they must send a receipt to the social serv...
instruction
0
43,008
10
86,016
Tags: binary search, brute force, data structures, sortings Correct Solution: ``` n = int(input()) lis=list(map(int,input().split())) lis=[[0,i] for i in lis] k = int(input()) li=[] m=0 for i in range(k): li.append(list(map(int,input().split()))) for i in range(k): if len(li[k-i-1])==2: m=max(li[k-i...
output
1
43,008
10
86,017
Provide tags and a correct Python 3 solution for this coding contest problem. There is a country with n citizens. The i-th of them initially has a_{i} money. The government strictly controls the wealth of its citizens. Whenever a citizen makes a purchase or earns some money, they must send a receipt to the social serv...
instruction
0
43,009
10
86,018
Tags: binary search, brute force, data structures, sortings Correct Solution: ``` import sys in_file = sys.stdin n = int(in_file.readline().strip()) a = list(map(int, in_file.readline().strip().split())) q = int(in_file.readline().strip()) ls = [list(map(int, in_file.readline().strip().split())) for _ in range(q)] ...
output
1
43,009
10
86,019
Provide tags and a correct Python 3 solution for this coding contest problem. There is a country with n citizens. The i-th of them initially has a_{i} money. The government strictly controls the wealth of its citizens. Whenever a citizen makes a purchase or earns some money, they must send a receipt to the social serv...
instruction
0
43,010
10
86,020
Tags: binary search, brute force, data structures, sortings Correct Solution: ``` n = int(input()) arr = list(map(int,input().rstrip().split())) q = int(input()) events = [] for i in range(q) : a = list(map(int,input().rstrip().split())) events.append(a) changes = {} for i in range(q) : if (events[i]...
output
1
43,010
10
86,021
Provide tags and a correct Python 3 solution for this coding contest problem. There is a country with n citizens. The i-th of them initially has a_{i} money. The government strictly controls the wealth of its citizens. Whenever a citizen makes a purchase or earns some money, they must send a receipt to the social serv...
instruction
0
43,011
10
86,022
Tags: binary search, brute force, data structures, sortings Correct Solution: ``` n = int(input()) sp = list(map(int, input().split())) m = int(input()) pos = [-1] * (n + 1) m1 = 0 mem = [] for i in range(m): sp1 = list(map(int, input().split())) mem.append(sp1) if sp1[0] == 1: sp[sp1[1] - 1] = sp1...
output
1
43,011
10
86,023
Provide tags and a correct Python 3 solution for this coding contest problem. There is a country with n citizens. The i-th of them initially has a_{i} money. The government strictly controls the wealth of its citizens. Whenever a citizen makes a purchase or earns some money, they must send a receipt to the social serv...
instruction
0
43,012
10
86,024
Tags: binary search, brute force, data structures, sortings Correct Solution: ``` n = int(input()) a = [int(s) for s in input().split()] q = int(input()) b = [None]*n rnd = 0 xs = [] for i in range(q): qi = [int(s) for s in input().split()] if qi[0] == 1: b[qi[1]-1] = (qi[2], rnd) else: xs.a...
output
1
43,012
10
86,025
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There is a country with n citizens. The i-th of them initially has a_{i} money. The government strictly controls the wealth of its citizens. Whenever a citizen makes a purchase or earns some mon...
instruction
0
43,013
10
86,026
Yes
output
1
43,013
10
86,027
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There is a country with n citizens. The i-th of them initially has a_{i} money. The government strictly controls the wealth of its citizens. Whenever a citizen makes a purchase or earns some mon...
instruction
0
43,014
10
86,028
Yes
output
1
43,014
10
86,029
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There is a country with n citizens. The i-th of them initially has a_{i} money. The government strictly controls the wealth of its citizens. Whenever a citizen makes a purchase or earns some mon...
instruction
0
43,015
10
86,030
Yes
output
1
43,015
10
86,031
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There is a country with n citizens. The i-th of them initially has a_{i} money. The government strictly controls the wealth of its citizens. Whenever a citizen makes a purchase or earns some mon...
instruction
0
43,016
10
86,032
Yes
output
1
43,016
10
86,033
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There is a country with n citizens. The i-th of them initially has a_{i} money. The government strictly controls the wealth of its citizens. Whenever a citizen makes a purchase or earns some mon...
instruction
0
43,017
10
86,034
No
output
1
43,017
10
86,035
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There is a country with n citizens. The i-th of them initially has a_{i} money. The government strictly controls the wealth of its citizens. Whenever a citizen makes a purchase or earns some mon...
instruction
0
43,018
10
86,036
No
output
1
43,018
10
86,037
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There is a country with n citizens. The i-th of them initially has a_{i} money. The government strictly controls the wealth of its citizens. Whenever a citizen makes a purchase or earns some mon...
instruction
0
43,019
10
86,038
No
output
1
43,019
10
86,039
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There is a country with n citizens. The i-th of them initially has a_{i} money. The government strictly controls the wealth of its citizens. Whenever a citizen makes a purchase or earns some mon...
instruction
0
43,020
10
86,040
No
output
1
43,020
10
86,041
Provide tags and a correct Python 3 solution for this coding contest problem. The spring is coming and it means that a lot of fruits appear on the counters. One sunny day little boy Valera decided to go shopping. He made a list of m fruits he wanted to buy. If Valera want to buy more than one fruit of some kind, he in...
instruction
0
43,085
10
86,170
Tags: greedy, implementation, sortings Correct Solution: ``` n,m = [int(t) for t in input().split()] tags = [int(t) for t in input().split()] tags.sort() #ascending fruits = {} for _ in range(m): fruit = input() if fruit not in fruits: fruits[fruit] = 1 else: fruits[fruit] += 1 counts...
output
1
43,085
10
86,171
Provide tags and a correct Python 3 solution for this coding contest problem. The spring is coming and it means that a lot of fruits appear on the counters. One sunny day little boy Valera decided to go shopping. He made a list of m fruits he wanted to buy. If Valera want to buy more than one fruit of some kind, he in...
instruction
0
43,086
10
86,172
Tags: greedy, implementation, sortings Correct Solution: ``` n,m=map(int,input().split()) m1=list(map(int,input().split())) l1=[] l2=[] for i in range(m): l1.append(input()) l3=list(set(l1)) for i in range(len(l3)): l2.append(l1.count(l3[i])) m1.sort() l2.sort(reverse=True) j=0 s1=0 for i in range(len(l2)): s1=s1+l2...
output
1
43,086
10
86,173
Provide tags and a correct Python 3 solution for this coding contest problem. The spring is coming and it means that a lot of fruits appear on the counters. One sunny day little boy Valera decided to go shopping. He made a list of m fruits he wanted to buy. If Valera want to buy more than one fruit of some kind, he in...
instruction
0
43,087
10
86,174
Tags: greedy, implementation, sortings Correct Solution: ``` # -*- coding: utf-8 -*- from collections import Counter n,m = map(int,input().split()) x = sorted(list(map(int,input().split()))) y= list(input() for j in range(m)) k,a,b = Counter(y),0,0 for i in range(len(k)): a += list(sorted(k.values()))[::-1][i]*x...
output
1
43,087
10
86,175
Provide tags and a correct Python 3 solution for this coding contest problem. The spring is coming and it means that a lot of fruits appear on the counters. One sunny day little boy Valera decided to go shopping. He made a list of m fruits he wanted to buy. If Valera want to buy more than one fruit of some kind, he in...
instruction
0
43,088
10
86,176
Tags: greedy, implementation, sortings Correct Solution: ``` n,m=map(int,input().split()) a=sorted(map(int,input().split())) q={} for i in range(m): o=input() if o in q:q[o]+=1 else:q[o]=1 w=sorted(q[i] for i in q)[::-1] e,r=0,0 for i in range(len(w)): e+=w[i]*a[i] r+=w[i]*a[n-1-i] print(e,r) ```
output
1
43,088
10
86,177
Provide tags and a correct Python 3 solution for this coding contest problem. The spring is coming and it means that a lot of fruits appear on the counters. One sunny day little boy Valera decided to go shopping. He made a list of m fruits he wanted to buy. If Valera want to buy more than one fruit of some kind, he in...
instruction
0
43,089
10
86,178
Tags: greedy, implementation, sortings Correct Solution: ``` from collections import Counter n,m = map(int,input().split()) a = sorted(map(int,input().split())) fruits = Counter([input() for i in range(m)]) fruits = sorted([fruits[x] for x in fruits]) k = len(fruits) def dot(a,b): ans = 0 for i in range(len(a))...
output
1
43,089
10
86,179
Provide tags and a correct Python 3 solution for this coding contest problem. The spring is coming and it means that a lot of fruits appear on the counters. One sunny day little boy Valera decided to go shopping. He made a list of m fruits he wanted to buy. If Valera want to buy more than one fruit of some kind, he in...
instruction
0
43,090
10
86,180
Tags: greedy, implementation, sortings Correct Solution: ``` #!/usr/bin/env python3 n, m = tuple(map(int, input().split())) prices = sorted(list(map(int, input().split()))) fruits = {} for i in range (m): fruit = input() if fruit in fruits: fruits[fruit] += 1 else: fruits[fruit] = 1 fruitcount = sorted(l...
output
1
43,090
10
86,181
Provide tags and a correct Python 3 solution for this coding contest problem. The spring is coming and it means that a lot of fruits appear on the counters. One sunny day little boy Valera decided to go shopping. He made a list of m fruits he wanted to buy. If Valera want to buy more than one fruit of some kind, he in...
instruction
0
43,091
10
86,182
Tags: greedy, implementation, sortings Correct Solution: ``` import sys import math n, m = [int(x) for x in (sys.stdin.readline()).split()] ni = [int(x) for x in (sys.stdin.readline()).split()] d = dict() for i in range(m): st = (sys.stdin.readline()).split()[0] if st in d: d[st] += 1 else: d[st] = 1 ni.sor...
output
1
43,091
10
86,183
Provide tags and a correct Python 3 solution for this coding contest problem. The spring is coming and it means that a lot of fruits appear on the counters. One sunny day little boy Valera decided to go shopping. He made a list of m fruits he wanted to buy. If Valera want to buy more than one fruit of some kind, he in...
instruction
0
43,092
10
86,184
Tags: greedy, implementation, sortings Correct Solution: ``` a=input() a=a.split() p=input() p=p.split() r=[] for k in range (int(a[1])): b=input() r.append(b) t=[] y=1 s=0 pu=0 yo=len(r) r.sort() MAYOR=0 MENOR=0 while s<yo: ve=r.count(r[0]) t.append(ve) while pu<ve: ...
output
1
43,092
10
86,185
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The spring is coming and it means that a lot of fruits appear on the counters. One sunny day little boy Valera decided to go shopping. He made a list of m fruits he wanted to buy. If Valera want...
instruction
0
43,093
10
86,186
Yes
output
1
43,093
10
86,187
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The spring is coming and it means that a lot of fruits appear on the counters. One sunny day little boy Valera decided to go shopping. He made a list of m fruits he wanted to buy. If Valera want...
instruction
0
43,094
10
86,188
Yes
output
1
43,094
10
86,189
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The spring is coming and it means that a lot of fruits appear on the counters. One sunny day little boy Valera decided to go shopping. He made a list of m fruits he wanted to buy. If Valera want...
instruction
0
43,095
10
86,190
Yes
output
1
43,095
10
86,191
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The spring is coming and it means that a lot of fruits appear on the counters. One sunny day little boy Valera decided to go shopping. He made a list of m fruits he wanted to buy. If Valera want...
instruction
0
43,096
10
86,192
Yes
output
1
43,096
10
86,193
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The spring is coming and it means that a lot of fruits appear on the counters. One sunny day little boy Valera decided to go shopping. He made a list of m fruits he wanted to buy. If Valera want...
instruction
0
43,097
10
86,194
No
output
1
43,097
10
86,195
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The spring is coming and it means that a lot of fruits appear on the counters. One sunny day little boy Valera decided to go shopping. He made a list of m fruits he wanted to buy. If Valera want...
instruction
0
43,098
10
86,196
No
output
1
43,098
10
86,197
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The spring is coming and it means that a lot of fruits appear on the counters. One sunny day little boy Valera decided to go shopping. He made a list of m fruits he wanted to buy. If Valera want...
instruction
0
43,099
10
86,198
No
output
1
43,099
10
86,199
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The spring is coming and it means that a lot of fruits appear on the counters. One sunny day little boy Valera decided to go shopping. He made a list of m fruits he wanted to buy. If Valera want...
instruction
0
43,100
10
86,200
No
output
1
43,100
10
86,201
Provide tags and a correct Python 3 solution for this coding contest problem. Little girl Alyona is in a shop to buy some copybooks for school. She study four subjects so she wants to have equal number of copybooks for each of the subjects. There are three types of copybook's packs in the shop: it is possible to buy o...
instruction
0
43,456
10
86,912
Tags: brute force, implementation Correct Solution: ``` #!/usr/bin/env python3 n, a, b, c = map(int, input().split()) k = 4 - n%4 if k == 1: print(min(a, b + c, 3*c, )) elif k == 2: print(min(2*a, b, 2*c)) elif k == 3: print(min(3*a, a + b, c)) else: print(0) ```
output
1
43,456
10
86,913
Provide tags and a correct Python 3 solution for this coding contest problem. Little girl Alyona is in a shop to buy some copybooks for school. She study four subjects so she wants to have equal number of copybooks for each of the subjects. There are three types of copybook's packs in the shop: it is possible to buy o...
instruction
0
43,457
10
86,914
Tags: brute force, implementation Correct Solution: ``` n, a, b, c = map(int, input().split()) n = (4 - n % 4) % 4 print([0, min(a, b + c, 3 * c), min(2 * a, b, 2 * c), min(3 * a, a + b, c)][n]) ```
output
1
43,457
10
86,915
Provide tags and a correct Python 3 solution for this coding contest problem. Little girl Alyona is in a shop to buy some copybooks for school. She study four subjects so she wants to have equal number of copybooks for each of the subjects. There are three types of copybook's packs in the shop: it is possible to buy o...
instruction
0
43,458
10
86,916
Tags: brute force, implementation Correct Solution: ``` n,a,b,c=[int(i) for i in input().split()] dp=[1<<1000]*10000 dp[0]=0 ans=1<<1000 cost=1<<1000 for i in range(10000): if i>=1 : dp[i]=min(dp[i-1]+a,dp[i]) if i>=2 : dp[i]=min(dp[i-2]+b,dp[i]) if i>=3 : dp[i]=min(dp[i-3]+c,dp[i]) ...
output
1
43,458
10
86,917
Provide tags and a correct Python 3 solution for this coding contest problem. Little girl Alyona is in a shop to buy some copybooks for school. She study four subjects so she wants to have equal number of copybooks for each of the subjects. There are three types of copybook's packs in the shop: it is possible to buy o...
instruction
0
43,459
10
86,918
Tags: brute force, implementation Correct Solution: ``` n, a, b, c = map(int, input().split()) if n % 4 == 0: print (0) else: inf = 1000000000 dp = [inf for x in range(20)] dp[n % 4] = 0 sol = inf for i in range(1 + (n % 4), 20): dp[i] = min(dp[i-1] + a, min(dp[i-2] + b, dp[i-3] + ...
output
1
43,459
10
86,919