結果

問題 No.24 数当てゲーム
ユーザー キョウチクキョウチク
提出日時 2022-05-18 22:38:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 5,000 ms
コード長 735 bytes
コンパイル時間 4,077 ms
コンパイル使用メモリ 80,620 KB
実行使用メモリ 57,648 KB
最終ジャッジ日時 2023-10-17 03:45:38
合計ジャッジ時間 6,062 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
57,616 KB
testcase_01 AC 126 ms
57,448 KB
testcase_02 AC 125 ms
57,500 KB
testcase_03 AC 128 ms
57,648 KB
testcase_04 AC 126 ms
57,480 KB
testcase_05 AC 126 ms
57,636 KB
testcase_06 AC 126 ms
57,472 KB
testcase_07 AC 128 ms
57,484 KB
testcase_08 AC 126 ms
57,412 KB
testcase_09 AC 115 ms
56,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Test11 {
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    String[] line;
    line=sc.nextLine().split(" ");;
    int n=Integer.parseInt(line[0]);
    int[] num=new int[10];
    for(int i=0;i<n;i++){
      line=sc.nextLine().split(" ");
      switch(line[4]){
      case "YES":
        for(int i1=0;i1<10;i1++){
          num[i1]--;
        }
        for(int i1=0;i1<4;i1++){
          num[Integer.parseInt(line[i1])]++;
        }
        break;
      case "NO":
        for(int i1=0;i1<4;i1++){
          num[Integer.parseInt(line[i1])]--;
        }
        break;
      }
    }
    int i=0;
    while(num[i]<0) i++;
    System.out.println(i);
    sc.close();
  }
}
0