結果
問題 | No.2010 Magical Floor |
ユーザー | mkawa2 |
提出日時 | 2022-07-15 22:38:19 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 184 ms / 2,000 ms |
コード長 | 1,210 bytes |
コンパイル時間 | 299 ms |
コンパイル使用メモリ | 87,236 KB |
実行使用メモリ | 77,616 KB |
最終ジャッジ日時 | 2023-09-10 03:34:20 |
合計ジャッジ時間 | 3,623 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 73 ms
71,748 KB |
testcase_01 | AC | 76 ms
71,352 KB |
testcase_02 | AC | 76 ms
71,832 KB |
testcase_03 | AC | 74 ms
72,120 KB |
testcase_04 | AC | 78 ms
71,716 KB |
testcase_05 | AC | 79 ms
76,184 KB |
testcase_06 | AC | 79 ms
76,240 KB |
testcase_07 | AC | 80 ms
76,272 KB |
testcase_08 | AC | 79 ms
76,056 KB |
testcase_09 | AC | 82 ms
76,168 KB |
testcase_10 | AC | 80 ms
76,232 KB |
testcase_11 | AC | 93 ms
77,196 KB |
testcase_12 | AC | 90 ms
77,256 KB |
testcase_13 | AC | 91 ms
77,108 KB |
testcase_14 | AC | 93 ms
77,396 KB |
testcase_15 | AC | 94 ms
77,164 KB |
testcase_16 | AC | 92 ms
77,272 KB |
testcase_17 | AC | 95 ms
77,324 KB |
testcase_18 | AC | 97 ms
77,276 KB |
testcase_19 | AC | 183 ms
77,616 KB |
testcase_20 | AC | 184 ms
77,100 KB |
testcase_21 | AC | 130 ms
77,212 KB |
ソースコード
import sys sys.setrecursionlimit(200005) int1 = lambda x: int(x)-1 pDB = lambda *x: print(*x, end="\n", file=sys.stderr) p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr) def II(): return int(sys.stdin.readline()) def LI(): return list(map(int, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def LI1(): return list(map(int1, sys.stdin.readline().split())) def LLI1(rows_number): return [LI1() for _ in range(rows_number)] def SI(): return sys.stdin.readline().rstrip() # dij = [(0, 1), (-1, 0), (0, -1), (1, 0)] dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)] inf = (1 << 63)-1 # inf = (1 << 31)-1 md = 10**9+7 # md = 998244353 def solve(): n, x = LI() hh = [0]+LI() aa = LI() ans = inf mn = inf for i, a in enumerate(aa): if a >= mn: continue mn = a di = x t = 0 for j in range(i): h = hh[j+1]-hh[j] d = a*h/(aa[j]**2-a**2)**0.5 di -= d*2 t += (d**2+h**2)**0.5*aa[j]*2 if di < 0: continue t += di*a ans = min(ans, t) print(f"{ans:.10f}") for _ in range(II()): solve()