結果
| 問題 | No.24 数当てゲーム |
| コンテスト | |
| ユーザー |
matsuyoshi30
|
| 提出日時 | 2016-02-21 10:37:43 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 136 ms / 5,000 ms |
| コード長 | 1,182 bytes |
| コンパイル時間 | 2,276 ms |
| コンパイル使用メモリ | 77,264 KB |
| 実行使用メモリ | 54,208 KB |
| 最終ジャッジ日時 | 2024-09-22 12:31:43 |
| 合計ジャッジ時間 | 4,252 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
import java.util.Scanner;
class Main {
public static void main(String[] args) throws Exception {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int[] a = new int[n];
int[] b = new int[n];
int[] c = new int[n];
int[] d = new int[n];
String[] r = new String[n];
for(int i=0; i<n; i++) {
a[i] = in.nextInt();
b[i] = in.nextInt();
c[i] = in.nextInt();
d[i] = in.nextInt();
r[i] = in.next();
}
boolean[] bool = new boolean[10];
for(int i=0; i<n; i++) {
if(r[i].equals("YES")) {
for(int j=0; j<10; j++) {
if(j == a[i] || j == b[i] || j == c[i] || j == d[i]) {
continue;
}
bool[j] = true;
}
} else if(r[i].equals("NO")) {
bool[a[i]] = bool[b[i]] = bool[c[i]] = bool[d[i]] = true;
}
}
for(int i=0; i<10; i++) {
if(bool[i] == false) {
System.out.println(i);
break;
}
}
}
}
matsuyoshi30