import math
n = float(input())
x = math.ceil((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 |
10 ms |
2908 KB |
Output is correct |
3 |
Correct |
10 ms |
2924 KB |
Output is correct |
4 |
Correct |
10 ms |
2896 KB |
Output is correct |
5 |
Correct |
10 ms |
2820 KB |
Output is correct |
6 |
Correct |
10 ms |
2952 KB |
Output is correct |
7 |
Correct |
10 ms |
2876 KB |
Output is correct |
8 |
Correct |
10 ms |
2828 KB |
Output is correct |
9 |
Correct |
10 ms |
2956 KB |
Output is correct |
10 |
Correct |
10 ms |
2908 KB |
Output is correct |
11 |
Incorrect |
10 ms |
2740 KB |
Output isn't correct |
12 |
Halted |
0 ms |
0 KB |
- |