結果
問題 |
No.24 数当てゲーム
|
ユーザー |
|
提出日時 | 2021-05-30 11:47:42 |
言語 | Swift (6.0.3) |
結果 |
AC
|
実行時間 | 10 ms / 5,000 ms |
コード長 | 365 bytes |
コンパイル時間 | 11,132 ms |
コンパイル使用メモリ | 132,808 KB |
実行使用メモリ | 9,344 KB |
最終ジャッジ日時 | 2024-11-08 20:41:21 |
合計ジャッジ時間 | 12,010 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
let N = Int(readLine()!)! var numArr = [0,0,0,0,0,0,0,0,0,0] for _ in 1...N{ let hintArr = readLine()!.split(separator:" ") for i in hintArr[0...3]{ if hintArr[4] == "YES"{ numArr[Int(i)!] += 1 }else{ numArr[Int(i)!] -= 1 } } } let max = numArr.max()! let index = numArr.firstIndex(of: max)! print(index)