結果
問題 |
No.182 新規性の虜
|
ユーザー |
|
提出日時 | 2015-08-09 23:28:35 |
言語 | Java (openjdk 23) |
結果 |
RE
|
実行時間 | - |
コード長 | 509 bytes |
コンパイル時間 | 2,861 ms |
コンパイル使用メモリ | 74,400 KB |
実行使用メモリ | 62,472 KB |
最終ジャッジ日時 | 2024-07-18 06:23:54 |
合計ジャッジ時間 | 12,619 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; } }