/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Accepted 99ms 1.02 MiB
#3 Accepted 108ms 1.566 MiB

Code

#define ll long long
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
using namespace std;
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
std::string toBinaryString(long long num) {
std::bitset<64> binary(num);
return binary.to_string();
}
long long binaryToLongLong(const std::string& binary) {
std::bitset<64> binarySet(binary);
return static_cast<long long>(binarySet.to_ullong());
}
bool compareByFirst(const std::pair<ll, ll>& a, const std::pair<ll, ll>& b) {
return a.first < b.first; // Ascending order by the first element
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
    long long t;
    cin>>t;
    while(t--){
        long long n;
        cin>>n;
        ll m;
        cin>>m;
        ll q;
        cin>>q;
        ll ans=(n/2)*2+(m/2)*2+(q/2)*2;
        if(n%2==1)
        ans++;
        else if(m%2==1)
        ans++;
        else
        if(q%2)
        ans++;
        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 16:03:40
Judged At
2025-06-13 16:03:40
Judged By
Score
100
Total Time
108ms
Peak Memory
1.566 MiB