/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Accepted 105ms 1.109 MiB
#3 Accepted 111ms 1.582 MiB

Code

// Author: Shawn Das Shachin-->(shawn_das)

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define pb push_back
#define mod 1000000007
#define srt(v) sort(v.begin(),v.end())
#define rsrt(v) sort(v.rbegin(),v.rend())
#define OPTIMIZE_IO ios::sync_with_stdio(false); cin.tie(nullptr);
#define setbit(x) __builtin_popcount(x);
#define printp(v) { for(auto &it : v) std::cout << it.first << " " << it.second << std::endl; }
#define printarr(arr) { for(auto &it : arr) std::cout << it << " "; std::cout << std::endl; }

void solve() {
    ll n,m,k;
    cin>>n>>m>>k;

    ll sum=n+m+k;
    if(sum==3 || sum==4){
        cout<<sum<<endl;
        return;
    }
    else{
        int count=0;
        if(n%2)count++;
        if(m%2)count++;
        if(k%2)count++;

        if(count==2){
            cout<<sum-1<<endl;
            return;
        }
        if(count==3){
            cout<<sum-2<<endl;
            return;
        }
        else{
            cout<<sum<<endl;
            return;
        }
    }

}

int main() {
    OPTIMIZE_IO;
    int 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:09:12
Judged At
2025-06-13 16:09:12
Judged By
Score
100
Total Time
111ms
Peak Memory
1.582 MiB