結果
問題 | No.2110 012 Matching |
ユーザー |
![]() |
提出日時 | 2022-10-28 21:29:55 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 163 ms / 2,000 ms |
コード長 | 648 bytes |
コンパイル時間 | 13,353 ms |
コンパイル使用メモリ | 378,740 KB |
実行使用メモリ | 7,296 KB |
最終ジャッジ日時 | 2024-07-06 00:30:31 |
合計ジャッジ時間 | 15,518 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 11 |
コンパイルメッセージ
warning: unused import: `std::collections::*` --> src/main.rs:2:5 | 2 | use std::collections::*; | ^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default
ソースコード
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);}}