結果

問題 No.343 手抜き工事のプロ
ユーザー convexineqconvexineq
提出日時 2021-01-14 07:22:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 96 ms / 2,000 ms
コード長 264 bytes
コンパイル時間 556 ms
コンパイル使用メモリ 86,948 KB
実行使用メモリ 93,684 KB
最終ジャッジ日時 2023-08-15 12:13:38
合計ジャッジ時間 3,764 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
71,448 KB
testcase_01 AC 63 ms
71,380 KB
testcase_02 AC 67 ms
71,440 KB
testcase_03 AC 66 ms
71,328 KB
testcase_04 AC 66 ms
71,456 KB
testcase_05 AC 66 ms
71,560 KB
testcase_06 AC 67 ms
71,452 KB
testcase_07 AC 67 ms
71,388 KB
testcase_08 AC 66 ms
71,516 KB
testcase_09 AC 67 ms
71,344 KB
testcase_10 AC 65 ms
71,236 KB
testcase_11 AC 67 ms
71,552 KB
testcase_12 AC 66 ms
71,596 KB
testcase_13 AC 77 ms
76,540 KB
testcase_14 AC 69 ms
71,192 KB
testcase_15 AC 71 ms
71,592 KB
testcase_16 AC 66 ms
71,440 KB
testcase_17 AC 66 ms
71,588 KB
testcase_18 AC 67 ms
71,428 KB
testcase_19 AC 66 ms
71,272 KB
testcase_20 AC 88 ms
76,384 KB
testcase_21 AC 88 ms
81,004 KB
testcase_22 AC 87 ms
82,592 KB
testcase_23 AC 95 ms
86,164 KB
testcase_24 AC 96 ms
90,692 KB
testcase_25 AC 92 ms
93,076 KB
testcase_26 AC 95 ms
93,684 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,*x = map(int,open(0).read().split())
L = x[0]
g = x[0] = 0
ans = n-1
for i in range(n-2,-1,-1):
    g += x[i+1]
    if 2*(n-1-i)*max(x[i],x[i+1]) < 2*g+L*(n-1-i) < 2*(n-1-i)*(min(x[i],x[i+1])+L): ans -= 1
    if abs(x[i+1]-x[i]) >= L: ans = -1
print(max(ans,-1))
0