結果
| 問題 |
No.63 ポッキーゲーム
|
| コンテスト | |
| ユーザー |
ta60143
|
| 提出日時 | 2019-02-08 14:55:51 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 483 bytes |
| コンパイル時間 | 11,990 ms |
| コンパイル使用メモリ | 389,164 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-28 02:42:38 |
| 合計ジャッジ時間 | 12,747 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
コンパイルメッセージ
warning: use of deprecated method `core::str::<impl str>::trim_right`: superseded by `trim_end` --> src/main.rs:5:11 | 5 | s.trim_right().to_owned() | ^^^^^^^^^^ | = note: `#[warn(deprecated)]` on by default help: replace the use of the deprecated method | 5 | s.trim_end().to_owned() | ~~~~~~~~
ソースコード
fn main() {
let s = {
let mut s = String::new();
std::io::stdin().read_line(&mut s).unwrap();
s.trim_right().to_owned()
};
let (l, k) = {
let mut ws = s.split_whitespace();
let l: u32 = ws.next().unwrap().parse().unwrap();
let k: u32 = ws.next().unwrap().parse().unwrap();
(l, k)
};
if l % (2*k) == 0 {
println!("{}", l/2 - k);
}
else {
println!("{}", k*(l/(2*k)));
}
}
ta60143