結果

問題 No.2353 Guardian Dogs in Spring
ユーザー simansiman
提出日時 2023-06-18 18:52:56
言語 Ruby
(3.3.0)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 213 bytes
コンパイル時間 80 ms
コンパイル使用メモリ 11,544 KB
実行使用メモリ 16,072 KB
最終ジャッジ日時 2023-09-08 14:59:04
合計ジャッジ時間 10,905 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,068 KB
testcase_01 AC 78 ms
15,136 KB
testcase_02 AC 77 ms
15,116 KB
testcase_03 AC 82 ms
15,136 KB
testcase_04 AC 80 ms
15,288 KB
testcase_05 AC 115 ms
15,876 KB
testcase_06 AC 114 ms
15,808 KB
testcase_07 AC 113 ms
15,784 KB
testcase_08 AC 115 ms
16,032 KB
testcase_09 AC 118 ms
15,896 KB
testcase_10 AC 120 ms
16,012 KB
testcase_11 AC 125 ms
15,840 KB
testcase_12 AC 127 ms
15,888 KB
testcase_13 AC 114 ms
16,008 KB
testcase_14 AC 84 ms
15,348 KB
testcase_15 AC 128 ms
16,008 KB
testcase_16 AC 125 ms
16,072 KB
testcase_17 AC 125 ms
15,948 KB
testcase_18 AC 125 ms
15,772 KB
testcase_19 AC 131 ms
16,068 KB
testcase_20 AC 83 ms
15,024 KB
testcase_21 AC 92 ms
15,352 KB
testcase_22 AC 101 ms
15,604 KB
testcase_23 AC 121 ms
15,724 KB
testcase_24 AC 86 ms
15,156 KB
testcase_25 AC 84 ms
15,240 KB
testcase_26 AC 82 ms
15,168 KB
testcase_27 AC 83 ms
15,172 KB
testcase_28 AC 91 ms
15,240 KB
testcase_29 AC 106 ms
15,572 KB
testcase_30 AC 99 ms
15,468 KB
testcase_31 AC 110 ms
15,412 KB
testcase_32 AC 127 ms
15,716 KB
testcase_33 AC 118 ms
15,808 KB
testcase_34 AC 120 ms
16,072 KB
testcase_35 AC 119 ms
16,004 KB
testcase_36 AC 89 ms
15,144 KB
testcase_37 AC 82 ms
15,184 KB
testcase_38 AC 88 ms
15,468 KB
testcase_39 AC 90 ms
15,368 KB
testcase_40 AC 99 ms
15,368 KB
testcase_41 AC 100 ms
15,688 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
P = N.times.map { |i| gets.split.map(&:to_i) + [i] }

P.sort_by! { |x, y| [x, y] }
ans = []

while P.size >= 2
  u, v = P.shift(2)

  ans << "#{u.last + 1} #{v.last + 1}"
end

puts ans.size
puts ans
0