Submission #980626

#TimeUsernameProblemLanguageResultExecution timeMemory
980626brijeshSiwachBalloons (CEOI11_bal)Cpython 3
100 / 100
916 ms61996 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]) r = min(cr, r) if r >= ans[stack[-1]]: 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...