結果

問題 No.2353 Guardian Dogs in Spring
ユーザー Nikkuniku029Nikkuniku029
提出日時 2023-06-16 23:16:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 54 ms / 2,000 ms
コード長 325 bytes
コンパイル時間 72 ms
コンパイル使用メモリ 10,948 KB
実行使用メモリ 10,640 KB
最終ジャッジ日時 2023-09-06 22:12:47
合計ジャッジ時間 7,051 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,512 KB
testcase_01 AC 17 ms
8,496 KB
testcase_02 AC 18 ms
8,592 KB
testcase_03 AC 19 ms
8,492 KB
testcase_04 AC 17 ms
8,628 KB
testcase_05 AC 47 ms
10,264 KB
testcase_06 AC 48 ms
10,328 KB
testcase_07 AC 48 ms
10,640 KB
testcase_08 AC 48 ms
10,564 KB
testcase_09 AC 50 ms
10,316 KB
testcase_10 AC 48 ms
10,468 KB
testcase_11 AC 49 ms
10,484 KB
testcase_12 AC 54 ms
10,556 KB
testcase_13 AC 49 ms
10,560 KB
testcase_14 AC 18 ms
8,612 KB
testcase_15 AC 52 ms
10,548 KB
testcase_16 AC 52 ms
10,492 KB
testcase_17 AC 52 ms
10,448 KB
testcase_18 AC 52 ms
10,544 KB
testcase_19 AC 52 ms
10,488 KB
testcase_20 AC 18 ms
8,536 KB
testcase_21 AC 24 ms
8,888 KB
testcase_22 AC 33 ms
9,576 KB
testcase_23 AC 47 ms
10,344 KB
testcase_24 AC 23 ms
8,988 KB
testcase_25 AC 22 ms
8,856 KB
testcase_26 AC 21 ms
8,892 KB
testcase_27 AC 18 ms
8,632 KB
testcase_28 AC 24 ms
8,968 KB
testcase_29 AC 39 ms
9,936 KB
testcase_30 AC 34 ms
9,528 KB
testcase_31 AC 37 ms
9,644 KB
testcase_32 AC 49 ms
10,304 KB
testcase_33 AC 48 ms
10,444 KB
testcase_34 AC 49 ms
10,432 KB
testcase_35 AC 48 ms
10,576 KB
testcase_36 AC 25 ms
9,048 KB
testcase_37 AC 22 ms
8,720 KB
testcase_38 AC 29 ms
9,340 KB
testcase_39 AC 29 ms
9,372 KB
testcase_40 AC 36 ms
9,764 KB
testcase_41 AC 38 ms
9,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
Points=[list(map(int,input().split()))+[i+1] for i in range(N)]
Points.sort(key=lambda x:x[1])
Points.sort(key=lambda x:x[0])
res=[]
ans=N//2
from collections import deque
q=deque(Points)
while len(q)>=2:
    _,_,i=q.popleft()
    _,_,j=q.popleft()
    res.append((i,j))
print(ans)
for c in res:
    print(*c)
0