結果
| 問題 |
No.250 atetubouのzetubou
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-02-19 23:21:13 |
| 言語 | Java (openjdk 23) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,746 bytes |
| コンパイル時間 | 4,522 ms |
| コンパイル使用メモリ | 77,744 KB |
| 実行使用メモリ | 69,472 KB |
| 最終ジャッジ日時 | 2024-07-16 03:52:54 |
| 合計ジャッジ時間 | 7,656 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | RE * 20 |
ソースコード
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());
}
}
}