結果

問題 No.24 数当てゲーム
ユーザー ちよちゃんちよちゃん
提出日時 2016-05-26 16:47:08
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 781 bytes
コンパイル時間 3,677 ms
コンパイル使用メモリ 77,324 KB
実行使用メモリ 41,516 KB
最終ジャッジ日時 2024-04-16 17:28:10
合計ジャッジ時間 5,646 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
41,176 KB
testcase_01 AC 132 ms
41,320 KB
testcase_02 AC 130 ms
41,368 KB
testcase_03 AC 130 ms
41,260 KB
testcase_04 AC 129 ms
41,172 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 133 ms
41,300 KB
testcase_08 AC 131 ms
41,064 KB
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class Yuki24_{
	
	public static void main(String[] args) {
		
		Scanner scan = new Scanner(System.in);
		int num = scan.nextInt();
		int arr[][] = new int[num][4];
		String[] ans = new String[num];
		int numbers[] = new int[10];
		
		for (int i = 0; i < num; i++ ) {
			for (int j = 0; j < 4; j++ ) {
				arr[i][j] = scan.nextInt();
			}
			ans[i] = scan.next(); 
		}
		scan.close();
		
		for (int i = 0; i < num; i++ ) {
			for (int j = 0; j < 4; j++ ) {
				if("YES".equals(ans[i])){
					numbers[arr[i][j]] += 1;
				}
				if("NO".equals(ans[i])){
					numbers[arr[i][j]] -= 1;
				}
			}
		}
		
		int jug = 0;
		for(int i = 0 ;i <= 9; i++ ) {
			if(jug <= numbers[i]){
				jug = i;
			}
		}
		System.out.println(jug);	
	}
}
0