結果

問題 No.2353 Guardian Dogs in Spring
ユーザー flygonflygon
提出日時 2023-06-16 22:16:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 588 bytes
コンパイル時間 1,028 ms
コンパイル使用メモリ 86,976 KB
実行使用メモリ 79,972 KB
最終ジャッジ日時 2023-09-06 20:21:24
合計ジャッジ時間 10,427 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
77,340 KB
testcase_01 AC 87 ms
77,048 KB
testcase_02 AC 86 ms
77,368 KB
testcase_03 AC 92 ms
77,236 KB
testcase_04 AC 92 ms
77,144 KB
testcase_05 AC 118 ms
78,224 KB
testcase_06 AC 109 ms
77,916 KB
testcase_07 AC 108 ms
78,028 KB
testcase_08 AC 111 ms
78,356 KB
testcase_09 AC 122 ms
79,672 KB
testcase_10 AC 122 ms
79,972 KB
testcase_11 AC 108 ms
78,012 KB
testcase_12 AC 110 ms
78,236 KB
testcase_13 AC 129 ms
79,788 KB
testcase_14 AC 89 ms
77,252 KB
testcase_15 AC 125 ms
79,236 KB
testcase_16 AC 127 ms
79,812 KB
testcase_17 AC 118 ms
79,840 KB
testcase_18 AC 119 ms
79,764 KB
testcase_19 AC 116 ms
79,256 KB
testcase_20 AC 93 ms
77,080 KB
testcase_21 AC 103 ms
78,020 KB
testcase_22 AC 109 ms
78,356 KB
testcase_23 AC 116 ms
79,952 KB
testcase_24 AC 100 ms
77,796 KB
testcase_25 AC 97 ms
78,020 KB
testcase_26 AC 96 ms
77,636 KB
testcase_27 AC 89 ms
77,360 KB
testcase_28 AC 106 ms
78,352 KB
testcase_29 AC 119 ms
79,704 KB
testcase_30 AC 117 ms
78,504 KB
testcase_31 AC 114 ms
78,724 KB
testcase_32 AC 124 ms
79,636 KB
testcase_33 AC 118 ms
79,476 KB
testcase_34 AC 124 ms
79,732 KB
testcase_35 AC 118 ms
79,904 KB
testcase_36 AC 107 ms
78,168 KB
testcase_37 AC 99 ms
77,688 KB
testcase_38 AC 116 ms
78,604 KB
testcase_39 AC 115 ms
78,480 KB
testcase_40 AC 120 ms
78,316 KB
testcase_41 AC 121 ms
79,760 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(5*10**5)
input = sys.stdin.readline
from collections import defaultdict, deque, Counter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
from math import gcd
n = int(input())
xs = [[] for i in range(8050)]
for i in range(n):
    x,y = map(int,input().split())
    xs[x].append((y,i))

ans = []
left = []
for x in range(8050):
    xs[x].sort()
    for y,i in xs[x]:
        if not left:
            left.append(i+1)
        else:
            ans.append([i+1,left.pop()])
    
print(len(ans))
for a,b in ans:
    print(a,b)

0