結果
| 問題 | No.182 新規性の虜 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-08-09 23:20:26 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 545 bytes |
| 記録 | |
| コンパイル時間 | 3,206 ms |
| コンパイル使用メモリ | 74,664 KB |
| 実行使用メモリ | 61,324 KB |
| 最終ジャッジ日時 | 2024-07-18 06:23:21 |
| 合計ジャッジ時間 | 12,907 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 27 |
ソースコード
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;
for(int i = 0; i < list.length-1; i++){
if(c>1)continue;
if(list[i]==list[i+1])c++;
if(list[i]!=list[i+1])c=1;
if(c==1)count++;
}
return count;
}
}