結果

問題 No.182 新規性の虜
ユーザー k.h
提出日時 2019-08-04 15:58:15
言語 Go
(1.23.4)
結果
RE  
実行時間 -
コード長 335 bytes
コンパイル時間 9,475 ms
コンパイル使用メモリ 229,392 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-08 09:21:54
合計ジャッジ時間 17,925 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25 RE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"fmt"
	"sort"
)

func main() {
	var N, rlt int
	fmt.Scan(&N)
	a := make([]int, N)
	for i := 0; i < N; i++ {
		fmt.Scan(&a[i])
	}
	sort.Ints(a)
	for i := 1; i < N-1; i++ {
		if a[i] != a[i-1] && a[i] != a[i+1] {
			rlt++
		}
	}
	if a[0] != a[1] {
		rlt++
	}
	if a[N-1] != a[N-2] {
		rlt++
	}
	fmt.Println(rlt)
}
0