結果
問題 | No.250 atetubouのzetubou |
ユーザー | hatoo |
提出日時 | 2018-02-26 17:26:06 |
言語 | Rust (1.77.0 + proconio) |
結果 |
AC
|
実行時間 | 29 ms / 5,000 ms |
コード長 | 4,310 bytes |
コンパイル時間 | 24,487 ms |
コンパイル使用メモリ | 376,992 KB |
実行使用メモリ | 19,584 KB |
最終ジャッジ日時 | 2024-11-24 06:56:06 |
合計ジャッジ時間 | 22,649 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 24 ms
19,456 KB |
testcase_01 | AC | 23 ms
19,456 KB |
testcase_02 | AC | 25 ms
19,456 KB |
testcase_03 | AC | 25 ms
19,456 KB |
testcase_04 | AC | 25 ms
19,456 KB |
testcase_05 | AC | 25 ms
19,584 KB |
testcase_06 | AC | 24 ms
19,584 KB |
testcase_07 | AC | 23 ms
19,456 KB |
testcase_08 | AC | 24 ms
19,584 KB |
testcase_09 | AC | 27 ms
19,584 KB |
testcase_10 | AC | 29 ms
19,584 KB |
testcase_11 | AC | 26 ms
19,584 KB |
testcase_12 | AC | 26 ms
19,456 KB |
testcase_13 | AC | 28 ms
19,456 KB |
testcase_14 | AC | 24 ms
19,456 KB |
testcase_15 | AC | 26 ms
19,456 KB |
testcase_16 | AC | 25 ms
19,456 KB |
testcase_17 | AC | 26 ms
19,456 KB |
testcase_18 | AC | 25 ms
19,456 KB |
testcase_19 | AC | 25 ms
19,456 KB |
testcase_20 | AC | 22 ms
19,456 KB |
testcase_21 | AC | 22 ms
19,456 KB |
ソースコード
/** * _ _ __ _ _ _ _ _ _ _ * | | | | / / | | (_) | (_) | | (_) | | * | |__ __ _| |_ ___ ___ / /__ ___ _ __ ___ _ __ ___| |_ _| |_ ___ _____ ______ _ __ _ _ ___| |_ ______ ___ _ __ _ _ __ _ __ ___| |_ ___ * | '_ \ / _` | __/ _ \ / _ \ / / __/ _ \| '_ ` _ \| '_ \ / _ \ __| | __| \ \ / / _ \______| '__| | | / __| __|______/ __| '_ \| | '_ \| '_ \ / _ \ __/ __| * | | | | (_| | || (_) | (_) / / (_| (_) | | | | | | |_) | __/ |_| | |_| |\ V / __/ | | | |_| \__ \ |_ \__ \ | | | | |_) | |_) | __/ |_\__ \ * |_| |_|\__,_|\__\___/ \___/_/ \___\___/|_| |_| |_| .__/ \___|\__|_|\__|_| \_/ \___| |_| \__,_|___/\__| |___/_| |_|_| .__/| .__/ \___|\__|___/ * | | | | | | * |_| |_| |_| * * https://github.com/hatoo/competitive-rust-snippets */ #[allow(unused_imports)] use std::cmp::{max, min, Ordering}; #[allow(unused_imports)] use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque}; #[allow(unused_imports)] use std::iter::FromIterator; #[allow(unused_imports)] use std::io::{stdin, stdout, BufWriter, Write}; mod util { use std::io::{stdin, stdout, BufWriter, StdoutLock}; use std::str::FromStr; use std::fmt::Debug; #[allow(dead_code)] pub fn line() -> String { let mut line: String = String::new(); stdin().read_line(&mut line).unwrap(); line.trim().to_string() } #[allow(dead_code)] pub fn chars() -> Vec<char> { line().chars().collect() } #[allow(dead_code)] pub fn gets<T: FromStr>() -> Vec<T> where <T as FromStr>::Err: Debug, { let mut line: String = String::new(); stdin().read_line(&mut line).unwrap(); line.split_whitespace() .map(|t| t.parse().unwrap()) .collect() } #[allow(dead_code)] pub fn with_bufwriter<F: FnOnce(BufWriter<StdoutLock>) -> ()>(f: F) { let out = stdout(); let writer = BufWriter::new(out.lock()); f(writer) } } #[allow(unused_macros)] macro_rules ! get { ( $ t : ty ) => { { let mut line : String = String :: new ( ) ; stdin ( ) . read_line ( & mut line ) . unwrap ( ) ; line . trim ( ) . parse ::<$ t > ( ) . unwrap ( ) } } ; ( $ ( $ t : ty ) ,* ) => { { let mut line : String = String :: new ( ) ; stdin ( ) . read_line ( & mut line ) . unwrap ( ) ; let mut iter = line . split_whitespace ( ) ; ( $ ( iter . next ( ) . unwrap ( ) . parse ::<$ t > ( ) . unwrap ( ) , ) * ) } } ; ( $ t : ty ; $ n : expr ) => { ( 0 ..$ n ) . map ( | _ | get ! ( $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ ( $ t : ty ) ,*; $ n : expr ) => { ( 0 ..$ n ) . map ( | _ | get ! ( $ ( $ t ) ,* ) ) . collect ::< Vec < _ >> ( ) } ; ( $ t : ty ;; ) => { { let mut line : String = String :: new ( ) ; stdin ( ) . read_line ( & mut line ) . unwrap ( ) ; line . split_whitespace ( ) . map ( | t | t . parse ::<$ t > ( ) . unwrap ( ) ) . collect ::< Vec < _ >> ( ) } } ; ( $ t : ty ;; $ n : expr ) => { ( 0 ..$ n ) . map ( | _ | get ! ( $ t ;; ) ) . collect ::< Vec < _ >> ( ) } ; } #[allow(unused_macros)] macro_rules ! debug { ( $ ( $ a : expr ) ,* ) => { println ! ( concat ! ( $ ( stringify ! ( $ a ) , " = {:?}, " ) ,* ) , $ ( $ a ) ,* ) ; } } #[allow(dead_code)] fn main() { const LIM: u64 = 1_000_000_000_000_001; let mut dp = vec![vec![0u64; 1501]; 1501]; dp[0][0] = 1; for i in 1..1501 { dp[i][0] = 1; for j in 1..1501 { dp[i][j] = min(LIM, dp[i][j - 1] + dp[i - 1][j]); } } let q = get!(usize); util::with_bufwriter(|mut out| { for _ in 0..q { let (d, x, t) = get!(usize, usize, u64); if dp[d][x] > t { writeln!(out, "ZETUBOU").unwrap(); } else { writeln!(out, "AC").unwrap(); } } }); }