結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,408 KB
testcase_01 AC 41 ms
53,408 KB
testcase_02 AC 35 ms
53,408 KB
testcase_03 AC 35 ms
53,408 KB
testcase_04 AC 36 ms
53,408 KB
testcase_05 WA -
testcase_06 AC 35 ms
53,408 KB
testcase_07 WA -
testcase_08 AC 36 ms
53,408 KB
testcase_09 AC 35 ms
53,408 KB
testcase_10 WA -
testcase_11 AC 64 ms
66,128 KB
testcase_12 AC 67 ms
66,200 KB
testcase_13 AC 71 ms
66,200 KB
testcase_14 AC 66 ms
66,200 KB
testcase_15 AC 69 ms
66,200 KB
testcase_16 AC 61 ms
64,084 KB
testcase_17 AC 57 ms
64,084 KB
testcase_18 WA -
testcase_19 AC 35 ms
53,408 KB
testcase_20 AC 35 ms
53,408 KB
testcase_21 AC 35 ms
53,408 KB
testcase_22 WA -
testcase_23 AC 36 ms
53,408 KB
testcase_24 AC 36 ms
53,408 KB
testcase_25 AC 45 ms
61,696 KB
testcase_26 AC 47 ms
61,576 KB
testcase_27 AC 44 ms
61,696 KB
testcase_28 AC 44 ms
61,696 KB
testcase_29 AC 44 ms
61,696 KB
testcase_30 AC 44 ms
61,696 KB
testcase_31 AC 43 ms
61,696 KB
testcase_32 AC 73 ms
66,200 KB
testcase_33 AC 72 ms
66,200 KB
testcase_34 AC 73 ms
66,200 KB
testcase_35 AC 73 ms
66,200 KB
testcase_36 AC 35 ms
53,408 KB
testcase_37 AC 35 ms
53,408 KB
testcase_38 AC 39 ms
53,408 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())
if d == 1:
    ans = -1000000000
    for i in range(n):
        if ans < -p[i]:
            ans = -p[i]
    print(ans)
    exit(0)
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