結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
バカらっく
|
| 提出日時 | 2018-03-01 14:08:18 |
| 言語 | Swift (6.0.3) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 5,000 ms |
| コード長 | 381 bytes |
| 記録 | |
| コンパイル時間 | 11,503 ms |
| コンパイル使用メモリ | 137,436 KB |
| 実行使用メモリ | 9,856 KB |
| 最終ジャッジ日時 | 2025-10-24 21:05:35 |
| 合計ジャッジ時間 | 11,430 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
コンパイルメッセージ
Main.swift:5:5: warning: immutable value 'i' was never used; consider replacing with '_' or removing it
3 | var cnt = [Int:Int]()
4 | var ans = 0
5 | for i in 1...inputCount {
| `- warning: immutable value 'i' was never used; consider replacing with '_' or removing it
6 | let inpt = readLine()!.split(separator: " ").map{Int($0)!}
7 | for j in 0...inpt.count-1
ソースコード
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)
バカらっく