結果

問題 No.268 ラッピング(Easy)
ユーザー titiatitia
提出日時 2022-09-01 01:12:13
言語 Rust
(1.77.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 969 bytes
コンパイル時間 6,276 ms
コンパイル使用メモリ 151,100 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-26 06:38:15
合計ジャッジ時間 1,240 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 1 ms
6,816 KB
testcase_02 AC 1 ms
6,812 KB
testcase_03 AC 1 ms
6,816 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 1 ms
6,944 KB
testcase_06 AC 1 ms
6,944 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 AC 1 ms
6,940 KB
testcase_09 AC 1 ms
6,940 KB
testcase_10 AC 1 ms
6,940 KB
testcase_11 AC 1 ms
6,944 KB
testcase_12 AC 1 ms
6,948 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: variable `L1` should have a snake case name
 --> main.rs:2:10
  |
2 |     let (L1, L2, L3): (usize, usize, usize) = {
  |          ^^ help: convert the identifier to snake case: `l1`
  |
  = note: `#[warn(non_snake_case)]` on by default

warning: variable `L2` should have a snake case name
 --> main.rs:2:14
  |
2 |     let (L1, L2, L3): (usize, usize, usize) = {
  |              ^^ help: convert the identifier to snake case: `l2`

warning: variable `L3` should have a snake case name
 --> main.rs:2:18
  |
2 |     let (L1, L2, L3): (usize, usize, usize) = {
  |                  ^^ help: convert the identifier to snake case: `l3`

warning: variable `R` should have a snake case name
  --> main.rs:14:10
   |
14 |     let (R, B, Y): (usize, usize, usize) = {
   |          ^ help: convert the identifier to snake case: `r`

warning: variable `B` should have a snake case name
  --> main.rs:14:13
   |
14 |     let (R, B, Y): (usize, usize, usize) = {
   |             ^ help: convert the identifier to snake case: `b`

warning: variable `Y` should have a snake case name
  --> main.rs:14:16
   |
14 |     let (R, B, Y): (usize, usize, usize) = {
   |                ^ help: convert the identifier to snake case (notice the capitalization): `y`

warning: variable `A` should have a snake case name
  --> main.rs:26:13
   |
26 |     let mut A=vec![L1+L2,L1+L3,L2+L3];
   |             ^ help: convert the identifier to snake case: `a`

warning: variable `B` should have a snake case name
  --> main.rs:27:13
   |
27 |     let mut B=vec![R,B,Y];
   |             ^ help: convert the identifier to snake case: `b`

warning: 8 warnings emitted

ソースコード

diff #

fn main() {
    let (L1, L2, L3): (usize, usize, usize) = {
        let mut line: String = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        let mut iter = line.split_whitespace();
        (
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),

        )
    };

    let (R, B, Y): (usize, usize, usize) = {
        let mut line: String = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        let mut iter = line.split_whitespace();
        (
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),

        )
    };

    let mut A=vec![L1+L2,L1+L3,L2+L3];
    let mut B=vec![R,B,Y];

    A.sort();
    B.sort();

    let mut ans=0;

    for i in 0..3{
        ans+=A[i]*B[2-i]*2;
    }

    println!("{}",ans);



}

0