結果

問題 No.2110 012 Matching
コンテスト
ユーザー yamake
提出日時 2022-10-28 21:29:55
言語 Rust
(1.93.0 + proconio + num + itertools)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 648 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,726 ms
コンパイル使用メモリ 191,560 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-03-27 10:54:41
合計ジャッジ時間 5,513 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused import: `std::collections::*`
 --> src/main.rs:2:5
  |
2 | use std::collections::*;
  |     ^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default

ソースコード

diff #
raw source code

use proconio::*;
use std::collections::*;

fn main() {
    input! {
        t: i32,
    }
    for _z in 0..t {
        input! {
            a: i64,
            b: i64,
            c: i64,
        }
        let mut res: i64 = 0;
        res += b - b % 2;
        let b = b % 2;
        if a >= b + c {
            res += b + c * 2;
        } else {
            res += b + c * 2;
            res -= (b + c - a) / 2 * 3;
            if (a + b + c) % 2 == 1 {
                if b >= 1 {
                    res -= 1;
                } else {
                    res -= 2;
                }
            }
        }
        println!("{}", res);
    }
}
0