結果

問題 No.182 新規性の虜
ユーザー k.hk.h
提出日時 2019-08-04 16:00:22
言語 Go
(1.22.1)
結果
RE  
実行時間 -
コード長 379 bytes
コンパイル時間 10,197 ms
コンパイル使用メモリ 200,944 KB
実行使用メモリ 7,948 KB
最終ジャッジ日時 2023-09-22 18:04:30
合計ジャッジ時間 20,536 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 602 ms
5,712 KB
testcase_09 AC 975 ms
7,948 KB
testcase_10 AC 847 ms
7,940 KB
testcase_11 AC 698 ms
7,940 KB
testcase_12 AC 299 ms
5,652 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 RE -
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 451 ms
7,940 KB
testcase_19 AC 320 ms
5,704 KB
testcase_20 AC 194 ms
5,656 KB
testcase_21 AC 517 ms
7,944 KB
testcase_22 AC 250 ms
5,676 KB
testcase_23 RE -
testcase_24 AC 708 ms
7,948 KB
testcase_25 AC 266 ms
7,936 KB
testcase_26 AC 129 ms
4,376 KB
testcase_27 AC 1 ms
4,376 KB
evil01.txt AC 1,148 ms
8,092 KB
evil02.txt AC 1,149 ms
8,084 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"fmt"
	"sort"
)

func main() {
	var N, rlt int
	if N == 1 {
		fmt.Println("1")
		return
	}
	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