結果

問題 No.24 数当てゲーム
ユーザー GrenacheGrenache
提出日時 2015-09-22 23:10:17
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 5,000 ms
コード長 765 bytes
コンパイル時間 3,664 ms
コンパイル使用メモリ 71,956 KB
実行使用メモリ 56,108 KB
最終ジャッジ日時 2023-09-26 14:29:55
合計ジャッジ時間 5,305 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,912 KB
testcase_01 AC 122 ms
55,960 KB
testcase_02 AC 121 ms
55,808 KB
testcase_03 AC 125 ms
55,988 KB
testcase_04 AC 124 ms
55,988 KB
testcase_05 AC 124 ms
56,024 KB
testcase_06 AC 124 ms
56,108 KB
testcase_07 AC 122 ms
55,784 KB
testcase_08 AC 123 ms
56,020 KB
testcase_09 AC 122 ms
55,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder24 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] abcd = new int[10];
        int y = 0;
        for (int i = 0; i < n; i++) {
        	int[] tmp = new int[4];
        	for (int j = 0; j < 4; j++) {
        		tmp[j] = sc.nextInt();
        	}
        	int d;
        	if (sc.next().equals("YES")) {
        		d = 1;
        		y++;
        	} else {
        		d = -1;
        	}
        	for (int j = 0; j < 4; j++) {
        		abcd[tmp[j]] += d;
        	}
        }

        for (int i = 0; i < 10; i++) {
        	if (y == abcd[i]) {
        		System.out.println(i);
        	}
        }

        sc.close();
    }
}
0