結果
| 問題 | No.182 新規性の虜 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-08-09 23:28:35 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 509 bytes |
| 記録 | |
| コンパイル時間 | 3,481 ms |
| コンパイル使用メモリ | 82,844 KB |
| 実行使用メモリ | 56,884 KB |
| 最終ジャッジ日時 | 2026-04-01 22:32:54 |
| 合計ジャッジ時間 | 11,311 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 RE * 1 |
| other | AC * 7 RE * 20 |
ソースコード
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;
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++;
}
return count;
}
}