結果
問題 | No.29 パワーアップ |
ユーザー |
![]() |
提出日時 | 2016-09-08 23:32:34 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 162 ms / 5,000 ms |
コード長 | 403 bytes |
コンパイル時間 | 4,116 ms |
コンパイル使用メモリ | 74,296 KB |
実行使用メモリ | 42,020 KB |
最終ジャッジ日時 | 2024-11-15 22:27:04 |
合計ジャッジ時間 | 7,793 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] t = new int[10]; int n = sc.nextInt() * 3, cnt = 0; for (int i = 0; i < n; i++) { t[sc.nextInt() - 1]++; } for (int i = 0; i < 10; i++) { while (t[i] >= 2) { cnt++; n -= 2; t[i] -= 2; } } cnt += n / 4; System.out.println(cnt); } }