結果
| 問題 |
No.804 野菜が苦手
|
| コンテスト | |
| ユーザー |
hitoyozake
|
| 提出日時 | 2019-03-29 22:59:23 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 672 bytes |
| コンパイル時間 | 13,953 ms |
| コンパイル使用メモリ | 387,804 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-07 01:28:55 |
| 合計ジャッジ時間 | 13,829 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 RE * 1 |
| other | AC * 4 WA * 9 RE * 5 |
コンパイルメッセージ
warning: unused variable: `r` --> src/main.rs:4:9 | 4 | let r = std::io::stdin().read_line(&mut x); | ^ help: if this is intentional, prefix it with an underscore: `_r` | = note: `#[warn(unused_variables)]` on by default
ソースコード
fn get_line()->String{
let mut x = String::new();
let r = std::io::stdin().read_line(&mut x);
x
}
fn main() {
let nlines = String::from(get_line().trim());
let nums: Vec<&str> = nlines.split(' ').collect();
let y: u32 = nums[0].parse::<u32>().unwrap();
let niku: u32 = nums[1].parse::<u32>().unwrap();
let times: u32 = nums[2].parse::<u32>().unwrap();
let maxsum:u32 = nums[3].parse::<u32>().unwrap();
let answer = std::cmp::min(niku/times, y); //肉
let ans2 = std::cmp::min(maxsum/((1+times)*answer), answer); // 合計数の最小
let ans3 = std::cmp::min(ans2, y); // 野菜
println!("{}", ans3);
}
hitoyozake