結果

問題 No.516 赤と青の風船
コンテスト
ユーザー kazu116
提出日時 2019-05-22 17:04:00
言語 Swift
(6.2.4)
コンパイル:
swiftc _filename_ -Ounchecked -o a.out
実行:
./a.out
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 197 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 773 ms
コンパイル使用メモリ 134,508 KB
実行使用メモリ 9,472 KB
最終ジャッジ日時 2026-05-24 05:36:59
合計ジャッジ時間 1,490 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 6
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.swift:2:5: warning: immutable value 'i' was never used; consider replacing with '_' or removing it [#no-usage]
 1 | var count:Int = 0
 2 | for i in 0 ... 2 {
   |     `- warning: immutable value 'i' was never used; consider replacing with '_' or removing it [#no-usage]
 3 |     let input:[String] = readLine()!.map{String($0)}
 4 |     if input[0] == "R" {

ソースコード

diff #
raw source code

var count:Int = 0
for i in 0 ... 2 {
    let input:[String] = readLine()!.map{String($0)}
    if input[0] == "R" {
        count += 1
    }
}

let output = count >= 2 ? "RED" : "BLUE"
print(output)
0