/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 1ms 320.0 KiB
#2 Wrong Answer 30ms 552.0 KiB

Code

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

int minOperationsToEqualize(int A, int B, int C) {
    vector<int> nums = {A, B, C};
    sort(nums.begin(), nums.end());
    int median = nums[1];
    return (abs(A - median) + abs(B - median) + abs(C - median)) / median;
}

int main() {
    int T;
    cin >> T;
    while (T--) {
        int A, B, C;
        cin >> A >> B >> C;
        cout << minOperationsToEqualize(A, B, C) << endl;
    }
    return 0;
}

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 17:30:28
Judged At
2024-11-11 03:22:55
Judged By
Score
0
Total Time
30ms
Peak Memory
552.0 KiB