import math
n = float(input())
x = math.ceil((math.sqrt(8 * n + 1) - 1) / 2)
print(int(2*n-x))
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
10 ms |
2908 KB |
Output is correct |
2 |
Correct |
15 ms |
2936 KB |
Output is correct |
3 |
Correct |
14 ms |
2908 KB |
Output is correct |
4 |
Correct |
12 ms |
2860 KB |
Output is correct |
5 |
Correct |
10 ms |
2908 KB |
Output is correct |
6 |
Correct |
12 ms |
2904 KB |
Output is correct |
7 |
Correct |
10 ms |
2908 KB |
Output is correct |
8 |
Correct |
10 ms |
2908 KB |
Output is correct |
9 |
Correct |
10 ms |
2908 KB |
Output is correct |
10 |
Correct |
10 ms |
2920 KB |
Output is correct |
11 |
Incorrect |
10 ms |
2724 KB |
Output isn't correct |
12 |
Halted |
0 ms |
0 KB |
- |