結果
| 問題 | No.2353 Guardian Dogs in Spring |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-06-16 23:16:08 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 116 ms / 2,000 ms |
| + 792µs | |
| コード長 | 325 bytes |
| 記録 | |
| コンパイル時間 | 303 ms |
| コンパイル使用メモリ | 21,412 KB |
| 実行使用メモリ | 16,764 KB |
| 最終ジャッジ日時 | 2026-07-29 05:24:04 |
| 合計ジャッジ時間 | 9,111 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 40 |
ソースコード
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)