2023-12-12 PAST #13 F
くたびれている。
PAST #13 第13回 アルゴリズム実技検定 過去問
- F - 平均順位
https://atcoder.jp/contests/past202212-open/tasks/past202212_f
- 提出: https://atcoder.jp/contests/past202212-open/submissions/48452973
- 式を整理するのが面倒なので雑に二分探索でいけないかなと思ったけど無理だった
use proconio::{input, marker::Chars};
fn main() {
input! {
n: usize,
a: usize,
b: usize,
c: usize,
d: usize,
x: Chars,
};
let x = x
.into_iter()
.filter(|c| c != &'.')
.collect::<String>()
.parse::<usize>()
.unwrap();
let sum = a + 2 * b + 3 * c + 4 * d;
if sum * 1_000 <= x * n {
println!("0");
return;
}
let ans = ((1_000 * sum - x * n) + (x - 1000) - 1) / (x - 1000);
println!("{}", ans);
}
今日のコミット。
- rust-examples 1 commit
- rust-atcoder 1 commit