結果

問題 No.250 atetubouのzetubou
ユーザー scachescache
提出日時 2015-10-20 18:34:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 419 ms / 5,000 ms
コード長 996 bytes
コンパイル時間 3,950 ms
コンパイル使用メモリ 74,552 KB
実行使用メモリ 139,256 KB
最終ジャッジ日時 2023-09-29 16:57:54
合計ジャッジ時間 11,205 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 358 ms
137,916 KB
testcase_01 AC 306 ms
136,944 KB
testcase_02 AC 401 ms
138,536 KB
testcase_03 AC 419 ms
138,500 KB
testcase_04 AC 397 ms
138,264 KB
testcase_05 AC 399 ms
137,952 KB
testcase_06 AC 378 ms
137,876 KB
testcase_07 AC 332 ms
137,452 KB
testcase_08 AC 389 ms
138,116 KB
testcase_09 AC 365 ms
137,612 KB
testcase_10 AC 402 ms
138,204 KB
testcase_11 AC 360 ms
137,908 KB
testcase_12 AC 395 ms
138,228 KB
testcase_13 AC 342 ms
139,256 KB
testcase_14 AC 218 ms
134,796 KB
testcase_15 AC 377 ms
136,848 KB
testcase_16 AC 375 ms
136,976 KB
testcase_17 AC 375 ms
138,928 KB
testcase_18 AC 375 ms
136,588 KB
testcase_19 AC 375 ms
137,144 KB
testcase_20 AC 205 ms
135,016 KB
testcase_21 AC 203 ms
134,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.PrintWriter;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        new Main();
    }

    public Main() {
        int n = dp.length;
        dp[0][0] = 1;
        for(int i=1;i<n;i++) {
            dp[i][0] = 1;
            for (int j = 1; j <= i; j++)
                dp[i][j] = Math.min(dp[i - 1][j] + dp[i - 1][j - 1], 1L << 61);
        }

        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        int q = sc.nextInt();
        for(int i=0;i<q;i++){
            D = Integer.parseInt(sc.next());
            X = Integer.parseInt(sc.next());
            T = Long.parseLong(sc.next());
            pw.println(solve());
        }
        pw.flush();

    }

    long[][] dp = new long[3010][3010];
    int D;
    int X;
    long T;
    private String solve(){
        long c = dp[X+D-1][D-1];
        if(c>T)
            return "ZETUBOU";
        else
            return "AC";
    }
}
0