結果

問題 No.239 にゃんぱすー
ユーザー バカらっくバカらっく
提出日時 2018-03-01 14:26:28
言語 Swift
(5.10.0)
結果
WA  
実行時間 -
コード長 591 bytes
コンパイル時間 4,677 ms
コンパイル使用メモリ 129,292 KB
実行使用メモリ 8,560 KB
最終ジャッジ日時 2023-08-20 10:21:25
合計ジャッジ時間 3,092 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
7,788 KB
testcase_01 AC 3 ms
7,724 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 4 ms
7,704 KB
testcase_05 WA -
testcase_06 AC 3 ms
7,804 KB
testcase_07 AC 4 ms
7,740 KB
testcase_08 AC 4 ms
7,848 KB
testcase_09 WA -
testcase_10 AC 4 ms
7,728 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 4 ms
7,816 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 9 ms
8,012 KB
testcase_21 WA -
testcase_22 AC 10 ms
8,080 KB
testcase_23 AC 11 ms
8,124 KB
testcase_24 AC 12 ms
8,400 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 4 ms
7,748 KB
testcase_28 AC 4 ms
7,848 KB
testcase_29 WA -
testcase_30 AC 6 ms
7,916 KB
testcase_31 AC 6 ms
7,876 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 10 ms
8,096 KB
testcase_35 WA -
testcase_36 AC 13 ms
8,328 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.swift:5:5: warning: immutable value 'i' was never used; consider replacing with '_' or removing it
for i in 0..<murabito {
    ^
    _
Main.swift:33:11: warning: expression implicitly coerced from 'Int?' to 'Any'
    print(ans)
          ^~~
Main.swift:33:11: note: provide a default value to avoid this warning
    print(ans)
          ^~~
              ?? <#default value#>
Main.swift:33:11: note: force-unwrap the value to avoid this warning
    print(ans)
          ^~~
             !
Main.swift:33:11: note: explicitly cast to 'Any' with 'as Any' to silence this warning
    print(ans)
          ^~~
              as Any

ソースコード

diff #

let murabito = Int(readLine()!)!

var map = [[String]]()

for i in 0..<murabito {
        map.append(readLine()!.split(separator:" ").map(String.init))
}

var ans:Int? = nil
for i in 0..<murabito {
    var isNyan = true
    for j in 0..<murabito {
        if(map[j][i]=="nyanpass" || map[j][i] == "-") {
            
        } else {
            isNyan = false
            break
        }
    }
    if(isNyan) {
        if(ans == nil) {
            ans = i+1
        } else {
            ans = nil
            break
        }
    }
}

if(ans == nil) {
    print(-1)
} else {
    print(ans)
}
0