/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 2ms 540.0 KiB
#2 Wrong Answer 10ms 612.0 KiB

Code

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

namespace solve {
    namespace test_case {
        void main() {
            int a, b, c;
            cin >> a >> b >> c;
            int x = __gcd(__gcd(a, b), c);
            int v = min({a, b, c}) / x * x;
            if (v < min({a, b, c})) v += x;
            cout << (abs(a - v) + abs(b - v) + abs(c - v)) / x << '\n';
        }
    }

    void main() {
        ios::sync_with_stdio(false);
        cin.tie(nullptr);
        int t;
        cin >> t;
        while (t--) {
            test_case::main();
        }
    }
}

signed main() {
    solve::main();
}

Information

Submit By
Type
Submission
Problem
P1061 Bring equality
Contest
Brain Booster #4
Language
C++17 (G++ 13.2.0)
Submit At
2024-07-14 16:12:27
Judged At
2024-11-11 03:24:33
Judged By
Score
0
Total Time
10ms
Peak Memory
612.0 KiB