結果
問題 | No.2010 Magical Floor |
ユーザー | mkawa2 |
提出日時 | 2022-07-15 22:33:13 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,207 bytes |
コンパイル時間 | 339 ms |
コンパイル使用メモリ | 87,076 KB |
実行使用メモリ | 77,584 KB |
最終ジャッジ日時 | 2023-09-10 03:22:43 |
合計ジャッジ時間 | 3,691 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 71 ms
71,948 KB |
testcase_01 | AC | 75 ms
71,368 KB |
testcase_02 | AC | 75 ms
71,748 KB |
testcase_03 | AC | 75 ms
71,952 KB |
testcase_04 | AC | 75 ms
71,536 KB |
testcase_05 | AC | 81 ms
76,208 KB |
testcase_06 | AC | 79 ms
76,264 KB |
testcase_07 | AC | 80 ms
76,220 KB |
testcase_08 | AC | 79 ms
76,152 KB |
testcase_09 | AC | 79 ms
76,160 KB |
testcase_10 | AC | 80 ms
76,148 KB |
testcase_11 | AC | 92 ms
77,200 KB |
testcase_12 | AC | 94 ms
77,256 KB |
testcase_13 | AC | 92 ms
77,284 KB |
testcase_14 | AC | 92 ms
77,316 KB |
testcase_15 | AC | 93 ms
77,228 KB |
testcase_16 | AC | 94 ms
77,192 KB |
testcase_17 | WA | - |
testcase_18 | AC | 93 ms
77,272 KB |
testcase_19 | WA | - |
testcase_20 | AC | 179 ms
77,196 KB |
testcase_21 | WA | - |
ソースコード
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: break t += di*a ans = min(ans, t) print(f"{ans:.10f}") for _ in range(II()): solve()