結果

問題 No.1563 Same Degree
ユーザー simansiman
提出日時 2021-06-27 10:49:11
言語 Ruby
(3.3.0)
結果
AC  
実行時間 323 ms / 2,000 ms
コード長 274 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 11,320 KB
実行使用メモリ 17,212 KB
最終ジャッジ日時 2023-09-07 17:19:16
合計ジャッジ時間 4,472 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,056 KB
testcase_01 AC 202 ms
15,224 KB
testcase_02 AC 192 ms
15,368 KB
testcase_03 AC 194 ms
15,152 KB
testcase_04 AC 198 ms
15,424 KB
testcase_05 AC 200 ms
15,180 KB
testcase_06 AC 182 ms
15,412 KB
testcase_07 AC 182 ms
15,220 KB
testcase_08 AC 183 ms
15,236 KB
testcase_09 AC 184 ms
15,420 KB
testcase_10 AC 186 ms
15,412 KB
testcase_11 AC 119 ms
17,172 KB
testcase_12 AC 158 ms
17,024 KB
testcase_13 AC 289 ms
17,212 KB
testcase_14 AC 323 ms
17,100 KB
testcase_15 AC 238 ms
17,024 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

T = gets.to_i

T.times do
  n, m = gets.split.map(&:to_i)
  counter = Array.new(n, 0)

  m.times do
    u, v = gets.split.map(&:to_i)
    counter[u - 1] += 1
    counter[v - 1] += 1
  end

  if counter.size != counter.uniq.size
    puts 'Yes'
  else
    puts 'No'
  end
end
0