TOML のドキュメント https://toml.io/en/v1.0.0 を読んだ。
新しい食洗機を買った。数日後に届く予定。
- Otoshidama (AtCoder Beginner Contest 085:C問題)
https://atcoder.jp/contests/abc085/tasks/abc085_c
- https://atcoder.jp/contests/abc085/submissions/43441684
- 変数を固定する
- 愚直に考えると
O(N^3)
- 3 つの変数のうち 2 つを固定すると 3 つめも決まるので
O(N^2)
で求められる
use proconio::input; fn main() { input! { n: usize, y: usize, } for a in 0..=n { for b in 0..=n - a { let c = n - (a + b); if ((10_000 * a) + (5_000 * b) + (1_000 * c)) == y { println!("{} {} {}", a, b, c); return; } } } println!("-1 -1 -1"); }
今日のコミット。