結果

問題 No.29 パワーアップ
ユーザー バカらっく
提出日時 2018-03-01 14:08:18
言語 Swift
(6.0.3)
結果
AC  
実行時間 10 ms / 5,000 ms
コード長 381 bytes
コンパイル時間 4,465 ms
コンパイル使用メモリ 132,220 KB
実行使用メモリ 9,472 KB
最終ジャッジ日時 2024-11-30 11:59:59
合計ジャッジ時間 2,682 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.swift:5:5: warning: immutable value 'i' was never used; consider replacing with '_' or removing it
for i in 1...inputCount {
    ^
    _

ソースコード

diff #

let inputCount = Int(readLine()!)!

var cnt = [Int:Int]()
var ans = 0
for i in 1...inputCount {
    let inpt = readLine()!.split(separator: " ").map{Int($0)!}
    for j in 0...inpt.count-1
    {
        if(cnt[inpt[j]]==nil) {
            cnt[inpt[j]] = 1
        } else {
            ans+=1
            cnt.removeValue(forKey:inpt[j])
        }
    }
}
ans+=cnt.count/4
print(ans)
0