Accepted
Code
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
int main(){
int tc = 1;
cin >> tc;
while(tc--){
int a, b, c;
cin >> a >> b >> c;
ll ans = 0;
vector<ll> v;
v.pb(a), v.pb(b), v.pb(c);
sort(v.rbegin(), v.rend());
for(ll i=0; i<3; i++){
if(v[i] & 1){
ans += v[i];
v[i] = 0;
break;
}
}
for(ll i=0; i<3; i++){
if(v[i] & 1){
ans += v[i]-1;
}
else ans += v[i];
}
cout << ans << endl;
}
}
Information
- Submit By
- Type
- Submission
- Problem
- P1195 B. Palindrome
- Contest
- Brain Booster #10
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-06-13 15:47:55
- Judged At
- 2025-06-13 15:47:55
- Judged By
- Score
- 100
- Total Time
- 220ms
- Peak Memory
- 1.547 MiB