結果
| 問題 |
No.516 赤と青の風船
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-08-30 05:35:13 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 92 ms / 2,000 ms |
| コード長 | 309 bytes |
| コンパイル時間 | 350 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 12,416 KB |
| 最終ジャッジ日時 | 2024-11-06 12:53:09 |
| 合計ジャッジ時間 | 2,023 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 6 |
コンパイルメッセージ
Syntax OK
ソースコード
def countColor(lines:, color:) count = 0 lines.each do |line| if line == color count += 1 end end return count end lines = [] i = 0 while i < 3 lines[i] = gets.chomp i += 1 end if countColor(lines: lines, color: "RED") > countColor(lines: lines, color: "BLUE") puts "RED" else puts "BLUE" end