結果

問題 No.1748 Parking Lot
ユーザー 👑 KazunKazun
提出日時 2021-11-19 21:34:12
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 497 bytes
コンパイル時間 326 ms
コンパイル使用メモリ 86,912 KB
実行使用メモリ 71,476 KB
最終ジャッジ日時 2023-08-30 07:35:37
合計ジャッジ時間 3,109 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,372 KB
testcase_01 AC 73 ms
71,316 KB
testcase_02 AC 73 ms
71,452 KB
testcase_03 AC 72 ms
71,476 KB
testcase_04 AC 75 ms
71,208 KB
testcase_05 AC 71 ms
71,064 KB
testcase_06 AC 73 ms
71,060 KB
testcase_07 AC 73 ms
71,364 KB
testcase_08 AC 72 ms
71,464 KB
testcase_09 AC 73 ms
71,232 KB
testcase_10 AC 73 ms
71,364 KB
testcase_11 AC 74 ms
71,460 KB
testcase_12 AC 73 ms
71,216 KB
testcase_13 AC 73 ms
71,076 KB
testcase_14 AC 73 ms
71,324 KB
testcase_15 AC 72 ms
71,292 KB
testcase_16 AC 72 ms
71,264 KB
testcase_17 AC 72 ms
71,456 KB
testcase_18 AC 73 ms
71,180 KB
testcase_19 AC 73 ms
71,292 KB
testcase_20 AC 74 ms
71,424 KB
testcase_21 AC 74 ms
71,164 KB
testcase_22 AC 73 ms
71,296 KB
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def greedy(N,K):
    X=[0]*(N+1); X[K]=1
    S=[K]

    for _ in range(N-1):
        alpha=-1; I=0
        for k in range(1,N+1):
            if X[k]==1:
                continue

            beta=float("inf")
            for a in S:
                beta=min(beta,abs(k-a))

            if alpha<beta:
                alpha=beta
                I=k

        S.append(I)
    return S

N,K=map(int,input().split())

"""
for K in range(1,N+1):
    print(greedy(N,K))
"""

print(N-1 if K!=N-1 else N)
0