結果

問題 No.1715 Dinner 2
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2021-10-22 21:38:13
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 692 bytes
コンパイル時間 811 ms
コンパイル使用メモリ 81,444 KB
実行使用メモリ 68,236 KB
最終ジャッジ日時 2023-10-24 12:36:16
合計ジャッジ時間 3,143 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,396 KB
testcase_01 AC 35 ms
53,396 KB
testcase_02 AC 35 ms
53,396 KB
testcase_03 AC 35 ms
53,396 KB
testcase_04 AC 36 ms
53,396 KB
testcase_05 AC 35 ms
53,396 KB
testcase_06 AC 35 ms
53,396 KB
testcase_07 AC 35 ms
53,396 KB
testcase_08 AC 37 ms
53,396 KB
testcase_09 AC 36 ms
53,396 KB
testcase_10 WA -
testcase_11 AC 75 ms
66,156 KB
testcase_12 AC 80 ms
68,228 KB
testcase_13 AC 86 ms
68,236 KB
testcase_14 AC 77 ms
68,228 KB
testcase_15 AC 85 ms
68,228 KB
testcase_16 AC 70 ms
66,156 KB
testcase_17 AC 66 ms
66,156 KB
testcase_18 AC 37 ms
53,396 KB
testcase_19 AC 36 ms
53,396 KB
testcase_20 AC 35 ms
53,396 KB
testcase_21 AC 36 ms
53,396 KB
testcase_22 AC 35 ms
53,396 KB
testcase_23 AC 39 ms
53,396 KB
testcase_24 AC 36 ms
53,396 KB
testcase_25 AC 51 ms
63,772 KB
testcase_26 AC 52 ms
63,768 KB
testcase_27 AC 50 ms
63,768 KB
testcase_28 AC 51 ms
63,772 KB
testcase_29 AC 48 ms
63,768 KB
testcase_30 AC 49 ms
63,768 KB
testcase_31 AC 53 ms
65,824 KB
testcase_32 AC 82 ms
68,216 KB
testcase_33 AC 84 ms
68,216 KB
testcase_34 AC 81 ms
66,156 KB
testcase_35 AC 81 ms
66,156 KB
testcase_36 AC 36 ms
53,396 KB
testcase_37 WA -
testcase_38 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

同じ2種類のみを繰り返すのが最適?


"""

import sys
from sys import stdin
import math

N,D = map(int,stdin.readline().split())

PQ = []

for i in range(N):
    P,Q = map(int,stdin.readline().split())
    PQ.append((P,Q))

ans = float("-inf")

for i in range(N):
    for j in range(N):

        pi,qi = PQ[i]
        pj,qj = PQ[j]

        if i == j:
            continue

        nans = min(-1 * pi , -1*pi + qi - pj)

        last = (-pi+qi-pj+qj) * (D//2) + (-pi+qi) * (D % 2)

        if D % 2 == 0:
            nans = min(nans , last-qj , last-qj+pj-qi)
        else:
            nans = min(nans , last-qi , last-qi+pi-qj)

        ans = max(ans , nans)

print (ans)
0