結果

問題 No.250 atetubouのzetubou
ユーザー kenji_shioya
提出日時 2016-06-24 23:05:23
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 970 bytes
コンパイル時間 4,346 ms
コンパイル使用メモリ 77,460 KB
実行使用メモリ 132,980 KB
最終ジャッジ日時 2024-10-11 21:21:10
合計ジャッジ時間 16,864 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18 WA * 2
権限があれば一括ダウンロードができます

ソースコード

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