/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 432.0 KiB
#2 Wrong Answer 21ms 576.0 KiB
#3 Wrong Answer 21ms 572.0 KiB
#4 Wrong Answer 20ms 576.0 KiB
#5 Wrong Answer 20ms 564.0 KiB
#6 Accepted 20ms 568.0 KiB
#7 Accepted 20ms 572.0 KiB
#8 Accepted 20ms 572.0 KiB
#9 Wrong Answer 20ms 568.0 KiB
#10 Wrong Answer 21ms 572.0 KiB

Code

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

#define ll long long
#define pb push_back
#define fast ios::sync_with_stdio(false);cin.tie(nullptr)

ll gcd(ll a, ll b) { 
    if (b == 0) 
        return a; 
    return gcd(b, a % b); 
}

ll lcm(ll a, ll b) { 
    return a / gcd(a, b) * b; 
}

string toupper(string a) { 
    for (int i = 0; i < (int)a.size(); ++i) 
        if (a[i] >= 'a' && a[i] <= 'z') 
            a[i] -= 32; 
    return a; 
}

string tolower(string a) { 
    for (int i = 0; i < (int)a.size(); ++i) 
        if (a[i] >= 'A' && a[i] <= 'Z') 
            a[i] += 32; 
    return a; 
}

bool prime(ll a) { 
    if (a == 1) 
        return false; 
    for (int i = 2; i <= round(sqrt(a)); ++i) 
        if (a % i == 0) 
            return false; 
    return true; 
}

constexpr long long pow(long long a, long long b) {
    long long res = 1;
    for (; b; b /= 2, a *= a) {
        if (b % 2)
            res *= a;
    }
    return res;
}

constexpr int factorial(int k) {
    int res = 1;
    for (int i = 2; i <= k; i++)
        res *= i;
    return res;
}

bool check() {
    return true;
}

bool cmp(pair<int, int> a, pair<int, int> b) {
    if (a.first == b.first) return (a.second > b.second);
    return (a.first < b.first);
}

bool check(int a, int b, int c) {
    if ( a== b && b == c && a == c) {
        return true;
    }
    else return false;
}

int main () {
    fast;
    int tc;
    cin >> tc;
    while (tc--) {
        int a, b, c, ans=0;
        cin >> a >> b >> c;

        if (a == b) {
            if (b != c) {
                cout << 1 << endl;
            }
            else {
                cout << 0 << endl;
            }
        }
        else if (b == c) {
            if (b != a) {
                cout << 1 << endl;
            }
            else {
                cout << 0 << endl;
            }
        }
        else if (a == c) {
            if (b != a) {
                cout << 1 << endl;
            }
            else {
                cout << 0 << endl;
            }
        }
        else if (a == b && b == c && a == c) {
            cout << 0 << endl;
        }
        else if (a != b && b != c && a != c) {
            cout << 2 << endl;
        }
        
    }
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1061 Bring equality
Contest
Brain Booster #4
Language
C++20 (G++ 13.2.0)
Submit At
2024-07-14 16:04:58
Judged At
2024-10-03 13:38:33
Judged By
Score
40
Total Time
21ms
Peak Memory
576.0 KiB