結果

問題 No.1715 Dinner 2
ユーザー zkouzkou
提出日時 2021-10-08 11:08:51
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 678 bytes
コンパイル時間 162 ms
コンパイル使用メモリ 81,776 KB
実行使用メモリ 75,676 KB
最終ジャッジ日時 2023-10-24 11:32:31
合計ジャッジ時間 3,502 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 37 ms
53,452 KB
testcase_02 AC 36 ms
53,452 KB
testcase_03 WA -
testcase_04 AC 36 ms
53,452 KB
testcase_05 WA -
testcase_06 AC 36 ms
53,452 KB
testcase_07 AC 39 ms
53,452 KB
testcase_08 WA -
testcase_09 AC 36 ms
53,452 KB
testcase_10 WA -
testcase_11 AC 88 ms
75,576 KB
testcase_12 AC 86 ms
75,644 KB
testcase_13 AC 89 ms
75,664 KB
testcase_14 AC 83 ms
75,636 KB
testcase_15 AC 85 ms
75,640 KB
testcase_16 AC 84 ms
75,660 KB
testcase_17 AC 77 ms
75,552 KB
testcase_18 AC 36 ms
53,452 KB
testcase_19 AC 36 ms
53,452 KB
testcase_20 AC 38 ms
53,452 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 36 ms
53,452 KB
testcase_24 AC 35 ms
53,452 KB
testcase_25 AC 50 ms
64,132 KB
testcase_26 AC 50 ms
64,128 KB
testcase_27 AC 49 ms
64,132 KB
testcase_28 AC 50 ms
64,132 KB
testcase_29 AC 49 ms
64,132 KB
testcase_30 AC 52 ms
64,132 KB
testcase_31 AC 53 ms
64,144 KB
testcase_32 AC 101 ms
75,676 KB
testcase_33 AC 97 ms
75,676 KB
testcase_34 AC 98 ms
75,676 KB
testcase_35 AC 98 ms
75,672 KB
testcase_36 AC 37 ms
53,452 KB
testcase_37 WA -
testcase_38 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# 嘘解法

# 適当に組み合わせて、嘘貪欲

INF = 10 ** 9

N, D = map(int, input().split())
PQs = [tuple(map(int, input().split())) for _ in range(N)]

answer = -INF
for i in range(N):
    P1, Q1 = PQs[i]
    for j in range(i + 1, N):
        P2, Q2 = PQs[j]
        delta = -P1+Q1-P2+Q2
        tmp = 0
        tmp = min(-P1, -P1+Q1-P2)
        v = delta * ((D - 1) // 2)
        D -= 1
        D %= 2
        D += 1
        for i in range(D):
            if i % 2 == 0:
                P, Q = P1, Q1
            else:
                P, Q = P2, Q2
            v -= P
            tmp = min(tmp, v)
            v += Q
        answer = max(answer, tmp)
print(answer)
0