結果

問題 No.2353 Guardian Dogs in Spring
ユーザー FromBooskaFromBooska
提出日時 2023-06-17 14:58:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 143 ms / 2,000 ms
コード長 692 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 87,004 KB
実行使用メモリ 79,108 KB
最終ジャッジ日時 2023-09-07 11:22:08
合計ジャッジ時間 11,034 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,376 KB
testcase_01 AC 75 ms
71,248 KB
testcase_02 AC 72 ms
71,148 KB
testcase_03 AC 73 ms
71,152 KB
testcase_04 AC 74 ms
71,144 KB
testcase_05 AC 124 ms
78,104 KB
testcase_06 AC 126 ms
78,436 KB
testcase_07 AC 123 ms
78,396 KB
testcase_08 AC 123 ms
78,180 KB
testcase_09 AC 143 ms
79,108 KB
testcase_10 AC 139 ms
78,812 KB
testcase_11 AC 132 ms
78,180 KB
testcase_12 AC 134 ms
78,344 KB
testcase_13 AC 127 ms
78,276 KB
testcase_14 AC 77 ms
71,208 KB
testcase_15 AC 143 ms
78,668 KB
testcase_16 AC 137 ms
78,600 KB
testcase_17 AC 134 ms
78,600 KB
testcase_18 AC 137 ms
78,736 KB
testcase_19 AC 137 ms
78,500 KB
testcase_20 AC 77 ms
71,288 KB
testcase_21 AC 109 ms
77,892 KB
testcase_22 AC 124 ms
78,240 KB
testcase_23 AC 137 ms
78,744 KB
testcase_24 AC 107 ms
77,656 KB
testcase_25 AC 105 ms
76,944 KB
testcase_26 AC 90 ms
75,456 KB
testcase_27 AC 77 ms
71,352 KB
testcase_28 AC 114 ms
78,100 KB
testcase_29 AC 131 ms
78,292 KB
testcase_30 AC 127 ms
78,336 KB
testcase_31 AC 127 ms
78,208 KB
testcase_32 AC 138 ms
78,744 KB
testcase_33 AC 126 ms
78,468 KB
testcase_34 AC 126 ms
78,632 KB
testcase_35 AC 125 ms
78,388 KB
testcase_36 AC 114 ms
77,740 KB
testcase_37 AC 93 ms
75,000 KB
testcase_38 AC 120 ms
78,328 KB
testcase_39 AC 118 ms
78,160 KB
testcase_40 AC 120 ms
78,032 KB
testcase_41 AC 121 ms
78,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 全角度があるのか、それでは二部マッチング、最大流問題、フォード・ファルカーソン
# それともABC248Eのような線上に点を分類するのか
# 近い順にマッチングはダメ、たとえば直線状に1, 4, 5, 10の場合
# 実は単純に並べて番号を付けてマッチングさせればいいだけ
# 図を描くとわかる

N = int(input())
XY = []
for i in range(N):
    x, y = map(int, input().split())
    XY.append((x, y, i+1))
    
XY.sort(key = lambda x:(x[0], x[1]))

#print(XY)

ans_list = []
if N%2 == 0:
    length = N
else:
    length = N-1
print(length//2)
for i in range(length//2):
    print(XY[i*2][2], XY[i*2+1][2])
0