結果

問題 No.2353 Guardian Dogs in Spring
ユーザー 👑 timitimi
提出日時 2023-06-16 22:20:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 153 ms / 2,000 ms
コード長 429 bytes
コンパイル時間 420 ms
コンパイル使用メモリ 87,324 KB
実行使用メモリ 82,240 KB
最終ジャッジ日時 2023-09-06 20:29:45
合計ジャッジ時間 11,232 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,604 KB
testcase_01 AC 82 ms
71,752 KB
testcase_02 AC 80 ms
71,808 KB
testcase_03 AC 81 ms
71,788 KB
testcase_04 AC 82 ms
71,628 KB
testcase_05 AC 131 ms
80,440 KB
testcase_06 AC 124 ms
79,096 KB
testcase_07 AC 136 ms
80,384 KB
testcase_08 AC 135 ms
80,464 KB
testcase_09 AC 149 ms
80,588 KB
testcase_10 AC 153 ms
80,876 KB
testcase_11 AC 135 ms
80,416 KB
testcase_12 AC 140 ms
80,648 KB
testcase_13 AC 137 ms
80,004 KB
testcase_14 AC 82 ms
72,096 KB
testcase_15 AC 140 ms
80,232 KB
testcase_16 AC 139 ms
80,164 KB
testcase_17 AC 140 ms
79,968 KB
testcase_18 AC 140 ms
79,984 KB
testcase_19 AC 138 ms
79,764 KB
testcase_20 AC 87 ms
72,060 KB
testcase_21 AC 120 ms
79,984 KB
testcase_22 AC 140 ms
82,196 KB
testcase_23 AC 143 ms
79,416 KB
testcase_24 AC 119 ms
80,040 KB
testcase_25 AC 115 ms
79,960 KB
testcase_26 AC 99 ms
76,748 KB
testcase_27 AC 83 ms
72,232 KB
testcase_28 AC 119 ms
79,640 KB
testcase_29 AC 139 ms
79,456 KB
testcase_30 AC 142 ms
82,196 KB
testcase_31 AC 138 ms
81,908 KB
testcase_32 AC 136 ms
79,700 KB
testcase_33 AC 138 ms
80,172 KB
testcase_34 AC 139 ms
79,980 KB
testcase_35 AC 138 ms
79,848 KB
testcase_36 AC 120 ms
79,828 KB
testcase_37 AC 102 ms
76,900 KB
testcase_38 AC 136 ms
81,796 KB
testcase_39 AC 136 ms
81,956 KB
testcase_40 AC 132 ms
82,240 KB
testcase_41 AC 137 ms
82,088 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
D={};E=[]
for i in range(N):
  x,y=map(int, input().split())
  if y not in D:
    E.append(y)
    D[y]=[]
  D[y].append([x,i+1])

ans=[];f=0
E=sorted(E)[::-1]
F=[]
from collections import deque
d=deque()
for e in E:
  A=D[e]
  A=sorted(A)[::-1]
  for a,b in A:
    d.append((a,b))

s=len(d)//2 
for i in range(s):
  _,x=d.popleft()
  _,y=d.popleft()
  ans.append((x,y))
print(len(ans))
for x,y in ans:
  print(x,y)
0