結果

問題 No.250 atetubouのzetubou
ユーザー tetsutetsu
提出日時 2018-02-19 23:21:13
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 1,746 bytes
コンパイル時間 3,749 ms
コンパイル使用メモリ 74,884 KB
実行使用メモリ 68,580 KB
最終ジャッジ日時 2023-09-23 03:39:57
合計ジャッジ時間 6,704 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 AC 76 ms
68,092 KB
testcase_21 AC 76 ms
67,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class P250 {
	static long INF = 1000000000000000L+1;
	static long[][] memo = new long[1501][1501];
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw=new PrintWriter(System.out);
		for(int i=0; i<1501; i++) memo[i][0] = 1;
		for(int i=1; i<1501; i++) memo[i][i] = 1;
		for(int a=1; a<1501; a++) {
			for(int b=1; b<a; b++) {
				if(memo[a-1][b-1]>=INF || memo[a-1][b]>=INF) {
					memo[a][b] = INF;
				} else {
					memo[a][b] = memo[a-1][b-1]+memo[a-1][b];	
				}
			}
		}
		int Q = sc.nextInt();
		for(int i=0; i<Q; i++) {
			int d = sc.nextInt();
			int x = sc.nextInt();
			long t = sc.nextLong();
			if(memo[d+x-1][d-1]<=t) {
				pw.println("AC");
			} else {
				pw.println("ZETUBOU");
			}
		}
		pw.close();
	}

	static class Scanner
	{
		BufferedReader br;
		StringTokenizer st;
		public Scanner(InputStream s)
		{
			br=new BufferedReader(new InputStreamReader(s));
		}
		public String nextLine() throws IOException
		{
			return br.readLine();
		}
		public String next() throws IOException
		{
			while(st==null || !st.hasMoreTokens())
				st=new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws IOException
		{
			return Integer.parseInt(next());
			
		}
		public double nextDouble() throws IOException
		{
			return Double.parseDouble(next());
		}
		public boolean ready() throws IOException
		{
			return br.ready();
		}
		public long nextLong() throws IOException
		{
			return Long.parseLong(next());
		}
	}
}
0