結果

問題 No.250 atetubouのzetubou
ユーザー tetsutetsu
提出日時 2018-02-19 23:23:32
言語 Java21
(openjdk 21)
結果
AC  
実行時間 229 ms / 5,000 ms
コード長 1,756 bytes
コンパイル時間 3,570 ms
コンパイル使用メモリ 74,060 KB
実行使用メモリ 92,076 KB
最終ジャッジ日時 2023-09-23 03:40:30
合計ジャッジ時間 9,529 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 191 ms
88,340 KB
testcase_01 AC 173 ms
88,132 KB
testcase_02 AC 215 ms
91,164 KB
testcase_03 AC 222 ms
91,384 KB
testcase_04 AC 218 ms
90,504 KB
testcase_05 AC 216 ms
90,892 KB
testcase_06 AC 207 ms
89,012 KB
testcase_07 AC 194 ms
88,980 KB
testcase_08 AC 210 ms
88,944 KB
testcase_09 AC 191 ms
88,388 KB
testcase_10 AC 214 ms
91,028 KB
testcase_11 AC 197 ms
88,628 KB
testcase_12 AC 209 ms
88,880 KB
testcase_13 AC 191 ms
88,460 KB
testcase_14 AC 114 ms
87,308 KB
testcase_15 AC 229 ms
91,308 KB
testcase_16 AC 216 ms
91,776 KB
testcase_17 AC 223 ms
91,376 KB
testcase_18 AC 218 ms
91,688 KB
testcase_19 AC 214 ms
92,076 KB
testcase_20 AC 110 ms
87,376 KB
testcase_21 AC 111 ms
87,364 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[3000][1500];
	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<3000; i++) memo[i][0] = 1;
		for(int i=1; i<1500; i++) memo[i][i] = 1;
		for(int a=1; a<3000; a++) {
			for(int b=1; b<a && b<1500; 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