https://atcoder.jp/contests/typical90/tasks/typical90_t
か調べればよいですが、cのべき乗を次々と計算していけばよいです。
// Log Inequality #![allow(non_snake_case)] //////////////////// library //////////////////// fn read<T: std::str::FromStr>() -> T { let mut line = String::new(); std::io::stdin().read_line(&mut line).ok(); line.trim().parse().ok().unwrap() } fn read_vec<T: std::str::FromStr>() -> Vec<T> { read::<String>().split_whitespace() .map(|e| e.parse().ok().unwrap()).collect() } fn YesNo(b: bool) -> String { return if b { "Yes" } else { "No" }.to_string() } //////////////////// process //////////////////// fn read_input() -> (u64, u64, u64) { let v = read_vec(); let (a, b, c) = (v[0], v[1], v[2]); (a, b, c) } fn F(a: u64, b: u64, c: u64) -> bool { // log2a < blog2c // a < c^b let mut p: u64 = 1; for _ in 0..b { if a / c < p { return true } p *= c } false } fn main() { let (a, b, c) = read_input(); println!("{}", YesNo(F(a, b, c))) }