結果

問題 No.182 新規性の虜
ユーザー k.hk.h
提出日時 2019-08-04 15:58:15
言語 Go
(1.22.1)
結果
RE  
実行時間 -
コード長 335 bytes
コンパイル時間 12,697 ms
コンパイル使用メモリ 209,404 KB
実行使用メモリ 7,948 KB
最終ジャッジ日時 2023-09-22 18:02:15
合計ジャッジ時間 22,232 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 598 ms
5,716 KB
testcase_09 AC 974 ms
7,948 KB
testcase_10 AC 846 ms
7,940 KB
testcase_11 AC 699 ms
7,944 KB
testcase_12 AC 291 ms
5,656 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 RE -
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 451 ms
7,944 KB
testcase_19 AC 322 ms
5,700 KB
testcase_20 AC 195 ms
5,660 KB
testcase_21 AC 519 ms
7,940 KB
testcase_22 AC 250 ms
5,676 KB
testcase_23 RE -
testcase_24 AC 706 ms
7,932 KB
testcase_25 AC 268 ms
7,936 KB
testcase_26 AC 127 ms
4,376 KB
testcase_27 AC 1 ms
4,380 KB
evil01.txt AC 1,148 ms
8,092 KB
evil02.txt AC 1,149 ms
8,088 KB
権限があれば一括ダウンロードができます

ソースコード

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