結果

問題 No.24 数当てゲーム
コンテスト
ユーザー soujiki
提出日時 2015-04-24 20:09:39
言語 Java
(openjdk 27.0.1.0.3 + ACL)
コンパイル:
javac -J-Duser.language=en -encoding UTF8 -cp /opt/aclib/ac_library.jar _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true -cp .:/opt/aclib/ac_library.jar _class_
結果
AC  
実行時間 147 ms / 5,000 ms
+ 70µs
コード長 724 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,976 ms
コンパイル使用メモリ 95,560 KB
実行使用メモリ 48,628 KB
最終ジャッジ日時 2026-11-15 14:10:49
合計ジャッジ時間 6,133 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge5_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import java.util.*;

public class Yukicoder_24{
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		int N = stdIn.nextInt();
		int[] num = new int[10];
		Arrays.fill(num,10);
		for(int i=0;i<N;i++){
			int A = stdIn.nextInt();
			int B = stdIn.nextInt();
			int C = stdIn.nextInt();
			int D = stdIn.nextInt();
			String R = stdIn.next();
			char X = R.charAt(0);

			if(X=='Y'){
				num[A]++;
				num[B]++;
				num[C]++;
				num[D]++;
			}
			else if(X=='N'){
				num[A]--;
				num[B]--;
				num[C]--;
				num[D]--;
			}
		}
		int now_num = 0;
		int count = 0;
		for(int i=0;i<10;i++){
			if(num[i]>count){
				count = num[i];
				now_num = i;
			}
		}

		System.out.println(now_num);
	}
}
0