結果

問題 No.29 パワーアップ
ユーザー k_kadora
提出日時 2015-05-19 03:46:22
言語 Java
(openjdk 23)
結果
AC  
実行時間 135 ms / 5,000 ms
コード長 497 bytes
コンパイル時間 3,134 ms
コンパイル使用メモリ 75,144 KB
実行使用メモリ 54,208 KB
最終ジャッジ日時 2024-07-06 05:42:40
合計ジャッジ時間 6,323 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Powerup{
	public static void main(String[] arg){
		int[] item = {0,0,0,0,0,0,0,0,0,0};
		int n,m,res = 0,count = 0;
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for(int i = 0;i<n;i++){
			for(int j = 0;j<3;j++){
				m = sc.nextInt();
				item[m-1]=item[m-1]+1;
			}
		}
		for(int i = 0;i<10;i++){
			while(item[i]>1){
				item[i] = item[i]-2;
				res++;
			}
			if(item[i] == 1)count++;
		}
		res = res + (count /4);
		System.out.println(res);
	}
}
0