結果
| 問題 | No.24 数当てゲーム |
| コンテスト | |
| ユーザー |
aikon_marimo
|
| 提出日時 | 2018-01-29 00:35:02 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 148 ms / 5,000 ms |
| コード長 | 747 bytes |
| コンパイル時間 | 2,883 ms |
| コンパイル使用メモリ | 77,368 KB |
| 実行使用メモリ | 41,388 KB |
| 最終ジャッジ日時 | 2024-12-29 16:24:14 |
| 合計ジャッジ時間 | 5,255 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int[] score = new int[10];
Arrays.fill(score, 0);
int N = in.nextInt();
for (int i = 0; i < N; i++) {
int A,B,C,D;
String R;
A = in.nextInt();
B = in.nextInt();
C = in.nextInt();
D = in.nextInt();
R = in.next();
if ("NO".equals(R)) {
score[A]--;
score[B]--;
score[C]--;
score[D]--;
} else {
score[A]++;
score[B]++;
score[C]++;
score[D]++;
}
}
int max = score[0];
int ans = 0;
for (int i = 1; i <= 9; i++) {
if (max < score[i]) {
max = score[i];
ans = i;
}
}
System.out.println(ans);
}
}
aikon_marimo