結果

問題 No.29 パワーアップ
ユーザー ちよちゃんちよちゃん
提出日時 2016-05-30 16:34:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 153 ms / 5,000 ms
コード長 684 bytes
コンパイル時間 3,406 ms
コンパイル使用メモリ 74,128 KB
実行使用メモリ 41,964 KB
最終ジャッジ日時 2024-04-16 18:42:46
合計ジャッジ時間 7,332 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
41,404 KB
testcase_01 AC 136 ms
41,524 KB
testcase_02 AC 132 ms
41,316 KB
testcase_03 AC 138 ms
41,536 KB
testcase_04 AC 136 ms
41,392 KB
testcase_05 AC 149 ms
41,896 KB
testcase_06 AC 149 ms
41,744 KB
testcase_07 AC 142 ms
41,588 KB
testcase_08 AC 137 ms
41,616 KB
testcase_09 AC 135 ms
41,520 KB
testcase_10 AC 152 ms
41,964 KB
testcase_11 AC 153 ms
41,496 KB
testcase_12 AC 137 ms
41,812 KB
testcase_13 AC 147 ms
41,728 KB
testcase_14 AC 150 ms
41,820 KB
testcase_15 AC 148 ms
41,760 KB
testcase_16 AC 149 ms
41,524 KB
testcase_17 AC 138 ms
41,032 KB
testcase_18 AC 143 ms
41,472 KB
testcase_19 AC 144 ms
41,640 KB
testcase_20 AC 136 ms
41,764 KB
testcase_21 AC 133 ms
41,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class Yuki29 {
	
	public static void main(String[] args) {
		
		int item[] = new int[10];
		Scanner scan = new Scanner(System.in);
		int mob_count = scan.nextInt();
		int getItem_arr[][] = new int[mob_count][3];
		for (int i = 0; i < mob_count; i++) {
			for (int j = 0; j < 3; j++) {
				getItem_arr[i][j] = scan.nextInt();	
				item[getItem_arr[i][j] - 1 ]++;
			}
		}
		scan.close();

		int power_up = 0;
		int remain_item = 0;
		for(int i = 0; i < 10; i++) {
			//System.out.println(item[i]);
			power_up += item[i]/2;
			remain_item += item[i]%2;
		}
		remain_item /= 4; 
		
		System.out.println(power_up + remain_item);
	}
}
0