結果

問題 No.29 パワーアップ
ユーザー HEGO55HEGO55
提出日時 2017-05-22 23:09:45
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,188 bytes
コンパイル時間 2,256 ms
コンパイル使用メモリ 77,464 KB
実行使用メモリ 58,136 KB
最終ジャッジ日時 2023-10-19 14:18:06
合計ジャッジ時間 6,227 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 134 ms
57,500 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
class No29{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int One = 0;
		int Two = 0;
		int Three = 0;
		int Four = 0;
		int Five = 0;
		int Six = 0;
		int Seven = 0;
		int Eight = 0;
		int Nine = 0;
		int[][] num = new int[N][3];
		
		for(int i=0; i<N; i++){
			for(int j=0; j<3; j++){
				num[i][j] = sc.nextInt();
				if(num[i][j] == 1){
					One++;
				}else if(num[i][j] == 2){
					Two++;
				}else if(num[i][j] == 3){
					Three++;
				}else if(num[i][j] == 4){
					Four++;
				}else if(num[i][j] == 5){
					Five++;
				}else if(num[i][j] == 6){
					Six++;
				}else if(num[i][j] == 7){
					Seven++;
				}else if(num[i][j] == 8){
					Eight++;
				}else if(num[i][j] == 9){
					Nine++;
				}
			}
		}
		One = (int)Math.floor(One/2);
		Two = (int)Math.floor(Two/2);
		Three = (int)Math.floor(Three/2);
		Four = (int)Math.floor(Four/2);
		Five = (int)Math.floor(Five/2);
		Six = (int)Math.floor(Six/2);
		Seven = (int)Math.floor(Seven/2);
		Eight = (int)Math.floor(Eight/2);
		Nine = (int)Math.floor(Nine/2);
		int Sum = One+Two+Three+Four+Five+Six+Seven+Eight+Nine;
		System.out.println(Sum);
	}
}
0