結果

問題 No.250 atetubouのzetubou
ユーザー kenji_shioyakenji_shioya
提出日時 2016-06-24 23:05:23
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 970 bytes
コンパイル時間 3,713 ms
コンパイル使用メモリ 77,152 KB
実行使用メモリ 132,232 KB
最終ジャッジ日時 2024-04-20 02:28:49
合計ジャッジ時間 15,682 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 482 ms
114,432 KB
testcase_01 AC 331 ms
110,928 KB
testcase_02 AC 614 ms
115,508 KB
testcase_03 AC 643 ms
124,792 KB
testcase_04 WA -
testcase_05 AC 566 ms
113,772 KB
testcase_06 AC 597 ms
120,948 KB
testcase_07 AC 447 ms
123,040 KB
testcase_08 AC 616 ms
124,860 KB
testcase_09 AC 546 ms
131,472 KB
testcase_10 WA -
testcase_11 AC 502 ms
118,056 KB
testcase_12 AC 569 ms
128,152 KB
testcase_13 AC 454 ms
132,232 KB
testcase_14 AC 221 ms
120,744 KB
testcase_15 AC 516 ms
67,752 KB
testcase_16 AC 536 ms
67,792 KB
testcase_17 AC 503 ms
67,916 KB
testcase_18 AC 529 ms
68,172 KB
testcase_19 AC 500 ms
67,720 KB
testcase_20 AC 121 ms
41,356 KB
testcase_21 AC 126 ms
52,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Exercise120{
  public static void main (String[] args){

    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();

    long[][] each = new long[n][3];
    long max = 0;
    for(int i = 0; i < n; i++){
      each[i][0] = sc.nextLong();
      each[i][1] = sc.nextLong();
      each[i][2] = sc.nextLong();
      max = Math.max(max, each[i][1] + each[i][0] - 1);
    }

    long[][] dp = new long[(int)max + 1][(int)max + 1];
    for(int i = 0; i <= max; i++){
      for(int j = 0; j <= i; j++){
        if(j == 0 || j == i){
          dp[i][j] = 1;
        }else{
          dp[i][j] = dp[i - 1][j - 1] + dp[i - 1][j];
        }
      }
    }
    for(int i = 0; i < n; i++){
      if(dp[(int)each[i][1] + (int)each[i][0] - 1][(int)each[i][1]] > each[i][2] || dp[(int)each[i][1] + (int)each[i][0] - 1][(int)each[i][1]] < 0){
        System.out.println("ZETUBOU");
      }else{
        System.out.println("AC");
      }
    }
  }
}
0