message
stringlengths
2
48.6k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
318
108k
cluster
float64
8
8
__index_level_0__
int64
636
217k
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are N stones, numbered 1, 2, \ldots, N. For each i (1 \leq i \leq N), the height of Stone i is h_i. Here, h_1 < h_2 < \cdots < h_N holds. There is a frog who is initially on Stone 1. He w...
instruction
0
95,097
8
190,194
No
output
1
95,097
8
190,195
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are N stones, numbered 1, 2, \ldots, N. For each i (1 \leq i \leq N), the height of Stone i is h_i. Here, h_1 < h_2 < \cdots < h_N holds. There is a frog who is initially on Stone 1. He w...
instruction
0
95,098
8
190,196
No
output
1
95,098
8
190,197
Provide a correct Python 3 solution for this coding contest problem. Reordering the Documents Susan is good at arranging her dining table for convenience, but not her office desk. Susan has just finished the paperwork on a set of documents, which are still piled on her desk. They have serial numbers and were stacked...
instruction
0
95,232
8
190,464
"Correct Solution: ``` def main(): mod = 10 ** 9 + 7 n, m = map(int, input().split()) a = [int(x) for x in input().split()] if not m: print(0) return mx = [0] * (n + 1) mn = [mod] * (n + 1) for i in range(n): if mx[i] > a[i]: mx[i + 1] = mx[i] ...
output
1
95,232
8
190,465
Provide a correct Python 3 solution for this coding contest problem. AtCoder's head office consists of N rooms numbered 1 to N. For any two rooms, there is a direct passage connecting these rooms. For security reasons, Takahashi the president asked you to set a level for every passage, which is a positive integer and...
instruction
0
95,887
8
191,774
"Correct Solution: ``` import sys sys.setrecursionlimit(2147483647) INF=float("inf") MOD=10**9+7 input=lambda:sys.stdin.readline().rstrip() def resolve(): n=int(input()) for u in range(n-1): ans=[] for v in range(u+1,n): w=u^v for i in range(10): if((w>>i)...
output
1
95,887
8
191,775
Provide a correct Python 3 solution for this coding contest problem. AtCoder's head office consists of N rooms numbered 1 to N. For any two rooms, there is a direct passage connecting these rooms. For security reasons, Takahashi the president asked you to set a level for every passage, which is a positive integer and...
instruction
0
95,888
8
191,776
"Correct Solution: ``` N=int(input()) for i in range(N): i = i + 1 for j in range(N-i): j = i+j+1 for k in range(9): if i % (2**(k+1)) != j % (2**(k+1)): print(k+1, end=" ") break print() ```
output
1
95,888
8
191,777
Provide a correct Python 3 solution for this coding contest problem. AtCoder's head office consists of N rooms numbered 1 to N. For any two rooms, there is a direct passage connecting these rooms. For security reasons, Takahashi the president asked you to set a level for every passage, which is a positive integer and...
instruction
0
95,889
8
191,778
"Correct Solution: ``` n = int(input()) def b(x): return format(x,'04b') for i in range(1,n+1): for j in range(i+1,n+1): tmp = i ^ j bit = format(tmp, 'b')[::-1] # print(bit) for k in range(len(bit)): # print(bit[k]) if int(bit[k]) == 1: ...
output
1
95,889
8
191,779
Provide a correct Python 3 solution for this coding contest problem. AtCoder's head office consists of N rooms numbered 1 to N. For any two rooms, there is a direct passage connecting these rooms. For security reasons, Takahashi the president asked you to set a level for every passage, which is a positive integer and...
instruction
0
95,890
8
191,780
"Correct Solution: ``` n = int(input()) for i in range(n-1): L = [] for j in range(i+1, n): x = i^j l = (x&-x).bit_length() L.append(l) print(*L) ```
output
1
95,890
8
191,781
Provide a correct Python 3 solution for this coding contest problem. AtCoder's head office consists of N rooms numbered 1 to N. For any two rooms, there is a direct passage connecting these rooms. For security reasons, Takahashi the president asked you to set a level for every passage, which is a positive integer and...
instruction
0
95,891
8
191,782
"Correct Solution: ``` n = int(input()) lst = [] for i in range(n): num = format(i, '09b') lst.append(num[::-1]) for i in range(n-1): ans = [] for j in range(i+1, n): numi = lst[i] numj = lst[j] idx = 0 while True: if numi[idx] != numj[idx]: ...
output
1
95,891
8
191,783
Provide a correct Python 3 solution for this coding contest problem. AtCoder's head office consists of N rooms numbered 1 to N. For any two rooms, there is a direct passage connecting these rooms. For security reasons, Takahashi the president asked you to set a level for every passage, which is a positive integer and...
instruction
0
95,892
8
191,784
"Correct Solution: ``` #!/usr/bin/env python3 from collections import defaultdict,deque from heapq import heappush, heappop from bisect import * import sys, random, itertools, math sys.setrecursionlimit(10**5) input = sys.stdin.readline sqrt = math.sqrt def LI(): return list(map(int, input().split())) def LF(): return ...
output
1
95,892
8
191,785
Provide a correct Python 3 solution for this coding contest problem. AtCoder's head office consists of N rooms numbered 1 to N. For any two rooms, there is a direct passage connecting these rooms. For security reasons, Takahashi the president asked you to set a level for every passage, which is a positive integer and...
instruction
0
95,893
8
191,786
"Correct Solution: ``` n = int(input()) ans = [[0 for i in range(n)] for j in range(n)] def p2(a): ret = 0 while a%2 == 0: ret += 1 a //= 2 return ret for i in range(n): for j in range(n-i-1): ans[i][j] = p2(j+1)+1 for i in range(n): arr = ans[i][:n-i-1] print(*arr) ```
output
1
95,893
8
191,787
Provide a correct Python 3 solution for this coding contest problem. AtCoder's head office consists of N rooms numbered 1 to N. For any two rooms, there is a direct passage connecting these rooms. For security reasons, Takahashi the president asked you to set a level for every passage, which is a positive integer and...
instruction
0
95,894
8
191,788
"Correct Solution: ``` from math import log2 def main(): n = int(input()) for u in range(n - 1): ans = [] for v in range(u + 1, n): uv = u ^ v ans.append(int(log2(uv & -uv) + 1)) print(*ans) main() ```
output
1
95,894
8
191,789
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. AtCoder's head office consists of N rooms numbered 1 to N. For any two rooms, there is a direct passage connecting these rooms. For security reasons, Takahashi the president asked you to set a ...
instruction
0
95,898
8
191,796
Yes
output
1
95,898
8
191,797
Provide a correct Python 3 solution for this coding contest problem. N: Mail order Mr. Komozawa bought building blocks toys from Makai mail order. The building blocks are in the shape of a cube with a side length of 1, and are stacked on squares divided into $ H $ pieces vertically and $ W $ pieces horizontally. Se...
instruction
0
96,058
8
192,116
"Correct Solution: ``` from bisect import bisect_left as bl from itertools import accumulate h, w= map(int, input().split()) aList = sorted(map(int, input().split())) bList = list(map(int, input().split())) acc = [0]+list(accumulate(aList)) aList.insert(0, -1) ans = 0 for b in bList: index = bl(aList, b) ans ...
output
1
96,058
8
192,117
Provide tags and a correct Python 3 solution for this coding contest problem. There is a toy building consisting of n towers. Each tower consists of several cubes standing on each other. The i-th tower consists of h_i cubes, so it has height h_i. Let's define operation slice on some height H as following: for each to...
instruction
0
96,093
8
192,186
Tags: greedy Correct Solution: ``` n, k = map(int, input().split()) h = list(map(int, input().split())) h.sort(reverse=True) levels = [] prev = h[0] count = 1 for x in h[1:]: if x != prev: for _ in range(prev - x): levels.append(count) prev = x count += 1 if len(levels) == 0: print(0) exit(0)...
output
1
96,093
8
192,187
Provide tags and a correct Python 3 solution for this coding contest problem. There is a toy building consisting of n towers. Each tower consists of several cubes standing on each other. The i-th tower consists of h_i cubes, so it has height h_i. Let's define operation slice on some height H as following: for each to...
instruction
0
96,094
8
192,188
Tags: greedy Correct Solution: ``` n, k = map(int, input().split()) A = list(map(int, input().split())) A.sort(reverse=True) ans = 0 g = A[-1] h = A[0] p = 0 i = 1 c = 0 l = 0 while h > g and i < n: if A[i] == A[p]: p += 1 i += 1 continue for j in range(A[p] - A[i]): c += p+1 l += 1 if c >...
output
1
96,094
8
192,189
Provide tags and a correct Python 3 solution for this coding contest problem. There is a toy building consisting of n towers. Each tower consists of several cubes standing on each other. The i-th tower consists of h_i cubes, so it has height h_i. Let's define operation slice on some height H as following: for each to...
instruction
0
96,095
8
192,190
Tags: greedy Correct Solution: ``` n,k=list(map(int,input().split())) h=list(map(int,input().split())) m=h[0] m1=h[0] for i in h: m=max(m,i) m1=min(m1,i) if h==[m]*n: print(0) else: a=[0]*m for i in h: a[i-1]+=1 b=[0]*m c=0 for i in range(m-1,-1,-1): c+=a[i] b[i]=...
output
1
96,095
8
192,191
Provide tags and a correct Python 3 solution for this coding contest problem. There is a toy building consisting of n towers. Each tower consists of several cubes standing on each other. The i-th tower consists of h_i cubes, so it has height h_i. Let's define operation slice on some height H as following: for each to...
instruction
0
96,096
8
192,192
Tags: greedy Correct Solution: ``` n , k = map(int,input().split()) ar = list(map(int,input().split())) N = int(2e5 + 10) cnt = [0 for _ in range(N)] for i in ar: cnt[i] += 1 # print(cnt[1:max(ar) + 1]) for i in range( N-2 , 0 , -1 ): cnt[i] += cnt[i+1] cnt[0] = 0 i ...
output
1
96,096
8
192,193
Provide tags and a correct Python 3 solution for this coding contest problem. There is a toy building consisting of n towers. Each tower consists of several cubes standing on each other. The i-th tower consists of h_i cubes, so it has height h_i. Let's define operation slice on some height H as following: for each to...
instruction
0
96,097
8
192,194
Tags: greedy Correct Solution: ``` if __name__ == "__main__": numOfTowers, numOfOperation = map(int, input().split()) towerheights = list(map(int, input().split())) towerheights.sort(reverse=True) # print(towerheights) # [4, 3, 2, 2, 1] counter = 0 lowerheight = towerheights[-1] highe...
output
1
96,097
8
192,195
Provide tags and a correct Python 3 solution for this coding contest problem. There is a toy building consisting of n towers. Each tower consists of several cubes standing on each other. The i-th tower consists of h_i cubes, so it has height h_i. Let's define operation slice on some height H as following: for each to...
instruction
0
96,098
8
192,196
Tags: greedy 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('input.txt', 'r') sys.s...
output
1
96,098
8
192,197
Provide tags and a correct Python 3 solution for this coding contest problem. There is a toy building consisting of n towers. Each tower consists of several cubes standing on each other. The i-th tower consists of h_i cubes, so it has height h_i. Let's define operation slice on some height H as following: for each to...
instruction
0
96,099
8
192,198
Tags: greedy Correct Solution: ``` from sys import stdin,stdout def main(): n,k = map(int,stdin.readline().split()) a = list(map(int,stdin.readline().split())) h_cnt = [0 for i in range(200005) ] mn,mx = 200000, 1 for i in range(n): h_cnt[ a[i] ] += 1 mx = max(mx,a[i]) tmp = mx ...
output
1
96,099
8
192,199
Provide tags and a correct Python 3 solution for this coding contest problem. There is a toy building consisting of n towers. Each tower consists of several cubes standing on each other. The i-th tower consists of h_i cubes, so it has height h_i. Let's define operation slice on some height H as following: for each to...
instruction
0
96,100
8
192,200
Tags: greedy Correct Solution: ``` from collections import defaultdict n,k=[int(el) for el in input().split()] h=[int(el) for el in input().split()] l=len(h) d=defaultdict(int) maxh=h[0] minh=h[0] for i in range(l): d[h[i]]+=1 maxh=max(maxh,h[i]) minh=min(minh,h[i]) if n==1 or minh==maxh: print(0) ...
output
1
96,100
8
192,201
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There is a toy building consisting of n towers. Each tower consists of several cubes standing on each other. The i-th tower consists of h_i cubes, so it has height h_i. Let's define operation s...
instruction
0
96,101
8
192,202
Yes
output
1
96,101
8
192,203
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There is a toy building consisting of n towers. Each tower consists of several cubes standing on each other. The i-th tower consists of h_i cubes, so it has height h_i. Let's define operation s...
instruction
0
96,102
8
192,204
Yes
output
1
96,102
8
192,205
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There is a toy building consisting of n towers. Each tower consists of several cubes standing on each other. The i-th tower consists of h_i cubes, so it has height h_i. Let's define operation s...
instruction
0
96,103
8
192,206
Yes
output
1
96,103
8
192,207
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There is a toy building consisting of n towers. Each tower consists of several cubes standing on each other. The i-th tower consists of h_i cubes, so it has height h_i. Let's define operation s...
instruction
0
96,104
8
192,208
Yes
output
1
96,104
8
192,209
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There is a toy building consisting of n towers. Each tower consists of several cubes standing on each other. The i-th tower consists of h_i cubes, so it has height h_i. Let's define operation s...
instruction
0
96,105
8
192,210
No
output
1
96,105
8
192,211
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There is a toy building consisting of n towers. Each tower consists of several cubes standing on each other. The i-th tower consists of h_i cubes, so it has height h_i. Let's define operation s...
instruction
0
96,106
8
192,212
No
output
1
96,106
8
192,213
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There is a toy building consisting of n towers. Each tower consists of several cubes standing on each other. The i-th tower consists of h_i cubes, so it has height h_i. Let's define operation s...
instruction
0
96,107
8
192,214
No
output
1
96,107
8
192,215
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There is a toy building consisting of n towers. Each tower consists of several cubes standing on each other. The i-th tower consists of h_i cubes, so it has height h_i. Let's define operation s...
instruction
0
96,108
8
192,216
No
output
1
96,108
8
192,217
Provide tags and a correct Python 3 solution for this coding contest problem. Iahub helps his grandfather at the farm. Today he must milk the cows. There are n cows sitting in a row, numbered from 1 to n from left to right. Each cow is either facing to the left or facing to the right. When Iahub milks a cow, all the c...
instruction
0
96,472
8
192,944
Tags: data structures, greedy Correct Solution: ``` from collections import * from itertools import accumulate def arr_sum(arr): arr.appendleft(0) return list(accumulate(arr, lambda x, y: x + y)) def solve(): ans1, ans0 = 0, 0 for i in range(n): if a[i]: ans1 += (n - (i + 1)) - ...
output
1
96,472
8
192,945
Provide a correct Python 3 solution for this coding contest problem. Saving electricity is very important! You are in the office represented as R \times C grid that consists of walls and rooms. It is guaranteed that, for any pair of rooms in the office, there exists exactly one route between the two rooms. It takes 1...
instruction
0
96,915
8
193,830
"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**13 mod = 10**9+7 dd = [(-1,0),(0,1),(1,0),(0,-1)] ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)] def LI(): return [int...
output
1
96,915
8
193,831
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Oh, New Year. The time to gather all your friends and reflect on the heartwarming events of the past year... n friends live in a city which can be represented as a number line. The i-th friend ...
instruction
0
97,093
8
194,186
Yes
output
1
97,093
8
194,187
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Oh, New Year. The time to gather all your friends and reflect on the heartwarming events of the past year... n friends live in a city which can be represented as a number line. The i-th friend ...
instruction
0
97,094
8
194,188
Yes
output
1
97,094
8
194,189
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Oh, New Year. The time to gather all your friends and reflect on the heartwarming events of the past year... n friends live in a city which can be represented as a number line. The i-th friend ...
instruction
0
97,095
8
194,190
Yes
output
1
97,095
8
194,191
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Oh, New Year. The time to gather all your friends and reflect on the heartwarming events of the past year... n friends live in a city which can be represented as a number line. The i-th friend ...
instruction
0
97,096
8
194,192
Yes
output
1
97,096
8
194,193
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Oh, New Year. The time to gather all your friends and reflect on the heartwarming events of the past year... n friends live in a city which can be represented as a number line. The i-th friend ...
instruction
0
97,097
8
194,194
No
output
1
97,097
8
194,195
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Oh, New Year. The time to gather all your friends and reflect on the heartwarming events of the past year... n friends live in a city which can be represented as a number line. The i-th friend ...
instruction
0
97,098
8
194,196
No
output
1
97,098
8
194,197
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Oh, New Year. The time to gather all your friends and reflect on the heartwarming events of the past year... n friends live in a city which can be represented as a number line. The i-th friend ...
instruction
0
97,099
8
194,198
No
output
1
97,099
8
194,199
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Oh, New Year. The time to gather all your friends and reflect on the heartwarming events of the past year... n friends live in a city which can be represented as a number line. The i-th friend ...
instruction
0
97,100
8
194,200
No
output
1
97,100
8
194,201
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya is a Greencode wildlife preservation society proponent. One day he found an empty field nobody owned, divided it into n Γ— m squares and decided to plant a forest there. Vasya will plant nm trees of all different heights from 1 to nm. F...
instruction
0
98,223
8
196,446
Tags: constructive algorithms Correct Solution: ``` n, m = map(int, input().split()) transpose = False if n > m: n, m = m, n transpose = True if n == 1 and m == 1: print(1) import sys; sys.exit() if (n == 1 and m < 4) or (n == 2 and m < 3): print(-1) import sys; sys.exit() if n == 1: row = m * [None] ...
output
1
98,223
8
196,447
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya is a Greencode wildlife preservation society proponent. One day he found an empty field nobody owned, divided it into n Γ— m squares and decided to plant a forest there. Vasya will plant nm trees of all different heights from 1 to nm. F...
instruction
0
98,224
8
196,448
Tags: constructive algorithms Correct Solution: ``` # by the authority of GOD author: manhar singh sachdev # def some_random_function(): """due to the fast IO template, my code gets caught in plag check for no reason. That is why, I am making random functions""" x = 10 x *= 100 i_dont...
output
1
98,224
8
196,449
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya is a Greencode wildlife preservation society proponent. One day he found an empty field nobody owned, divided it into n Γ— m squares and decided to plant a forest there. Vasya will plant nm trees of all different heights from 1 to nm. F...
instruction
0
98,225
8
196,450
Tags: constructive algorithms Correct Solution: ``` # Legends Always Come Up with Solution # Author: Manvir Singh import os import sys from io import BytesIO, IOBase def main(): n,m=map(int,input().split()) z=n*m y,a=z-(z%2==0),[[] for _ in range(n)] for i in range(n): for j in range(m): ...
output
1
98,225
8
196,451
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya is a Greencode wildlife preservation society proponent. One day he found an empty field nobody owned, divided it into n Γ— m squares and decided to plant a forest there. Vasya will plant nm trees of all different heights from 1 to nm. F...
instruction
0
98,226
8
196,452
Tags: constructive algorithms Correct Solution: ``` # Legends Always Come Up with Solution # Author: Manvir Singh import os import sys from io import BytesIO, IOBase def main(): n,m=map(int,input().split()) z,f=n*m,1 y,a=z-(z%2==0),[[] for _ in range(n)] for i in range(n): for j in range(m): ...
output
1
98,226
8
196,453
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vasya is a Greencode wildlife preservation society proponent. One day he found an empty field nobody owned, divided it into n Γ— m squares and decided to plant a forest there. Vasya will plant nm...
instruction
0
98,228
8
196,456
No
output
1
98,228
8
196,457
Provide tags and a correct Python 3 solution for this coding contest problem. Mary has just graduated from one well-known University and is now attending celebration party. Students like to dream of a beautiful life, so they used champagne glasses to construct a small pyramid. The height of the pyramid is n. The top l...
instruction
0
98,263
8
196,526
Tags: implementation, math, math Correct Solution: ``` n, t = map(int, input().split()) a = [[None]] + [[0] * i for i in range(1, n + 1)] c = 2 ** (n + 1) for _ in range(t): a[1][0] += c for i in range(1, n + 1): for j in range(i): if a[i][j] > c: diff = a[i][j] - c a[i][j] = c if i < n: a[i ...
output
1
98,263
8
196,527
Provide tags and a correct Python 3 solution for this coding contest problem. Mary has just graduated from one well-known University and is now attending celebration party. Students like to dream of a beautiful life, so they used champagne glasses to construct a small pyramid. The height of the pyramid is n. The top l...
instruction
0
98,264
8
196,528
Tags: implementation, math, math Correct Solution: ``` n, t = map(int, input().split()) t = min(2000, t) L = [ [0.0]*n for i in range(n) ] for _ in range(t) : L[0][0] += 1.0 for i in range(n-1) : for j in range(i+1) : if L[i][j] > 1.0 : x = (L[i][j] - 1.0) / 2 ...
output
1
98,264
8
196,529
Provide tags and a correct Python 3 solution for this coding contest problem. Mary has just graduated from one well-known University and is now attending celebration party. Students like to dream of a beautiful life, so they used champagne glasses to construct a small pyramid. The height of the pyramid is n. The top l...
instruction
0
98,265
8
196,530
Tags: implementation, math, math Correct Solution: ``` n,t=list(map(int,input().split())) li=[[t-1]] cnt=1 if t-1>=0 else 0 for i in range(2,n+1): tr=li[-1][0]/2-1 if tr>=0: cnt+=2 li.append([tr]) for j in range(1,i-1): a=li[-2][j-1] b=li[-2][j] temp=-1 if a >0 : ...
output
1
98,265
8
196,531
Provide tags and a correct Python 3 solution for this coding contest problem. Mary has just graduated from one well-known University and is now attending celebration party. Students like to dream of a beautiful life, so they used champagne glasses to construct a small pyramid. The height of the pyramid is n. The top l...
instruction
0
98,266
8
196,532
Tags: implementation, math, math Correct Solution: ``` a = 1<<10 bocal = [[0]*(i+1) for i in range(10)] ans = [[0]*(i+1) for i in range(10)] x = input().split() n = int(x[0]) t = int(x[1]) bocal[0][0]=a ans[0][0]=1 for z in range(2,2000): bocal[0][0]+=a for i in range(10): for j in range(i+1): ...
output
1
98,266
8
196,533
Provide tags and a correct Python 3 solution for this coding contest problem. Mary has just graduated from one well-known University and is now attending celebration party. Students like to dream of a beautiful life, so they used champagne glasses to construct a small pyramid. The height of the pyramid is n. The top l...
instruction
0
98,267
8
196,534
Tags: implementation, math, math Correct Solution: ``` n,t=map(int, input().split()) m=[[0 for _ in range(11)]for _ in range(11)] m[1][1]=t for i in range(1, n): for j in range(1, n + 1): if m[i][j] > 1: m[i + 1][j] += (m[i][j] - 1) / 2 m[i + 1][j + 1] += (m[i][j] - 1) / 2 print(sum([sum(map(lambda x: x >= 1, ...
output
1
98,267
8
196,535
Provide tags and a correct Python 3 solution for this coding contest problem. Mary has just graduated from one well-known University and is now attending celebration party. Students like to dream of a beautiful life, so they used champagne glasses to construct a small pyramid. The height of the pyramid is n. The top l...
instruction
0
98,268
8
196,536
Tags: implementation, math, math Correct Solution: ``` inin=input().split(' ') n=int(inin[0]) t=int(inin[1]) mat=[] for i in range(n+2): mat.append([0.0]*(n+2)) # def add(i,j,amt): # if i>=n or j<0 or j>=n: # return # mat[i][j]+=amt # if mat[i][j]>1: # over=mat[i][j]-1 # mat[i][j]-=over # add(i+1,j,over/2...
output
1
98,268
8
196,537