結果
| 問題 | No.2110 012 Matching |
| コンテスト | |
| ユーザー |
yamake
|
| 提出日時 | 2022-10-28 21:27:17 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 648 bytes |
| 記録 | |
| コンパイル時間 | 13,410 ms |
| コンパイル使用メモリ | 390,416 KB |
| 実行使用メモリ | 9,128 KB |
| 最終ジャッジ日時 | 2024-07-06 00:26:22 |
| 合計ジャッジ時間 | 15,645 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 11 |
コンパイルメッセージ
warning: unused import: `std::collections::*`
--> src/main.rs:2:5
|
2 | use std::collections::*;
| ^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unnecessary parentheses around `if` condition
--> src/main.rs:22:16
|
22 | if ((a + b + c) % 2 == 1) {
| ^ ^
|
= note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
|
22 - if ((a + b + c) % 2 == 1) {
22 + if (a + b + c) % 2 == 1 {
|
warning: unnecessary parentheses around `if` condition
--> src/main.rs:23:20
|
23 | if (b >= 1) {
| ^ ^
|
help: remove these parentheses
|
23 - if (b >= 1) {
23 + if b >= 1 {
|
ソースコード
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;
if ((a + b + c) % 2 == 1) {
if (b >= 1) {
res -= 1;
} else {
res -= 2;
}
}
}
println!("{}", res);
}
}
yamake