1. R1/2 + R2/2 = S (기본식)

2. R1/2 - S = -R2/2 (이항)

3. R2=2S-R1 (더 간단한 식)

#include <cstdio>
/**
* https://www.acmicpc.net/problem/3046
* BOJ 백준온라인져지 3046 R2 풀이
*/
int main () {
float R1, S;
scanf("%f%f", &R1, &S);
printf("%d", (int)((R1/2-S)*-2));
}
view raw BOJ_3046.cpp hosted with ❤ by GitHub


+ Recent posts