Submission #980619

#TimeUsernameProblemLanguageResultExecution timeMemory
980619brijeshSiwachBalloons (CEOI11_bal)Cpython 3
10 / 100
858 ms55812 KiB
import random import time random.seed(time.time()) def solve(): n=int(input()) a=[list(map(int,input().split())) for _ in range(n)] ans = [0]*(n) stack = [] def find(i: int, j: int): return ((a[j][0]-a[i][0])**2) / (4*ans[j]) for i in range(n): r = a[i][1] while len(stack) > 0: cr = find(i, stack[-1]) if cr <= r: r = cr stack.pop() else: break ans[i] = r stack.append(i) print(*ans, sep="\n") if __name__ == '__main__': t = 1 # print(t) while t > 0: t -= 1 solve()
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...