結果
| 問題 |
No.2353 Guardian Dogs in Spring
|
| コンテスト | |
| ユーザー |
👑 SPD_9X2
|
| 提出日時 | 2023-06-16 21:35:02 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 89 ms / 2,000 ms |
| コード長 | 508 bytes |
| コンパイル時間 | 307 ms |
| コンパイル使用メモリ | 81,976 KB |
| 実行使用メモリ | 78,008 KB |
| 最終ジャッジ日時 | 2024-06-24 13:14:52 |
| 合計ジャッジ時間 | 8,126 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 40 |
ソースコード
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)
SPD_9X2