/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 187ms 1.02 MiB
#3 Accepted 216ms 1.52 MiB

Code

#include<bits/stdc++.h>
using namespace std;
#define ll  long long
#define pb  push_back
#define all(x) (x).begin(), (x).end()
#define  gcd(a,b)  __gcd(a,b)
#define    lcm(a,b)  (a*b)/__gcd(a,b)
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

void solve(){
    ll sum=0,od=0;
    for(ll i=0; i<3; i++){
        ll x; cin>>x;
        sum+=x;
        if(x%2) od++;
    }
    if(od<=1) cout<<sum<<endl;
    else if(od==2) cout<<sum-1<<endl;
    else if(od==3) cout<<sum-2<<endl;
}

signed main()
{
    optimize();
    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:16:58
Judged At
2025-06-13 16:16:58
Judged By
Score
100
Total Time
216ms
Peak Memory
1.52 MiB