結果
問題 |
No.2110 012 Matching
|
ユーザー |
![]() |
提出日時 | 2023-09-23 23:52:33 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 312 ms / 2,000 ms |
コード長 | 979 bytes |
コンパイル時間 | 1,559 ms |
コンパイル使用メモリ | 192,372 KB |
最終ジャッジ日時 | 2025-02-17 01:50:19 |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 11 |
ソースコード
#include <bits/stdc++.h> #include<iostream> #include<map> #include<vector> #include <algorithm> #include<math.h> #include <iomanip> #include<set> #include <numeric> #include<string> using ll = long long; using namespace std; int main() { ll t, a, b, c; cin >> t; for (int i = 0; i < t; i++){ ll max1 = 0; cin >> a >> b >> c; if (a && c){ ll tmp = min(a, c); max1 += tmp*2; if (a >= c){ a -= c; c = 0; } else { c -= a; a = 0; } } if (b%2){ max1 += (b-1); b = 1; } else{ max1 += b; b = 0; } if (a && b){ max1++; a--; b = 0; } if (c && c%2){ max1 += (c - 1)/2; c = 1; } else if (c) max1 += c/2; cout << max1 << "\n"; } }