結果
問題 | No.2110 012 Matching |
ユーザー |
|
提出日時 | 2022-10-28 22:23:34 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 920 bytes |
コンパイル時間 | 1,302 ms |
コンパイル使用メモリ | 166,152 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-06 01:34:19 |
合計ジャッジ時間 | 3,988 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | WA * 11 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define rep(i, n) for (int i = 0; i < (int)(n); i++)typedef long long ll;template<typename T>bool chmax(T &a, const T& b){if(a<b){a=b;return true;}return false;}template<typename T>bool chmin(T &a, const T& b){if(a>b){a=b;return true;}return false;}int main(){int t;cin>>t;rep(z,t){ll a,b,c;cin>>a>>b>>c;ll ans=0;if(a>=c){ans+=(2*c);a=a-c;c=0;ans+=(2*(b/2));if(a==0 && b%2==1){cout<<ans<<endl;}else if(a>0 && b%2==1){cout<<ans+1<<endl;}else{cout<<ans<<endl;}}else{ans+=(2*a);c=c-a;a=0;ans+=(2*(b/2));ans+=(2*(c/2));cout<<ans<<endl;}}}