結果
問題 |
No.182 新規性の虜
|
ユーザー |
![]() |
提出日時 | 2016-07-10 18:27:22 |
言語 | Java (openjdk 23) |
結果 |
TLE
|
実行時間 | - |
コード長 | 966 bytes |
コンパイル時間 | 2,247 ms |
コンパイル使用メモリ | 77,172 KB |
実行使用メモリ | 78,412 KB |
最終ジャッジ日時 | 2024-10-13 10:27:07 |
合計ジャッジ時間 | 15,067 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 5 TLE * 2 -- * 20 |
ソースコード
/* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ class Ideone { public static void main (String[] args) throws java.lang.Exception { Scanner sc = new Scanner(System.in); // N(配列数) int n = sc.nextInt(); //System.out.println("n=" + n); List<Integer> list = new ArrayList<Integer>(); int index = 0; while((sc.hasNext()) && (index < n + 1)){ int s = sc.nextInt(); list.add(s); index++; } // ソート Collections.sort(list); // 新規カウント int c = 0 ; int ind = 0; while(ind < list.size()){ int cc = Collections.frequency(list, list.get(ind)); if (cc == 1) { c++; } ind += cc; } System.out.println(c); } }