結果
| 問題 | No.182 新規性の虜 |
| コンテスト | |
| ユーザー |
37zigen
|
| 提出日時 | 2016-03-31 13:35:04 |
| 言語 | Java (openjdk 26.0.2.1 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 555 bytes |
| 記録 | |
| コンパイル時間 | 1,410 ms |
| コンパイル使用メモリ | 89,832 KB |
| 実行使用メモリ | 52,212 KB |
| 最終ジャッジ日時 | 2026-09-08 18:33:46 |
| 合計ジャッジ時間 | 9,817 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 14 WA * 13 |
ソースコード
package yukicoder182;
import java.util.PriorityQueue;
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
PriorityQueue<Integer> pq=new PriorityQueue<>(n);
for(int i=0;i<n;i++){
pq.add(sc.nextInt());
}
int count=1;
int memo=pq.poll();
while(!pq.isEmpty()){
int t=pq.poll();
if(t!=memo){
count++;
memo=t;
}else{
count--;
while(t==memo&&!pq.isEmpty()){
memo=pq.poll();
}
}
}
System.out.println(count);
}
}
37zigen