/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 187ms 1.02 MiB
#3 Accepted 194ms 1.594 MiB

Code

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#define debug(x) cerr << #x << " = " << x << endl
#else
#define debug(x)
#endif

using ll = long long;

void Solve()
{
    vector<ll> v(3);
    for(ll i=0; i<3; i++) cin >> v[i];
    ll cnt = 0, ans = 0;
    for(ll i=0; i<3; i++) (v[i]&1)? cnt : cnt += v[i];
    // debug(cnt);
    ans += cnt, cnt = 0;
    for(ll i=0; i<3; i++) (v[i]&1)? cnt = max(cnt, v[i]) : cnt;
    for(ll i=0; i<3; i++){
        if(cnt && v[i]==cnt){
            ans += cnt;
            cnt = 0;
        }else if(v[i]&1) ans += v[i]-1;
    }
    cout << ans << endl;
}

int32_t main()
{
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    ll t = 1;
    cin >> t;
    while (t--)
        Solve();
    return 0;
}

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 16:12:20
Judged At
2025-06-13 16:12:20
Judged By
Score
100
Total Time
194ms
Peak Memory
1.594 MiB