結果

問題 No.182 新規性の虜
ユーザー 👑 はまやんはまやんはまやんはまやん
提出日時 2015-06-24 15:10:35
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 617 bytes
コンパイル時間 3,842 ms
コンパイル使用メモリ 73,088 KB
実行使用メモリ 64,920 KB
最終ジャッジ日時 2023-09-22 00:29:38
合計ジャッジ時間 33,275 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
57,884 KB
testcase_01 AC 128 ms
53,788 KB
testcase_02 AC 129 ms
55,712 KB
testcase_03 AC 129 ms
55,964 KB
testcase_04 AC 129 ms
55,684 KB
testcase_05 AC 135 ms
55,884 KB
testcase_06 AC 130 ms
55,616 KB
testcase_07 AC 132 ms
55,636 KB
testcase_08 AC 2,308 ms
64,572 KB
testcase_09 TLE -
testcase_10 AC 4,095 ms
64,528 KB
testcase_11 AC 3,003 ms
64,372 KB
testcase_12 AC 871 ms
58,888 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 126 ms
55,524 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 126 ms
56,008 KB
testcase_24 TLE -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
evil01.txt -- -
evil02.txt -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

package coder;

import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static int solve(int[] A){
		int count = 0;
		ArrayList<Integer> cheack = new ArrayList<Integer>();
		
		for(int now : A){
			if (cheack.contains(now)) {
				count--;
				continue;
			}
			else {
				cheack.add(now);
				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