結果

問題 No.182 新規性の虜
ユーザー バカらっくバカらっく
提出日時 2018-03-02 11:08:39
言語 Swift
(5.10.0)
結果
AC  
実行時間 170 ms / 5,000 ms
コード長 384 bytes
コンパイル時間 1,717 ms
コンパイル使用メモリ 135,440 KB
実行使用メモリ 14,096 KB
最終ジャッジ日時 2023-08-20 10:23:22
合計ジャッジ時間 5,295 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
8,236 KB
testcase_01 AC 3 ms
8,184 KB
testcase_02 AC 4 ms
8,164 KB
testcase_03 AC 3 ms
8,236 KB
testcase_04 AC 4 ms
8,284 KB
testcase_05 AC 3 ms
8,184 KB
testcase_06 AC 3 ms
8,164 KB
testcase_07 AC 4 ms
8,184 KB
testcase_08 AC 104 ms
10,064 KB
testcase_09 AC 170 ms
14,096 KB
testcase_10 AC 146 ms
14,056 KB
testcase_11 AC 121 ms
10,656 KB
testcase_12 AC 53 ms
8,864 KB
testcase_13 AC 4 ms
8,148 KB
testcase_14 AC 3 ms
8,140 KB
testcase_15 AC 4 ms
8,220 KB
testcase_16 AC 4 ms
8,240 KB
testcase_17 AC 3 ms
8,184 KB
testcase_18 AC 92 ms
13,732 KB
testcase_19 AC 66 ms
10,000 KB
testcase_20 AC 41 ms
9,012 KB
testcase_21 AC 102 ms
12,872 KB
testcase_22 AC 51 ms
9,436 KB
testcase_23 AC 3 ms
8,288 KB
testcase_24 AC 127 ms
13,400 KB
testcase_25 AC 61 ms
12,256 KB
testcase_26 AC 25 ms
8,436 KB
testcase_27 AC 4 ms
8,232 KB
evil01.txt AC 190 ms
13,204 KB
evil02.txt AC 189 ms
13,684 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

let inputCount = Int(readLine()!)!

let numList = readLine()!.split(separator: " ").map{Int($0)!}.sorted()

var ans = 0
for i in 0..<numList.count {
    var isUnq = true
    if( i > 0 && numList[i-1] == numList[i]) {
        isUnq = false
    }
    if(i < numList.count-1 && numList[i] == numList[i+1]) {
        isUnq = false
    }
    if(isUnq) {
        ans+=1
    }
}

print(ans)
0