Skip to content

Commit

Permalink
past202005-open c
Browse files Browse the repository at this point in the history
  • Loading branch information
bouzuya committed Jan 12, 2024
1 parent 3fd3fa1 commit 686e0ef
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions cargo-atcoder-1.70.0/contests/past202005-open/src/bin/c.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
use proconio::{input, marker::Usize1};
use proconio::input;

fn main() {
input! {
a: usize,
r: usize,
n: usize,
a: [Usize1; n],
};
let ans = n - a.len();

if r == 1 {
let x = a * r;
if x > 10_usize.pow(9) {
println!("large");
} else {
println!("{}", x);
}
return;
}

let mut x = a;
for _ in 1..n {
x *= r;
if x > 10_usize.pow(9) {
println!("large");
return;
}
}
let ans = x;
println!("{}", ans);
}

0 comments on commit 686e0ef

Please sign in to comment.