結果

問題 No.26 シャッフルゲーム
ユーザー bigbear90560bigbear90560
提出日時 2015-09-17 19:02:03
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 965 bytes
コンパイル時間 3,377 ms
コンパイル使用メモリ 72,484 KB
実行使用メモリ 57,964 KB
最終ジャッジ日時 2023-09-26 12:23:30
合計ジャッジ時間 5,358 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 WA -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

/**
 * No.24 数当てゲーム
 */
public class No024_NumberHitGame {

	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();	// 入力列数

        int[] judge = new int[10];
        for (int i=0; i<a; i++) {
        	int n1 = sc.nextInt();	// 数1
        	int n2 = sc.nextInt();	// 数2
        	int n3 = sc.nextInt();	// 数3
        	int n4 = sc.nextInt();	// 数4
            String s = sc.next();	// ジャッジ

            judge[n1] += "YES".equals(s) ? 1 : -1; 
            judge[n2] += "YES".equals(s) ? 1 : -1; 
            judge[n3] += "YES".equals(s) ? 1 : -1; 
            judge[n4] += "YES".equals(s) ? 1 : -1; 
        }

        int max = -1;
        int result = 0;
        for (int i=0; i<judge.length; i++) {
        	if (max < judge[i]) {
        		max = judge[i];
        		result = i;
        	}
        }
        System.out.println(result);
	}

}
0