結果
問題 |
No.185 和風
|
ユーザー |
![]() |
提出日時 | 2015-06-24 15:09:18 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 617 bytes |
コンパイル時間 | 1,819 ms |
コンパイル使用メモリ | 74,592 KB |
実行使用メモリ | 54,924 KB |
最終ジャッジ日時 | 2024-07-07 17:20:53 |
合計ジャッジ時間 | 3,679 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 7 |
ソースコード
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)); } }