結果

問題 No.182 新規性の虜
ユーザー yuki2006yuki2006
提出日時 2015-06-24 17:12:33
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 762 bytes
コンパイル時間 2,306 ms
コンパイル使用メモリ 73,032 KB
実行使用メモリ 65,780 KB
最終ジャッジ日時 2023-09-22 00:32:23
合計ジャッジ時間 13,468 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,844 KB
testcase_01 AC 127 ms
54,196 KB
testcase_02 AC 125 ms
55,736 KB
testcase_03 AC 127 ms
55,716 KB
testcase_04 AC 125 ms
55,708 KB
testcase_05 AC 130 ms
55,552 KB
testcase_06 AC 125 ms
55,772 KB
testcase_07 AC 128 ms
55,892 KB
testcase_08 AC 509 ms
63,020 KB
testcase_09 AC 623 ms
63,688 KB
testcase_10 AC 586 ms
63,000 KB
testcase_11 AC 585 ms
61,212 KB
testcase_12 AC 409 ms
61,092 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 123 ms
55,796 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 128 ms
55,924 KB
testcase_24 AC 581 ms
65,780 KB
testcase_25 AC 474 ms
61,544 KB
testcase_26 AC 284 ms
59,924 KB
testcase_27 AC 129 ms
55,716 KB
evil01.txt AC 663 ms
66,896 KB
evil02.txt AC 675 ms
67,536 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.HashSet;
import java.util.Scanner;

public class Main {
    public static int solve(int[] A){
        int count = 0;
        HashSet<Integer> cheack = new HashSet<Integer>();
        
        for(int now : A){
            if (!cheack.contains(now)) {
                cheack.add(now);
                count++;
            }
            else {
                 count--;
            }
        }
        
        if(count > 0) return count; else return 0;
    }
    
    public static void main(String[] args){
        Scanner S = new Scanner(System.in);
        int N = S.nextInt();
        int A[] = new int[N];

        for (int i = 0; i < N; i++) {
            A[i] = S.nextInt();
        }
        
        System.out.println(solve(A));
    }
}
0