結果

問題 No.2353 Guardian Dogs in Spring
ユーザー vwxyzvwxyz
提出日時 2023-07-17 18:45:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 930 bytes
コンパイル時間 1,171 ms
コンパイル使用メモリ 11,868 KB
実行使用メモリ 12,744 KB
最終ジャッジ日時 2023-10-18 00:33:40
合計ジャッジ時間 9,346 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
11,188 KB
testcase_01 AC 41 ms
11,188 KB
testcase_02 AC 39 ms
11,188 KB
testcase_03 AC 39 ms
11,188 KB
testcase_04 AC 39 ms
11,188 KB
testcase_05 AC 56 ms
12,520 KB
testcase_06 AC 56 ms
12,520 KB
testcase_07 AC 57 ms
12,692 KB
testcase_08 AC 56 ms
12,736 KB
testcase_09 AC 55 ms
12,512 KB
testcase_10 AC 59 ms
12,744 KB
testcase_11 AC 58 ms
12,736 KB
testcase_12 AC 59 ms
12,692 KB
testcase_13 AC 56 ms
12,692 KB
testcase_14 AC 39 ms
11,208 KB
testcase_15 AC 60 ms
12,692 KB
testcase_16 AC 60 ms
12,692 KB
testcase_17 AC 61 ms
12,692 KB
testcase_18 AC 60 ms
12,692 KB
testcase_19 AC 61 ms
12,692 KB
testcase_20 AC 40 ms
11,224 KB
testcase_21 AC 43 ms
11,572 KB
testcase_22 AC 47 ms
11,940 KB
testcase_23 AC 57 ms
12,612 KB
testcase_24 AC 41 ms
11,540 KB
testcase_25 AC 42 ms
11,500 KB
testcase_26 AC 41 ms
11,420 KB
testcase_27 AC 39 ms
11,224 KB
testcase_28 AC 42 ms
11,632 KB
testcase_29 AC 52 ms
12,232 KB
testcase_30 AC 47 ms
11,944 KB
testcase_31 AC 48 ms
12,064 KB
testcase_32 AC 61 ms
12,628 KB
testcase_33 AC 56 ms
12,708 KB
testcase_34 AC 56 ms
12,712 KB
testcase_35 AC 56 ms
12,692 KB
testcase_36 AC 42 ms
11,664 KB
testcase_37 AC 41 ms
11,432 KB
testcase_38 AC 44 ms
11,820 KB
testcase_39 AC 43 ms
11,844 KB
testcase_40 AC 49 ms
12,092 KB
testcase_41 AC 50 ms
12,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
import copy
import decimal
import fractions
import heapq
import itertools
import math
import random
import sys
import time
from collections import Counter,deque,defaultdict
from functools import lru_cache,reduce
from heapq import heappush,heappop,heapify,heappushpop,_heappop_max,_heapify_max
def _heappush_max(heap,item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap)-1)
def _heappushpop_max(heap, item):
    if heap and item < heap[0]:
        item, heap[0] = heap[0], item
        heapq._siftup_max(heap, 0)
    return item
from math import gcd as GCD
read=sys.stdin.read
readline=sys.stdin.readline
readlines=sys.stdin.readlines
write=sys.stdout.write

N=int(readline())
X,Y=[],[]
for i in range(N):
    x,y=map(int,readline().split())
    X.append(x)
    Y.append(y)
idx=sorted([i for i in range(N)],key=lambda i:(X[i],Y[i]))
print(N//2)
for z,w in zip(idx[::2],idx[1::2]):
    print(z+1,w+1)
0