結果

問題 No.2353 Guardian Dogs in Spring
ユーザー 👑 H20H20
提出日時 2023-06-16 22:47:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 204 ms / 2,000 ms
コード長 423 bytes
コンパイル時間 343 ms
コンパイル使用メモリ 87,116 KB
実行使用メモリ 81,792 KB
最終ジャッジ日時 2023-09-06 21:22:40
合計ジャッジ時間 13,367 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
72,140 KB
testcase_01 AC 105 ms
72,236 KB
testcase_02 AC 104 ms
72,332 KB
testcase_03 AC 105 ms
72,328 KB
testcase_04 AC 103 ms
72,388 KB
testcase_05 AC 172 ms
80,256 KB
testcase_06 AC 166 ms
80,056 KB
testcase_07 AC 165 ms
80,052 KB
testcase_08 AC 168 ms
80,644 KB
testcase_09 AC 172 ms
80,276 KB
testcase_10 AC 175 ms
80,996 KB
testcase_11 AC 188 ms
81,212 KB
testcase_12 AC 191 ms
80,868 KB
testcase_13 AC 170 ms
80,692 KB
testcase_14 AC 110 ms
72,628 KB
testcase_15 AC 204 ms
81,368 KB
testcase_16 AC 200 ms
81,792 KB
testcase_17 AC 196 ms
81,620 KB
testcase_18 AC 198 ms
81,716 KB
testcase_19 AC 194 ms
81,300 KB
testcase_20 AC 109 ms
72,280 KB
testcase_21 AC 148 ms
78,912 KB
testcase_22 AC 171 ms
79,680 KB
testcase_23 AC 187 ms
80,448 KB
testcase_24 AC 147 ms
78,560 KB
testcase_25 AC 138 ms
78,068 KB
testcase_26 AC 128 ms
77,484 KB
testcase_27 AC 108 ms
72,264 KB
testcase_28 AC 151 ms
78,628 KB
testcase_29 AC 181 ms
80,016 KB
testcase_30 AC 174 ms
79,868 KB
testcase_31 AC 177 ms
80,136 KB
testcase_32 AC 192 ms
80,532 KB
testcase_33 AC 172 ms
80,808 KB
testcase_34 AC 168 ms
80,668 KB
testcase_35 AC 171 ms
80,548 KB
testcase_36 AC 151 ms
78,776 KB
testcase_37 AC 128 ms
76,880 KB
testcase_38 AC 155 ms
79,232 KB
testcase_39 AC 161 ms
79,368 KB
testcase_40 AC 163 ms
79,400 KB
testcase_41 AC 162 ms
79,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from functools import cmp_to_key

def f(r1, r2):
    x1, y1,_ = r1
    x2, y2,_ = r2
    if  x2 * y1 - y2 * x1==0:
        return x1-x2
    else:
        return x2 * y1 - y2 * x1




N = int(input())
XY = [list(map(int, input().split())) for _ in range(N)]
XYI = []
for i,(x,y) in enumerate(XY):
    XYI.append([x,y,i+1])

XYI.sort(key = cmp_to_key(f))
print(N//2)
for i in range(N//2):
    print(XYI[i*2][2],XYI[i*2+1][2])
0