結果
問題 | No.2110 012 Matching |
ユーザー |
👑 |
提出日時 | 2022-11-07 13:17:46 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 366 ms / 2,000 ms |
コード長 | 367 bytes |
コンパイル時間 | 575 ms |
コンパイル使用メモリ | 66,752 KB |
最終ジャッジ日時 | 2025-02-08 19:08:11 |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 11 |
ソースコード
#include <iostream> using namespace std; void solve(){ long long a,b,c;cin>>a>>b>>c; long long ans = b/2*2; b%=2; if(a<c){ ans += a*2; c-=a; a = 0; }else{ ans += c*2; a-=c; c = 0; } if(a && b){ ans++; a--;b--; } ans += c/2; cout << ans << endl; } int main(){ int n;cin>>n; for(int i = 0; n > i; i++)solve(); }