/ SeriousOJ /

Record Detail

Compile Error

foo.cc: In function 'void solve::test_case::main()':
foo.cc:12:42: error: 'k' was not declared in this scope
   12 |             if (v < min({a, b, c})) v += k;
      |                                          ^

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 += k;
            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:01
Judged At
2024-11-11 03:24:33
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes