結果

問題 No.2353 Guardian Dogs in Spring
ユーザー ニックネームニックネーム
提出日時 2023-06-16 23:01:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 361 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 86,660 KB
実行使用メモリ 78,920 KB
最終ジャッジ日時 2023-09-06 21:47:53
合計ジャッジ時間 26,560 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,120 KB
testcase_01 AC 76 ms
70,972 KB
testcase_02 AC 73 ms
70,772 KB
testcase_03 AC 77 ms
71,152 KB
testcase_04 AC 74 ms
71,084 KB
testcase_05 AC 460 ms
77,908 KB
testcase_06 AC 499 ms
77,844 KB
testcase_07 AC 555 ms
77,660 KB
testcase_08 AC 562 ms
77,668 KB
testcase_09 AC 582 ms
78,392 KB
testcase_10 AC 658 ms
78,592 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 90 ms
75,400 KB
testcase_21 AC 151 ms
77,364 KB
testcase_22 AC 251 ms
78,268 KB
testcase_23 WA -
testcase_24 AC 144 ms
77,620 KB
testcase_25 AC 138 ms
77,260 KB
testcase_26 AC 120 ms
76,972 KB
testcase_27 AC 88 ms
75,516 KB
testcase_28 AC 156 ms
77,592 KB
testcase_29 WA -
testcase_30 AC 254 ms
77,784 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 146 ms
77,352 KB
testcase_37 AC 116 ms
76,152 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
xy = sorted([tuple(map(int,input().split())) for _ in range(n)])
f = [False]*n
print(n//2)
for i,(ix,iy) in enumerate(xy):
    if f[i]: continue
    f[i] = True; md = 16001; mj = -1
    for j,(jx,jy) in enumerate(xy):
        d = abs(ix-jx)+abs(iy-jy)
        if not f[j] and d<md: md = d; mj = j
    f[mj] = True
    if mj!=-1: print(i+1,mj+1)
0