結果

問題 No.977 アリス仕掛けの摩天楼
ユーザー TomoProgTomoProg
提出日時 2020-02-11 21:41:18
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 406 bytes
コンパイル時間 138 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 21,320 KB
最終ジャッジ日時 2024-04-08 15:50:33
合計ジャッジ時間 4,514 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
16,256 KB
testcase_01 AC 83 ms
16,256 KB
testcase_02 AC 84 ms
16,256 KB
testcase_03 WA -
testcase_04 AC 83 ms
16,256 KB
testcase_05 AC 87 ms
16,256 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 85 ms
16,256 KB
testcase_09 AC 86 ms
16,256 KB
testcase_10 AC 86 ms
16,256 KB
testcase_11 AC 86 ms
16,256 KB
testcase_12 AC 85 ms
16,256 KB
testcase_13 WA -
testcase_14 AC 102 ms
16,896 KB
testcase_15 AC 101 ms
16,896 KB
testcase_16 WA -
testcase_17 AC 101 ms
16,896 KB
testcase_18 WA -
testcase_19 AC 135 ms
17,732 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 273 ms
21,320 KB
testcase_24 AC 260 ms
21,320 KB
testcase_25 AC 271 ms
21,320 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

island_num = gets.to_i
bridge_num = island_num - 1
island_with_bridge = (0...island_num).inject({}) { |result, i| result[i] = 0; result }
bridge_num.times do
  islands = gets.split
  island_with_bridge[islands[0].to_i] += 1
  island_with_bridge[islands[1].to_i] += 1
end

if island_with_bridge.values.find { |v| v == 0 } && island_with_bridge.values.find { |v| v == 1 }
  puts "Alice"
else
  puts "Bob"
end
0