結果

問題 No.24 数当てゲーム
ユーザー papipenpapipen
提出日時 2017-04-06 18:46:55
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 688 bytes
コンパイル時間 2,299 ms
コンパイル使用メモリ 74,020 KB
実行使用メモリ 58,060 KB
最終ジャッジ日時 2023-09-24 20:57:50
合計ジャッジ時間 4,643 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import java.util.*;
class N024{
	public static void main(String args[]){
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int e[] = new int[10];
		int count;
		for(int i = 0; i < n; i++){
			int a = s.nextInt();
			int b = s.nextInt();
			int c = s.nextInt();
			int d = s.nextInt();
			String r = s.next();
			if(r.equals("YES")){
				count = 1;
			}else{
				count = -1;
			}
				e[a] += count;
				e[b] += count;
				e[c] += count;
				e[d] += count;
		}
		
		int max = 0;
		for(int i = 0; i < e.length; i++){
			System.out.println(e[i]);
			max = Math.max(max , e[i]);
		}
		for(int i = 0; i < e.length; i++){
			if(e[i] == max){
				System.out.println(i);
			}
		}
	}
}
0