結果
| 問題 | No.977 アリス仕掛けの摩天楼 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-02-11 21:41:18 |
| 言語 | Ruby (4.0.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 406 bytes |
| 記録 | |
| コンパイル時間 | 244 ms |
| コンパイル使用メモリ | 9,088 KB |
| 実行使用メモリ | 19,872 KB |
| 最終ジャッジ日時 | 2026-04-17 08:38:00 |
| 合計ジャッジ時間 | 3,315 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 WA * 9 |
コンパイルメッセージ
Syntax OK
ソースコード
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