結果

問題 No.268 ラッピング(Easy)
ユーザー ixTL255ixTL255
提出日時 2023-01-08 16:11:46
言語 Rust
(1.77.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 584 bytes
コンパイル時間 1,124 ms
コンパイル使用メモリ 150,848 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-22 02:24:30
合計ジャッジ時間 1,989 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: variable does not need to be mutable
 --> Main.rs:4:9
  |
4 |     let mut l: Vec<i32> = l.trim().split_whitespace()
  |         ----^
  |         |
  |         help: remove this `mut`
  |
  = note: `#[warn(unused_mut)]` on by default

warning: 1 warning emitted

ソースコード

diff #

fn main() {
    let mut l = String::new();
    std::io::stdin().read_line(&mut l).ok();
    let mut l: Vec<i32> = l.trim().split_whitespace()
        .map(|e| e.parse().unwrap()).collect();
    let mut rby = String::new();
    std::io::stdin().read_line(&mut rby).ok();
    let mut rby: Vec<i32> = rby.trim().split_whitespace()
        .map(|e| e.parse().unwrap()).collect();

    let mut len = vec!((l[0] + l[1]) * 2, (l[0] + l[2]) * 2, (l[1] + l[2]) * 2);
    len.sort();
    rby.sort();
    rby.reverse();

    println!("{}", len[0] * rby[0] + len[1] * rby[1] + len[2] * rby[2]);
}
0