1. R1/2 + R2/2 = S (기본식)
2. R1/2 - S = -R2/2 (이항)
3. R2=2S-R1 (더 간단한 식)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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)); | |
} |
'IT > 알고리즘' 카테고리의 다른 글
BOJ 백준온라인져지 1076 저항 풀이 (0) | 2018.02.17 |
---|---|
BOJ 백준온라인져지 2010 플러그 풀이 (0) | 2018.02.17 |
BOJ 백준온라인져지 4963 섬의 개수 풀이 (0) | 2018.02.13 |
BOJ 백준온라인져지 11004 K번째 수 풀이 (0) | 2018.02.10 |
BOJ 백준온라인져지 1219 오민식의 고민 풀이 (0) | 2018.02.08 |