| //https://www.acmicpc.net/problem/1568 #include <iostream> | |
| using namespace std; | |
| int main(){ | |
| int n; | |
| cin >>n; | |
| int ans=0; | |
| while(1){ | |
| for(int i=1; n>=i ; i++){ | |
| n-=i; | |
| ++ans; | |
| } | |
| if(n==0) break; | |
| } | |
| cout << ans <<endl; | |
| return 0; | |
| } |
'알고리즘 문제 풀이 > 1DP_과제(~180615)' 카테고리의 다른 글
| 180427_2959_거북이 (0) | 2018.04.27 |
|---|---|
| 180426_1236_성 지키기 (0) | 2018.04.26 |
| 180424_1032_베스트셀러 (0) | 2018.04.24 |
| 180424_1068_트리 (0) | 2018.04.24 |
| 180423_1003_피보나치 함수 (0) | 2018.04.23 |