/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Accepted 1ms 508.0 KiB
#3 Accepted 1ms 552.0 KiB
#4 Accepted 1ms 328.0 KiB
#5 Accepted 1ms 540.0 KiB
#6 Accepted 2ms 372.0 KiB
#7 Accepted 1ms 540.0 KiB
#8 Accepted 1ms 540.0 KiB
#9 Accepted 1ms 540.0 KiB
#10 Accepted 1ms 332.0 KiB
#11 Accepted 1ms 588.0 KiB
#12 Accepted 1ms 540.0 KiB
#13 Accepted 1ms 488.0 KiB

Code

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

int main(){
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int a, b, c, ans = 400, x = 360, y = 360, z = 360;
    cin >> a >> b >> c;
    for (int i = 0; i <= 360; i++){
        int p, q, r;
        p = i - a;
        q = i - b;
        r = i - c;
        if (abs(p + q + r) < ans){
            ans = abs(p + q + r);
            x = p, y = q, z = r;
        }
    }
    cout << x << " " << y << " " << z << endl;
}

Information

Submit By
Type
Submission
Problem
P1130 Angle Equalizer
Contest
Happy New Year 2025
Language
C++17 (G++ 13.2.0)
Submit At
2025-01-02 14:47:09
Judged At
2025-01-02 14:47:09
Judged By
Score
100
Total Time
2ms
Peak Memory
588.0 KiB