/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Accepted 102ms 1.094 MiB
#3 Wrong Answer 113ms 1.52 MiB

Code

#include <iostream>
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define pb push_back
#define vi vector<int>
#define vll vector<ll>
#define mp make_pair
#define pq priority_queue<int>
#define pi pair<int, int>
#define pll pair<ll, ll>
#define all(x) (x).begin(), (x).end()
#define f(i, n) for (int i = 0; i < n; i++)
#define PI acos(-1)
const int M = 1e9 + 7;
ll binExp(ll a, ll b)
{
    int res = 1;
    while (b)
    {
        if (b & 1)
            res = res * a;
        a *= a;
        b /= 2;
    }
    return res;
}
ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
ll lcm(ll a, ll b)
{
    return (a / gcd(a, b)) * b;
}
void solve()
{
    int a, b, c;
    cin >> a >> b >> c;
    int odd = 0;
    if (a % 2 == 1)
        odd++;
    if (b % 2 == 1)
        odd++;
    if (c % 2 == 1)
        odd++;
    if (!odd)
        cout << a + b + c << endl;
    else
    {
        int ans = a + b + c;
        ans -= (odd - 1);
        cout << ans << endl;
    }
}
int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t;
    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 15:36:07
Judged At
2025-06-13 15:36:07
Judged By
Score
50
Total Time
113ms
Peak Memory
1.52 MiB