結果

問題 No.24 数当てゲーム
ユーザー chiho_miyakochiho_miyako
提出日時 2015-04-08 11:40:47
言語 Java19
(openjdk 21)
結果
AC  
実行時間 127 ms / 5,000 ms
コード長 935 bytes
コンパイル時間 2,379 ms
コンパイル使用メモリ 74,304 KB
実行使用メモリ 55,992 KB
最終ジャッジ日時 2023-09-17 16:05:22
合計ジャッジ時間 4,518 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,624 KB
testcase_01 AC 123 ms
55,784 KB
testcase_02 AC 124 ms
55,992 KB
testcase_03 AC 127 ms
55,852 KB
testcase_04 AC 126 ms
55,856 KB
testcase_05 AC 126 ms
55,920 KB
testcase_06 AC 125 ms
55,972 KB
testcase_07 AC 125 ms
55,716 KB
testcase_08 AC 124 ms
55,692 KB
testcase_09 AC 125 ms
55,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner koko = new Scanner(System.in);
        int n = koko.nextInt();
        int[][] a = new int[n][4];
        String[] ans = new String[n];
        int[] yes = new int[10];
        int[] no = new int[10];
        int yesc = 0;
        for(int i=0; i<n; i++){
            for(int j=0; j<4; j++){
                a[i][j] = koko.nextInt();
            }
            ans[i] = koko.next();
            if(ans[i].equals("YES")){
                for(int j=0; j<4; j++){
                    yes[a[i][j]]++;
                }
                yesc++;
            }else{
                for(int j=0; j<4; j++){
                    no[a[i][j]]++;
                }
            }
        }
        for(int i=0; i<10; i++){
            if(yes[i]==yesc&&no[i]==0){
                System.out.println(i);
            }
        }
    }
}
0