結果
問題 | No.29 パワーアップ |
ユーザー |
![]() |
提出日時 | 2015-05-01 18:03:16 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 124 ms / 5,000 ms |
コード長 | 502 bytes |
コンパイル時間 | 2,022 ms |
コンパイル使用メモリ | 73,992 KB |
実行使用メモリ | 41,928 KB |
最終ジャッジ日時 | 2024-07-05 17:23:23 |
合計ジャッジ時間 | 5,569 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
import java.util.*; class Yuki29{ public static void main(String[] args){ Scanner stdIn = new Scanner(System.in); int n = stdIn.nextInt(); int[] count = new int[10]; int box=0; int answer=0; for(int i=0;i<n*3;i++){ int input = stdIn.nextInt(); if(input==10) input =0; count[input] += 1; if(count[input]==2){ count[input] -= 2; answer += 1; } } for(int i=0;i<10;i++){ box+=count[i]; } answer += (int)(box/4); System.out.println(answer); } }