結果
| 問題 | No.182 新規性の虜 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-08-09 23:33:04 |
| 言語 | Java (openjdk 23) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 564 bytes |
| 記録 | |
| コンパイル時間 | 3,279 ms |
| コンパイル使用メモリ | 74,948 KB |
| 実行使用メモリ | 59,876 KB |
| 最終ジャッジ日時 | 2024-07-18 06:24:13 |
| 合計ジャッジ時間 | 13,145 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
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;
}
}