結果

問題 No.182 新規性の虜
ユーザー rf141rf141
提出日時 2015-08-09 23:33:04
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 564 bytes
コンパイル時間 3,253 ms
コンパイル使用メモリ 72,056 KB
実行使用メモリ 63,032 KB
最終ジャッジ日時 2023-09-25 07:45:55
合計ジャッジ時間 13,999 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,884 KB
testcase_01 AC 124 ms
56,108 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 129 ms
56,080 KB
testcase_17 RE -
testcase_18 AC 511 ms
60,544 KB
testcase_19 AC 438 ms
60,312 KB
testcase_20 AC 380 ms
60,492 KB
testcase_21 AC 508 ms
60,840 KB
testcase_22 AC 391 ms
60,496 KB
testcase_23 RE -
testcase_24 RE -
testcase_25 AC 454 ms
60,648 KB
testcase_26 RE -
testcase_27 RE -
evil01.txt RE -
evil02.txt RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Novelty2{
	public static void main(String... args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		System.out.println(counter(n,scan));
	}
	public static int counter(int n,Scanner scan){
		int[] list = new int[n];
		for(int i = 0; i < n; i++){
			list[i] = scan.nextInt();
		}
		Arrays.sort(list);
		int count=0;
		int c=0;
		if(list[0]!=list[1])count++;
		for(int i = 1; i < n; i++){
			if(list[i]!=list[i-1] && list[i]!=list[i+1]){
				count++;
				c=0;
			}else{
				continue;
			}
		}
		return count;
	}
}
0