結果

問題 No.1519 Diversity
ユーザー simansiman
提出日時 2021-10-01 04:22:10
言語 Ruby
(3.3.0)
結果
AC  
実行時間 171 ms / 2,000 ms
コード長 184 bytes
コンパイル時間 162 ms
コンパイル使用メモリ 11,460 KB
実行使用メモリ 21,456 KB
最終ジャッジ日時 2023-09-25 11:45:13
合計ジャッジ時間 4,232 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,208 KB
testcase_01 AC 84 ms
15,168 KB
testcase_02 AC 82 ms
15,188 KB
testcase_03 AC 117 ms
17,620 KB
testcase_04 AC 150 ms
20,348 KB
testcase_05 AC 82 ms
15,208 KB
testcase_06 AC 168 ms
21,324 KB
testcase_07 AC 86 ms
15,088 KB
testcase_08 AC 97 ms
15,784 KB
testcase_09 AC 114 ms
17,636 KB
testcase_10 AC 136 ms
18,296 KB
testcase_11 AC 83 ms
15,128 KB
testcase_12 AC 163 ms
21,056 KB
testcase_13 AC 171 ms
21,456 KB
testcase_14 AC 167 ms
21,280 KB
testcase_15 AC 166 ms
21,244 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:2: warning: assigned but unused variable - cur
Syntax OK

ソースコード

diff #

N = gets.to_i
cur = 1
edges = []

1.upto(N - 1) do |u|
  (u + 1).upto(N - u + 1) do |v|
    edges << [u, v]
  end
end

puts edges.size
edges.each do |u, v|
  puts "%d %d" % [u, v]
end
0