結果

問題 No.250 atetubouのzetubou
ユーザー kenji_shioyakenji_shioya
提出日時 2016-06-24 23:26:58
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 996 bytes
コンパイル時間 3,959 ms
コンパイル使用メモリ 77,196 KB
実行使用メモリ 133,416 KB
最終ジャッジ日時 2024-04-20 02:31:03
合計ジャッジ時間 16,610 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 551 ms
114,680 KB
testcase_01 AC 365 ms
110,572 KB
testcase_02 AC 676 ms
115,424 KB
testcase_03 AC 727 ms
125,204 KB
testcase_04 WA -
testcase_05 AC 638 ms
113,692 KB
testcase_06 AC 603 ms
121,260 KB
testcase_07 AC 474 ms
123,008 KB
testcase_08 AC 611 ms
124,596 KB
testcase_09 AC 607 ms
131,416 KB
testcase_10 WA -
testcase_11 AC 531 ms
118,212 KB
testcase_12 AC 591 ms
127,560 KB
testcase_13 AC 492 ms
133,416 KB
testcase_14 AC 241 ms
120,188 KB
testcase_15 AC 558 ms
67,532 KB
testcase_16 AC 565 ms
67,380 KB
testcase_17 AC 540 ms
67,696 KB
testcase_18 AC 548 ms
67,208 KB
testcase_19 AC 555 ms
67,840 KB
testcase_20 AC 132 ms
41,572 KB
testcase_21 AC 150 ms
52,512 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