結果
問題 | No.2010 Magical Floor |
ユーザー | mkawa2 |
提出日時 | 2022-07-15 22:10:52 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,197 bytes |
コンパイル時間 | 367 ms |
コンパイル使用メモリ | 87,196 KB |
実行使用メモリ | 77,620 KB |
最終ジャッジ日時 | 2023-09-10 02:12:21 |
合計ジャッジ時間 | 3,671 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 73 ms
71,880 KB |
testcase_01 | AC | 75 ms
71,620 KB |
testcase_02 | AC | 76 ms
71,564 KB |
testcase_03 | AC | 77 ms
72,076 KB |
testcase_04 | AC | 75 ms
71,868 KB |
testcase_05 | AC | 78 ms
76,092 KB |
testcase_06 | AC | 79 ms
76,076 KB |
testcase_07 | AC | 80 ms
76,240 KB |
testcase_08 | AC | 80 ms
76,192 KB |
testcase_09 | AC | 81 ms
76,092 KB |
testcase_10 | AC | 80 ms
76,192 KB |
testcase_11 | AC | 89 ms
77,256 KB |
testcase_12 | AC | 89 ms
77,348 KB |
testcase_13 | AC | 93 ms
77,132 KB |
testcase_14 | AC | 93 ms
77,436 KB |
testcase_15 | AC | 93 ms
77,064 KB |
testcase_16 | AC | 92 ms
77,212 KB |
testcase_17 | WA | - |
testcase_18 | AC | 94 ms
77,152 KB |
testcase_19 | WA | - |
testcase_20 | AC | 179 ms
77,232 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(ans) for _ in range(II()): solve()