結果

問題 No.2353 Guardian Dogs in Spring
ユーザー ニックネームニックネーム
提出日時 2023-06-16 22:59:52
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 353 bytes
コンパイル時間 626 ms
コンパイル使用メモリ 86,816 KB
実行使用メモリ 79,212 KB
最終ジャッジ日時 2023-09-06 21:44:53
合計ジャッジ時間 25,661 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,224 KB
testcase_01 AC 70 ms
71,320 KB
testcase_02 AC 70 ms
71,216 KB
testcase_03 AC 69 ms
71,332 KB
testcase_04 AC 70 ms
71,092 KB
testcase_05 AC 451 ms
77,928 KB
testcase_06 AC 503 ms
78,008 KB
testcase_07 AC 554 ms
78,044 KB
testcase_08 AC 552 ms
78,004 KB
testcase_09 AC 566 ms
78,936 KB
testcase_10 AC 643 ms
79,036 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 626 ms
78,528 KB
testcase_14 WA -
testcase_15 AC 1,049 ms
78,704 KB
testcase_16 AC 1,051 ms
78,888 KB
testcase_17 AC 1,043 ms
78,536 KB
testcase_18 WA -
testcase_19 AC 1,032 ms
78,868 KB
testcase_20 AC 90 ms
76,216 KB
testcase_21 AC 157 ms
77,688 KB
testcase_22 AC 290 ms
78,480 KB
testcase_23 AC 818 ms
78,516 KB
testcase_24 AC 151 ms
77,864 KB
testcase_25 AC 139 ms
77,712 KB
testcase_26 AC 124 ms
77,236 KB
testcase_27 AC 90 ms
75,808 KB
testcase_28 AC 165 ms
77,928 KB
testcase_29 AC 471 ms
78,652 KB
testcase_30 AC 297 ms
78,404 KB
testcase_31 AC 394 ms
78,784 KB
testcase_32 AC 828 ms
78,480 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 142 ms
77,940 KB
testcase_37 AC 110 ms
76,948 KB
testcase_38 WA -
testcase_39 AC 177 ms
77,896 KB
testcase_40 WA -
testcase_41 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
xy = [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