結果

問題 No.1715 Dinner 2
ユーザー hir355hir355
提出日時 2021-10-22 21:38:30
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 486 bytes
コンパイル時間 725 ms
コンパイル使用メモリ 81,600 KB
実行使用メモリ 66,240 KB
最終ジャッジ日時 2023-10-24 12:37:07
合計ジャッジ時間 3,043 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,440 KB
testcase_01 AC 36 ms
53,440 KB
testcase_02 AC 37 ms
53,440 KB
testcase_03 AC 36 ms
53,440 KB
testcase_04 AC 36 ms
53,440 KB
testcase_05 WA -
testcase_06 AC 38 ms
53,440 KB
testcase_07 WA -
testcase_08 AC 37 ms
53,440 KB
testcase_09 AC 37 ms
53,440 KB
testcase_10 WA -
testcase_11 AC 65 ms
66,160 KB
testcase_12 AC 68 ms
66,240 KB
testcase_13 AC 71 ms
66,240 KB
testcase_14 AC 67 ms
66,240 KB
testcase_15 AC 69 ms
66,240 KB
testcase_16 AC 62 ms
64,124 KB
testcase_17 AC 57 ms
64,124 KB
testcase_18 WA -
testcase_19 AC 36 ms
53,496 KB
testcase_20 AC 35 ms
53,496 KB
testcase_21 AC 35 ms
53,496 KB
testcase_22 WA -
testcase_23 AC 37 ms
53,496 KB
testcase_24 AC 37 ms
53,496 KB
testcase_25 AC 45 ms
61,740 KB
testcase_26 AC 46 ms
61,620 KB
testcase_27 AC 45 ms
61,740 KB
testcase_28 AC 45 ms
61,740 KB
testcase_29 AC 45 ms
61,740 KB
testcase_30 AC 46 ms
61,740 KB
testcase_31 AC 46 ms
61,740 KB
testcase_32 AC 72 ms
66,240 KB
testcase_33 AC 73 ms
66,240 KB
testcase_34 AC 72 ms
66,240 KB
testcase_35 AC 73 ms
66,240 KB
testcase_36 AC 36 ms
53,496 KB
testcase_37 AC 35 ms
53,496 KB
testcase_38 AC 35 ms
53,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, d = map(int, input().split())
p = [0] * n
q = [0] * n
for i in range(n):
    p[i], q[i] = map(int, input().split())
ans = -1000000000
for i in range(n):
    for j in range(n):
        if i == j:
            continue
        res = -p[i]
        if d % 2 == 0:
            res = min(res, (q[i] - p[i] + q[j] - p[j]) * (d // 2) - q[j])
        else:
            res = min(res, (q[i] - p[i] + q[j] - p[j]) * (d // 2) - p[j])
        if ans < res:
            ans = res
print(min(ans, 0))
0