結果
| 問題 |
No.29 パワーアップ
|
| コンテスト | |
| ユーザー |
HEGO55
|
| 提出日時 | 2017-05-22 23:09:45 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,188 bytes |
| コンパイル時間 | 2,115 ms |
| コンパイル使用メモリ | 80,176 KB |
| 実行使用メモリ | 46,864 KB |
| 最終ジャッジ日時 | 2025-10-24 21:01:29 |
| 合計ジャッジ時間 | 5,903 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 WA * 21 |
ソースコード
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);
}
}
HEGO55