結果

問題 No.24 数当てゲーム
コンテスト
ユーザー k_kadora
提出日時 2015-05-19 03:13:38
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
AC  
実行時間 56 ms / 5,000 ms
コード長 660 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,563 ms
コンパイル使用メモリ 82,524 KB
実行使用メモリ 41,728 KB
最終ジャッジ日時 2026-03-27 16:43:12
合計ジャッジ時間 3,835 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import java.util.*;
public class Detect{
	public static void main(String[] arg){
		int[] res = new int[10];
		for(int i = 0;i<10;i++){
			res[i] = 0;
		}
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[4];
		int re=0;
		int count = 0;
		String ans;
		for(int i = 0;i<n;i++){
			for(int j = 0;j<4;j++){
				a[j] = sc.nextInt();
			}
			ans = sc.next();
			if(ans.equals("YES")){
				for(int j=0;j<4;j++){
					res[a[j]] = res[a[j]]+1;
				}
				count++;
			}else{
				for(int j=0;j<4;j++){
					res[a[j]] = res[a[j]]-1;
				}
			}
		}
		for(int i = 0;i<10;i++){
			if(res[i] == count)re = i;
		}
		System.out.println(re);
	}
}
0