結果

問題 No.29 パワーアップ
ユーザー ちよちゃんちよちゃん
提出日時 2016-05-30 16:34:47
言語 Java17
(openjdk 17.0.1)
結果
AC  
実行時間 111 ms / 5,000 ms
コード長 684 bytes
コンパイル時間 3,038 ms
使用メモリ 37,788 KB
最終ジャッジ日時 2022-11-30 22:55:49
合計ジャッジ時間 6,937 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 100 ms
37,328 KB
testcase_01 AC 94 ms
37,296 KB
testcase_02 AC 95 ms
37,348 KB
testcase_03 AC 100 ms
37,560 KB
testcase_04 AC 96 ms
37,392 KB
testcase_05 AC 105 ms
37,592 KB
testcase_06 AC 104 ms
37,628 KB
testcase_07 AC 99 ms
37,356 KB
testcase_08 AC 100 ms
37,348 KB
testcase_09 AC 95 ms
37,464 KB
testcase_10 AC 111 ms
37,788 KB
testcase_11 AC 108 ms
37,600 KB
testcase_12 AC 96 ms
37,476 KB
testcase_13 AC 101 ms
37,440 KB
testcase_14 AC 106 ms
37,540 KB
testcase_15 AC 106 ms
37,572 KB
testcase_16 AC 100 ms
37,520 KB
testcase_17 AC 95 ms
37,364 KB
testcase_18 AC 105 ms
37,460 KB
testcase_19 AC 98 ms
37,468 KB
testcase_20 AC 96 ms
37,692 KB
testcase_21 AC 94 ms
37,460 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