結果

問題 No.2353 Guardian Dogs in Spring
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2023-06-16 21:35:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 508 bytes
コンパイル時間 1,361 ms
コンパイル使用メモリ 86,724 KB
実行使用メモリ 78,796 KB
最終ジャッジ日時 2023-09-06 18:52:58
合計ジャッジ時間 11,815 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
70,992 KB
testcase_01 AC 73 ms
70,972 KB
testcase_02 AC 75 ms
70,932 KB
testcase_03 AC 72 ms
71,052 KB
testcase_04 AC 75 ms
70,844 KB
testcase_05 AC 106 ms
77,472 KB
testcase_06 AC 106 ms
78,728 KB
testcase_07 AC 106 ms
78,636 KB
testcase_08 AC 108 ms
78,652 KB
testcase_09 AC 108 ms
78,320 KB
testcase_10 AC 111 ms
78,504 KB
testcase_11 AC 112 ms
78,644 KB
testcase_12 AC 111 ms
78,636 KB
testcase_13 AC 111 ms
78,160 KB
testcase_14 AC 75 ms
71,060 KB
testcase_15 AC 118 ms
78,388 KB
testcase_16 AC 113 ms
78,616 KB
testcase_17 AC 112 ms
78,796 KB
testcase_18 AC 116 ms
78,264 KB
testcase_19 AC 109 ms
78,644 KB
testcase_20 AC 71 ms
71,156 KB
testcase_21 AC 96 ms
76,616 KB
testcase_22 AC 108 ms
77,756 KB
testcase_23 AC 112 ms
78,400 KB
testcase_24 AC 91 ms
76,340 KB
testcase_25 AC 88 ms
76,568 KB
testcase_26 AC 79 ms
75,244 KB
testcase_27 AC 74 ms
70,852 KB
testcase_28 AC 96 ms
76,648 KB
testcase_29 AC 109 ms
78,052 KB
testcase_30 AC 108 ms
77,700 KB
testcase_31 AC 115 ms
78,344 KB
testcase_32 AC 111 ms
78,416 KB
testcase_33 AC 112 ms
78,304 KB
testcase_34 AC 117 ms
78,220 KB
testcase_35 AC 116 ms
78,228 KB
testcase_36 AC 96 ms
76,544 KB
testcase_37 AC 83 ms
75,044 KB
testcase_38 AC 107 ms
77,828 KB
testcase_39 AC 106 ms
78,024 KB
testcase_40 AC 109 ms
78,256 KB
testcase_41 AC 112 ms
78,060 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from sys import stdin

N = int(stdin.readline())

dic = {}
xlis = []

for i in range(N):

    x,y = map(int,stdin.readline().split())

    if x not in dic:
        dic[x] = []
        xlis.append(x)
    
    dic[x].append( (y,i+1) )

wait = None
ans = []

xlis.sort()

for x in xlis:

    dic[x].sort()

    for y,i in dic[x]:
        if wait != None:
            ans.append( (wait,i) )
            wait = None
        else:
            wait = i

print (len(ans))
for i,j in ans:
    print (i,j)
0