/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 0ms 284.0 KiB
#2 Accepted 0ms 284.0 KiB
#3 Accepted 0ms 284.0 KiB
#4 Accepted 0ms 284.0 KiB
#5 Accepted 0ms 284.0 KiB
#6 Accepted 0ms 284.0 KiB
#7 Accepted 0ms 284.0 KiB
#8 Accepted 0ms 284.0 KiB
#9 Accepted 0ms 284.0 KiB
#10 Accepted 0ms 340.0 KiB
#11 Accepted 0ms 284.0 KiB
#12 Accepted 0ms 356.0 KiB
#13 Accepted 0ms 284.0 KiB

Code

#include <stdio.h>

void alignBlades(int a1, int a2, int a3) {
    int targetAngle = (a1 + a2 + a3) / 3;
    int pos1 = targetAngle - a1;
    int pos2 = targetAngle - a2;
    int pos3 = targetAngle - a3;

    printf("%d %d %d\n", pos1, pos2, pos3);
}

int main() {
    int a1, a2, a3;
    scanf("%d %d %d", &a1, &a2, &a3);

    if (a1 + a2 + a3 != 360) {
        printf("Angles do not sum to 360. Please check the input.\n");
        return 1;
    }

    alignBlades(a1, a2, a3);
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1130 Angle Equalizer
Contest
Happy New Year 2025
Language
C99 (GCC 13.2.0)
Submit At
2025-01-02 14:42:14
Judged At
2025-01-02 14:42:14
Judged By
Score
100
Total Time
0ms
Peak Memory
356.0 KiB