結果
| 問題 |
No.239 にゃんぱすー
|
| コンテスト | |
| ユーザー |
バカらっく
|
| 提出日時 | 2018-03-01 14:26:28 |
| 言語 | Swift (6.0.3) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 591 bytes |
| コンパイル時間 | 1,018 ms |
| コンパイル使用メモリ | 127,028 KB |
| 実行使用メモリ | 9,856 KB |
| 最終ジャッジ日時 | 2024-11-30 12:00:05 |
| 合計ジャッジ時間 | 2,486 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 2 |
| other | AC * 16 WA * 17 |
コンパイルメッセージ
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
ソースコード
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)
}
バカらっく