Problem:


Score : 200 points

Problem Statement

There is a kangaroo at coordinate 0 on an infinite number line that runs from left to right, at time 0.
During the period between time i-1 and time i, the kangaroo can either stay at his position, or perform a jump of length exactly i to the left or to the right.
That is, if his coordinate at time i-1 is x, he can be at coordinate x-i, x or x+i at time i.
The kangaroo's nest is at coordinate X, and he wants to travel to coordinate X as fast as possible.
Find the earliest possible time to reach coordinate X.

Constraints

X is an integer.

1≤X≤10^9

Input

The input is given from Standard Input in the following format:

X

Output

Print the earliest possible time for the kangaroo to reach coordinate X.

Sample Input 1

6

Sample Output 1

3

The kangaroo can reach his nest at time 3 by jumping to the right three times, which is the earliest possible time.

Sample Input 2

2

Sample Output 2

2

He can reach his nest at time 2 by staying at his position during the first second, and jumping to the right at the next second.

Sample Input 3

11

Sample Output 3

5



Sample input:
6


Sample output:
3

Submission status: Accepted

Solution code:
X = int(input())

i = 1
x = 1
while(x <= X):
  x += i
  i += 1
  
print(i - 1)

Submission status: Accepted

Solution code:

X = int(input())

s = 1
i = 1
while s <= X:
    s += i
    i += 1
    # print("s:{}, i:{}".format(s, i))

print(i-1)

Submission status: Accepted

Solution code:
x = int(input())
t = 1
s = 1

while s < x:
    s += t+1
    t += 1

print(t)

Submission status: Accepted

Solution code:
X = int(input())

t = 1
while True:
    if t*(t+1)//2 >= X:
        break
    else:
        t += 1
print(t)

Submission status: Accepted

Solution code:
x = int(input())
n = (2*x+0.25)**0.5-0.5
m = int(n)
if n > m:
  m += 1
print(m)

Submission status: Accepted

Solution code:
x=int(input())
for i in range(1,x+1):
    if i*(i+1)//2>=x:
        print(i)
        break

Submission status: Accepted

Solution code:
X = int(input())
t = 0

for n in range(X):
  t += 1
  if X <= (t * (t+1)) // 2:
    break

print(t)

Submission status: Accepted

Solution code:
import math
print(math.ceil((-1+((1+8*int(input()))**(1/2)))/2))

Submission status: Accepted

Solution code:
x = int(input())

t =0

for i in range(10**5):
	t += 1
	if x< (i*(i+1)//2)+1:
		break
print(t-1)

Submission status: Accepted

Solution code:
x = int(input())

c = 0
k = 1
while True:
    c += k
    if c >= x:
        break
    k += 1

print(k)

Submission status: Accepted

Solution code:
X = int( input())
now = 0
for i in range(10**5):
    if X*2 > i*(i+1):
        pass
    else:
        print(i)
        break

Submission status: Accepted

Solution code:
x = int(input())
ans = 0

while ans*(ans+1)//2 < x:
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
x = int(input())
ans = 0

for i in range(1,x+1):
    if x > 0:
        ans += 1
        x -= i
    else:
        break

print(ans)

Submission status: Accepted

Solution code:
import math

X = int(input())
N = int(math.sqrt(2*X))
if N*(N+1) >= 2*X:
    N = N
else:
    N += 1
print(N)

Submission status: Accepted

Solution code:
x = int(input())
ans, temp, idx = 0, 0, 1
while temp <= x:
  temp += idx
  idx += 1
  ans += 1
  if temp >= x:
    break
print(ans)

Submission status: Accepted

Solution code:
X = int(input())
t = 1
max_t = (t* (t+1)) // 2

# t=1で1 t=2で 2,3 t= 3で 4, 5, 6  t=4で 7,8,9,10  t=5で 11,12,13,14,15までいける

while max_t < X:
    
    t += 1 
    max_t = (t* (t+1)) // 2
    
print(t)

Submission status: Accepted

Solution code:
x=int(input())
t=0
while t*(t+1)/2<x:
    t+=1
print(t)

Submission status: Accepted

Solution code:
x = int(input())
long = 0
i = 0
while True:
    long += i
    if long >= x:
        print(i)
        break
    i += 1

Submission status: Accepted

Solution code:
x = int(input())
print(int(-(-(-1+(1+8*x)**.5)//2)))

Submission status: Accepted

Solution code:
x = int(input())

ans = 0
i = 0

while True:
    if ans >= x:
        print(i)
        break
    
    i += 1
    ans += i

Submission status: Accepted

Solution code:
X = int(input())
ans = 0
for i in range(X + 1):
    ans += i
    if ans >= X:
        break
print(i)

Submission status: Accepted

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def main():
    X = int(input())

    total = 0
    for i in count(1):
        total += i
        if total >= X:
            print(i)
            return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
cou = 0
num = 0
while num < n:
  cou += 1
  num += cou
print(cou)

Submission status: Accepted

Solution code:
X = int(input())
flag = False
for i in range(100000):
  if (i*(i+1)//2 < X <= (i+1)*(i+2)//2):
    flag = True
    break
print(i+1)

Submission status: Accepted

Solution code:
def tria(n):
  return n * (n+1) // 2

X = int(input())

l = 0
r = int(1e9)

while l+1<r:
  mid = (l+r)//2
  if tria(mid) < X:
    l = mid
  else:
    r = mid
    
print(r)

Submission status: Accepted

Solution code:
x = int(input())
a = 0
for i in range(1, 10 ** 9):
    if a >= x:
        print(i - 1)
        break
    a += i

Submission status: Accepted

Solution code:
x = int(input())

a = []
num = 0
for i in range(1, 10**5):
    num += i
    a.append(num)

for i in range(len(a)):
    if a[i] >= x:
        print(i+1)
        break

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

def li(): return [int(x) for x in stdin.readline().split()]
def li_(): return [int(x)-1 for x in stdin.readline().split()]
def lf(): return [float(x) for x in stdin.readline().split()]
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(ns())
def nf(): return float(ns())

from itertools import accumulate
from bisect import bisect_left

x = ni()
jump = [i for i in range(1,10**5)]
jump_cum = list(accumulate(jump))
print(bisect_left(jump_cum, x) + 1)

Submission status: Accepted

Solution code:
X = int(input())
now = 0
maxjump = 1
while now+maxjump < X:
    now += maxjump
    maxjump += 1
print(maxjump)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Sep  2 11:49:26 2018
ABC056C
@author: maezawa
"""

x = int(input())

fib = [0]
i = 1
j = 0
while True:
    j = fib[i-1] + i
    fib.append(j)
    if j >= x:
        break
    i += 1
if x == 0:
    print(0)
else:
    print(i)

Submission status: Accepted

Solution code:
x=int(input())
a=0
for i in range(1,10**9):
    if a>=x:
        print(i-1)
        break
    a +=i

Submission status: Accepted

Solution code:
x=int(input())
n=int((2*x)**0.5)
if n*(n-1)<2*x<=n*(n+1):
    print(n)
elif (n-1)*(n-2)<2*x<=n*(n-1):
    print(n-1)
else:
    print(n+1)

Submission status: Accepted

Solution code:
import math
X=int(input())
ans=int(-(-((-1+math.sqrt(8*X+1))/2)//1))
print(ans)

Submission status: Accepted

Solution code:
X = int(input())

i = 0
while True:
    if i*(i+1)/2 >= X:
        print(i)
        break
    i += 1

Submission status: Accepted

Solution code:
n = int(input())
i = 1;
while(True):
    if((i ** 2 + i) // 2 >= n):
        break
    i += 1
print(i)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
x = 0
while(x < n):
    x += ans
    ans += 1
print(ans - 1)

Submission status: Accepted

Solution code:
import math
N = int(input())
# N = m * (m - 1) / 2
M = int(math.sqrt(2 * N))

while 1:
    if M * (M + 1) / 2 < N:
        M = M + 1
    else:
        print(M)
        break

Submission status: Accepted

Solution code:
import math
print(math.ceil((math.sqrt(8*int(input())+1)-1)/2))

Submission status: Accepted

Solution code:
print(int((8*int(input())-7)**.5/2+.5))

Submission status: Accepted

Solution code:
import math
print(math.ceil((1+8*int(input()))**.5/2-.5))

Submission status: Accepted

Solution code:
a = int(input())
i = 1
j = 0
ans = 0
while True:
    ans += 1
    j += i
    i += 1
    if j >= a:
      print(ans)
      break

Submission status: Accepted

Solution code:
#-*-coding:utf-8-*-

def main():
    x = int(input())

    i = 1
    j = 0
    ans = 0
    while True:
        ans += 1
        j += i
        i += 1
        if j >= x:
            print(ans)
            break



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

x = int(input())

print(math.ceil(((8*x + 1) ** (1/2)) / 2 - (1/2)))

Submission status: Accepted

Solution code:
X = int(input())

ans = 0
a, i = 0, 1
while a < X:
    a += i
    i += 1
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
x = int(input())
for i in range(100000):
    if x - i * (i + 1) // 2 <= 0:
        print(i)
        break

Submission status: Accepted

Solution code:
x = int(input())
ans = 0
cnt = 1
while x > 0:
    x -= cnt 
    cnt += 1
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

ans = 0
i = 1
while n > ans :
	ans += i
	i += 1

print i-1

Submission status: Accepted

Solution code:
v=0
e=1
n=int(input())
while 1:
  v+=e
  if n<=v:
    print(e)
    break
  e+=1

Submission status: Accepted

Solution code:
import math
x = int(input())

i = (2*x+1/4)**(1/2)-1/2
print(math.ceil(i))

Submission status: Accepted

Solution code:
x = int(input())

i = 1
ans = 0
while True:
    ans += i
    if ans >= x:
        print(i)
        break
    i += 1

Submission status: Accepted

Solution code:
N = int(input())
X = []
x = 1
i = 1
while x<10**9+1:
    X.append(x)
    i += 1
    x += i
X.append(x)
    
for i,x in enumerate(X):
    if x < N:
        continue
    else:
        print(i+1)
        break

Submission status: Accepted

Solution code:
X = int(input())
n=0

while(True):
    n += 1
    if n*(n + 1) // 2 >= X:
        print(n)
        break

Submission status: Accepted

Solution code:
from collections import defaultdict
import sys,heapq,bisect,math,itertools,string
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7

X = int(input())
N = int(math.sqrt(2*X))-1

while True:
	if N*(N+1)//2 >= X:
		print(N)
		break
	N += 1

Submission status: Accepted

Solution code:
x = int(input())

for i in range(1, x+1):
    if (i*(i+1)>=2*x):
        print(i)
        exit()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

X = int(input())

sum1 = 0
i = 1
while True:
    sum1 += i
    if sum1 >= X:
        print(i)
        exit()
    i += 1

Submission status: Accepted

Solution code:
X = int(input())

t = 1
while True:
    if 0.5 * t * (t + 1) >= X:
        print(t)
        exit()
    t += 1

Submission status: Accepted

Solution code:
import math
x = int(input())
print(math.ceil(math.sqrt(2 * x + 0.25) - 0.5))

Submission status: Accepted

Solution code:
import math
X = int(input())
print(int(0.5 + math.sqrt(2 * X)))

Submission status: Accepted

Solution code:
X = int(raw_input())
for i in range(100000):
  if i*(i+1)//2 >= X:
    print i
    break

Submission status: Accepted

Solution code:

def main():
    x = int(input())

    ans = 0
    c = 0
    for i in range(1,100000000):
        ans+=1
        c +=i
        if c >= x:
            print(ans)
            exit()



if __name__ == "__main__":
        main()

Submission status: Accepted

Solution code:
n=int(input())

now=0
c=1

while now<n:
  now+=c
  c+=1
  
print(c-1)

Submission status: Accepted

Solution code:
# input
X = int(input())

i = 1
while 2 * X > i * (i + 1):
    i += 1

print(i)

Submission status: Accepted

Solution code:
x = int(input())

pos = 0
i = 0
while x > pos:
    i += 1
    pos += i

print(i)

Submission status: Accepted

Solution code:
X = int(input())
i =0
while i*(i+1)//2<X:
  i += 1
print(i)

Submission status: Accepted

Solution code:
X = int(input())
ans = pow(10, 9)
for t in range(X + 1):
  if t*(t+1) / 2 >= X and t < ans:
    ans = t
    break
print(ans)

Submission status: Accepted

Solution code:
import math
print(math.ceil((math.sqrt(8*int(input())+1)-1)/2))

Submission status: Accepted

Solution code:
x=int(input())
for i in range(10**6):
    if i**2+i>=x*2:
        print(i)
        break

Submission status: Accepted

Solution code:
x = int(input())
 
for i in range(1, 10000000):
    x -= i
    if x <= 0:
        break
print(i)

Submission status: Accepted

Solution code:
X = int(input())

result = 0
for i in range(0, X):
    result += (i+1)
    if X <= result:
        print(i+1)
        break

Submission status: Accepted

Solution code:
X = int(input())

ls = [0]*100000
for i in range(1,100000):
    ls[i] = ls[i-1] + i 
    if X <= ls[i]:
        print(i)
        break

Submission status: Accepted

Solution code:
X = int(input())
memo = [0]*100000
for i in range(1,100000):
    memo[i] = memo[i-1] + i
    if memo[i] >= X:
        print(i)
        break

Submission status: Accepted

Solution code:
def m():
    x = int(input())
    i = 0
    while (i*(i+1)//2) <= x*2:
        if x <= (i*(i+1)//2):
            return i
        i+=1

print(m())

Submission status: Accepted

Solution code:
X = int(input())
ans = 1
mx = 1
while mx < X:
    ans += 1
    mx += ans
print(ans)

Submission status: Accepted

Solution code:
x=int(input())
import math
print(math.ceil((-1+math.sqrt(1+8*x))/2))

Submission status: Accepted

Solution code:
X = int(input())
lo = 1
hi = X
while hi - lo > 1:
    m = (hi+lo)//2
    if m*(m+1)//2 >= X:
        hi = m
    else:
        lo = m
if lo*(lo+1)//2 >= X:
    print(lo)
else:
    print(hi)

Submission status: Accepted

Solution code:
x = int(input())
s, i = 0, 0

while s < x:
    i += 1
    s += i

print(i)

Submission status: Accepted

Solution code:
x = int(input())
import math as m
print(m.ceil((-1 + m.sqrt(1 + 8 * x)) / 2))

Submission status: Accepted

Solution code:
x = int(input())
now = 0
t = 0
while now < abs(x):
    t += 1
    now = now + t
print(t)

Submission status: Accepted

Solution code:
X = int(input())

s = 0
t = 0
while True:
    t += 1
    s += t
    if s >= X:
        print(t)
        exit(0)

Submission status: Accepted

Solution code:
x = int(input())
i = 1

while True:
  if x <= 0:
    print(i-1)
    break
  
  x -= i
  i += 1

Submission status: Accepted

Solution code:
from math import sqrt
x = int(input())
a = int(sqrt(2*x))
if a * (a + 1) < 2 * x: a+=1
print(a)

Submission status: Accepted

Solution code:
m=int(input())
import math
print(math.ceil((-1+math.sqrt(1+8*m))/2))

Submission status: Accepted

Solution code:
N=int(input())
i=0
w=0
while i<N:
    w+=1
    i+=w
print(w)

Submission status: Accepted

Solution code:
x = int(input())

for i in range(1, 10000000):
    x -= i
    if x <= 0:
        break
print(i)

Submission status: Accepted

Solution code:
X = int(input())
ans = 0
d = 1
while d <= X:
    ans += 1
    d += ans
print(ans)

Submission status: Accepted

Solution code:
X = int(input())
maxX = 0
for i in range(1,X+1):
    maxX += i
    if maxX >= X:
        print(i)
        break

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

# AtCoder Beginner Contest
# Problem C

if __name__ == '__main__':
    x = int(input())

    i = 1
    pre = 0
    current = i

    while True:
        if pre < x <= current:
            print(i)
            exit()

        pre = current
        i += 1
        current += i

Submission status: Accepted

Solution code:
x=int(input())

i=1
while i*(i+1)/2<x:
    i+=1
print(i)

Submission status: Accepted

Solution code:
x = int(input())

n = int(x **.5)
while n*(n+1) < 2*x:
    n += 1
print(n)

Submission status: Accepted

Solution code:
x = int(input())
i = (-1+(1+8*x)**0.5)/2
if int(i) == i:
  print(int(i))
else:
  print(int(i)+1)

Submission status: Accepted

Solution code:
X=int(input())
cnt=1
ans=0
while True:
  ans+=cnt
  if ans >= X:
    break
  cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
x=int(input())
tot,i=0,0
while tot<x:
    i+=1
    tot+=i
print(i)

Submission status: Accepted

Solution code:
x = int(input())
total = 0
t = 0
while total < x: 
    t += 1
    total += t
print(t)

Submission status: Accepted

Solution code:
def sum_naturals(n):
    return (n * (1 + n)) / 2

def jump(x):
    i = 0
    while x > sum_naturals(i):
        i += 1
    return i


if __name__ == '__main__':
    x = int(input())
    print(jump(x))

Submission status: Accepted

Solution code:
x = int(input())
i = 1
while i * (i + 1) // 2 < x: i += 1
print(i)

Submission status: Accepted

Solution code:
n = int(input())
num = 0
for i in range(n+1):
	num += i
	if n<=num:
		print(i)
		break

Submission status: Accepted

Solution code:
X = int(input())
j=0
for i in range(X*2):
    if (i*(i+1))//2<=X<=((i+1)*(i+2))//2:
        j=i
        break
print(j+1)

Submission status: Accepted

Solution code:
x=int(input())
t=1
while(1):
  if((t*(t+1))/2>=x):break
  t+=1
print(t)

Submission status: Accepted

Solution code:
x = int(input())

def foo():
    n = 0
    s = 0
    while True:
        n += 1
        s = s + n
        yield n, s

for n, s in foo():
    if s >= x:
        print(n)
        break

Submission status: Accepted

Solution code:
X = int(input())
 
i = 0
while i * (i + 1) / 2 < X:
    i += 1
 
print(i)

Submission status: Accepted

Solution code:
import math
n=int(input())
i=0
x=0
while 1:
  if n <= x:
    break
  i+=1
  x+=i

print(i)

Submission status: Accepted

Solution code:
x=int(input())
import math
print(math.ceil((-1+math.sqrt(1+8*x))/2))
#{1,2,3,..n}はΣｋなので 1/2n(n+1)=xを解くとできる

Submission status: Accepted

Solution code:
x=int(input())
import math
print(math.ceil((-1+math.sqrt(1+8*x))/2))

Submission status: Accepted

Solution code:
n=int(input())
count,add=0,0
while True:
    if n<=count:
        break
    add+=1
    count+=add
print(add)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for i in range(1, N+1):
   if i * (i + 1) // 2 >= N:
       ans = i
       break
print(ans)

Submission status: Accepted

Solution code:
X = int(input())
sum = 0
cnt = 1
while(True):
    sum += cnt
    if(sum >= X):
        break
    cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
def solve():
    X = int(input())
    fibsum = 0
    cnt = 0
    while fibsum < X:
        cnt += 1
        fibsum += cnt
    print(cnt)
    
solve()

Submission status: Accepted

Solution code:
X = int(input())

sumval = 0
for i in range(1,X+1):
	sumval += i
	if sumval >= X:
		ans = i
		break

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
count,add=0,0
while 1:
    if n<=count:
        break
    add+=1
    count+=add
print(add)

Submission status: Accepted

Solution code:
import math
def test(n):
    n=math.ceil((-1+math.sqrt(1+8*n))/2)
    return n
n=int(input())
print(test(n))

Submission status: Accepted

Solution code:
import math
def test(n):
    n=math.ceil((-1+math.sqrt(1+8*n))/2)
    return n
n=int(input())
print(test(n))

Submission status: Accepted

Solution code:
def c_GoHome(X):
    """
    1+2+...+n>=Xとなる最小のnがわかれば、時刻nで到達できる。
    (時刻iに右に跳ぶか、なにもしないかのどちらかを行う)
    左辺はn(n+1)/2なので、n^2+n-2X=0の正の解を切り上げたものが求める解である。
    よって、方程式を解いて、n_min=ceil( (-1+√(1+8X))/2 )を得られる。
    """
    import math
    n = math.ceil((-1 + math.sqrt(1 + 8 * X)) / 2)
    return n

X = int(input())
print(c_GoHome(X))

Submission status: Accepted

Solution code:
X = int(input())

sum = 0
for t in range(1, X+1):
    if t*(t+1)//2 >= X:
        print(t)
        exit()

Submission status: Accepted

Solution code:
num = int(input())

for i in range(45000):
    res = i * (i + 1) / 2
    if res >= num:
        print(i)
        break

Submission status: Accepted

Solution code:
n = int(input())
l = []

def f(n, l):
  sum = 0
  for i in range(1, n+1):
    sum += i
    if sum >= n:
      return i

print(f(n, l))

Submission status: Accepted

Solution code:
def limit():
    """
    i=44721

    全探索
    0 = [0]
    1 = [1,-1,0]と0の組合せ
    2 = [2,-2,0]と1の組合せ
    3**44721 => 無理
    """
    s = 0
    x = 10 ** 9
    for i in range(x):
        s += i
        if s >= x:
            print(i)
            break


def TLE(X):
    """
    11
    1 {0, 1, -1}
    2 {0, 1, 2, 3, -3, -1, -2}
    3 {0, 1, 2, 3, 4, 5, 6, -6, -5, -4, -3, -1, -2}
    4 {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -10, -9, -8, -7, -6, -5, -4, -3, -1, -2}
    ans: 5
    """
    from itertools import product
    pos = set([0])
    for i in range(1, X + 1):
        for x, y in product(pos, (i, -i, 0)):
            if x + y == X:
                return i
            pos.add(x + y)
        print(i, pos)


def main():
    X = int(input())

    s = 0
    for i in range(1, X + 1):
        s += i
        if X <= s:
            print(i)
            break

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=input()
left=1
right=10**9

while left <= right:
	center = (left + right)/2
	x=(1+center)*center/2
	#print left,center,right,x,N
	if x==N:
		print center
		break
	elif x<N and abs(N-x)<center+1:
		print center+1
		break
	elif x<N:
		left=center+1
	else:
		right=center-1
else:
	print center+1

Submission status: Accepted

Solution code:
X = int(input())

count, addition = 0, 0
while 1:
    if X <= count:
        break

    addition += 1
    count += addition

print(addition)

Submission status: Accepted

Solution code:
a = int(input())
i = 1
R = 0
while a > R:
 R = R+i
 i = i+1
print(i-1)

Submission status: Accepted

Solution code:
X = int(input())
i = 1
ans = 1
while X > ans:
    i += 1
    ans += i
print(i)

Submission status: Accepted

Solution code:
X = int(input())

for n in range(10000000):
  if X <= n*(n+1)//2:
    print(n)
    import sys
    sys.exit()

Submission status: Accepted

Solution code:
X = int(input())

t = 1

while X > t * (t + 1) / 2:
    t += 1
print(t)

Submission status: Accepted

Solution code:
p = int(input())
ii=0
for i in range(50000):
    ii+=i
    if ii>=p:
        print(i)
        break

Submission status: Accepted

Solution code:
print(int((1+(8*int(input())-7)**0.5)/2))

Submission status: Accepted

Solution code:
X = int(input())
i = 0
x = 0
while x < X:
    i += 1
    x += i
print(i)

Submission status: Accepted

Solution code:
import math

X = int(input())
print( math.ceil( (-1 + math.sqrt(1+8*X)) / 2) )

Submission status: Accepted

Solution code:
def main():
    x = int(input())
    for i in range(x+1):
        if i*(i+1)//2 >= x:
            print(i)
            break
    
    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
x=int(input())
k=1
while True:
    if k*(k+1)<=2*x<(k+1)*(k+2):
        break
    k+=1
if x==k*(k+1)//2:
    print(k)
else:
    print(k+1)

Submission status: Accepted

Solution code:
a=input()
sum=0
time=0
while True:
    time+=1
    sum+=time
    if sum>=a:
        break
print time

Submission status: Accepted

Solution code:
x = int(input())
sum = 0
n = 1

while True:
    sum += n
    if sum >= x:
        print(n)
        break
    n += 1

Submission status: Accepted

Solution code:
N=int(input())
for i in range(1,N+1):
    if N <= i*(i+1)//2:
        print(i)
        exit()

Submission status: Accepted

Solution code:
X=int(input())
s=0
t=0
for i in range (X):
 s+=i+1
 t=i
 if s>=X:
  break
print(t+1)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
hoge = 0

while True:
  ans += 1
  hoge += ans
  if hoge >= n:
    break

print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict


def main():
    X = int(input())
    for i in range(0, X + 1):
        if (1 + i) * i // 2 >= X:
            print(i)
            return
    print(X)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
X = int(input())
     
L = 0
for i in range(1, X+1) :
  L += i
  if L >= X :
    print(i)
    break

Submission status: Accepted

Solution code:
X = int(input())

sum = 0
time = 0
for i in range(X):
    sum += i+1
    time = i
    if sum >= X:
        break
print(time + 1)

Submission status: Accepted

Solution code:
x = int(input())
count = 1
while x > 0:
    x -= count
    if x <= 0:
        print(count)
    count += 1

Submission status: Accepted

Solution code:
X = int(input())
t = 0
for i in range(0, 15346906839456839):
    t += i
    #print(t)
    if(t >= X):
        print(i)
        break

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math
import sys
import itertools
import numpy as np

n = int(input())

a = np.arange(100000)
print(np.where(a * (a + 1) // 2 >= n)[0][0])

Submission status: Accepted

Solution code:
import sys

# sys.stdin = open('c1.in')


def f(x):
    for n in range(0, 10 ** 9):
        s = n * (n + 1) / 2
        if s >= x:
            return n


def f2(x):
    a = 0
    b = 10 ** 5
    while b - a > 1:
        n = (a + b) // 2
        s = n * (n + 1) // 2
        if s >= x:
            b = n
        else:
            a = n
    return b

x = int(input())
print(f2(x))

# for x in range(10 ** 9, 1, -10 ** 5):
#     if f(x) != f2(x):
#         print(x, f(x), f2(x))
#         break

Submission status: Accepted

Solution code:
X = int(input())

tmp = 0
res = 0
for i in range(1, X+1):
    if tmp >= X:
        break
    res = i
    tmp += i

print(res)

Submission status: Accepted

Solution code:
num = int(input())
i = 1
bef = 0
while True:
    bef += i-1
    aft = bef + i
    if bef < num <= aft:
        print(i)
        break
    i += 1

Submission status: Accepted

Solution code:
def solve():
  X = int(raw_input())
  i = maxx = 0
  while maxx < X:
    i += 1
    maxx += i
  return i

if __name__ == '__main__' :
  print solve()

Submission status: Accepted

Solution code:
def obj(t):
    return t**2 + t

import math
X = int(input())

s = 0
e = 2e9
m = math.floor((s + e) / 2.0)

while(True):
    if (obj(m) < (2 * X)):
        s = m
    else:
        e = m
    if ((e - s) <= 1):
        print(e)
        break
    m = math.floor((s + e) / 2.0)

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    X = int(input())
    left = 0
    right = 10 ** 100
    while (right - left > 1):
        med = (right + left) // 2
        val = med * med + med - 2 * X
        if val >= 0:
            right = med
        else:
            left = med
    print (right)

Submission status: Accepted

Solution code:
x = int(input())

podition_range = 0
time = 0
i = 0

while True:
    if - podition_range <= x <= podition_range:
        print(time)
        break
    else:
        i += 1
        time += 1
        podition_range += time

Submission status: Accepted

Solution code:
X=int(input())
step=1
while X>0:
  X-=step
  if X<=0:
    print(step)
  step+=1

Submission status: Accepted

Solution code:
import math
print int(math.ceil((-1 + math.sqrt(1 + 8*int(raw_input()))) / 2))

Submission status: Accepted

Solution code:
X = int(input())

jump = 0
t = 0
while True:
    if X <= jump:
        print(t)
        exit()
    else:
        t += 1
        jump += t

Submission status: Accepted

Solution code:
import math
N = int(input())
k = int(math.sqrt(N))

sum = 0
ret = 0
for i in range(10 * k) :
    sum += i
    if sum >= N :
        ret = i
        break;
print(i)

Submission status: Accepted

Solution code:
import sys

def solve():
    x = int(input())

    k = 0

    while k * (k + 1) // 2 < x:
        k += 1

    print(k)
    
if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
import sys

X = int(input())

if X == 1:
	print(1)
elif X > 1:
	for i in range(2,1000000000):
		if X <= i*(i + 1)/2:
			t = i
			print(i)
			break

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys
import os


X = int(input())

for t in range(1, 10**10):
    # t秒後にたどり着けるか
    # t秒経ったと言うことは、1 + 2 + ... + tだけ進めるということ
    S = t * (t + 1) / 2
    if S >= X:
        print(t)
        break

Submission status: Accepted

Solution code:
X = int(input())
dismax = 0

for i in range(10**9):
	dismax += i
	if dismax >= X:
		break
print(i)

Submission status: Accepted

Solution code:
#! coding: UTF-8
X = int(input())
i = 1
while i >0:
    if X <= i*(i+1)/2:
        print(i)
        break
    i += 1

Submission status: Accepted

Solution code:
import math
X = int(input())

tmp = 10 ** 9 + 1

i =0
while i < tmp:
    tmp = (-1 + math.sqrt(8*X+1))/2
    if i >= tmp:
        break
    i += 1
    
print(i)

Submission status: Accepted

Solution code:
import sys

def solve(n):
    ans = 0

    for k in range(1, int(n*(n+1)/2)+1):
        left = k * (k-1) / 2
        right = k * (k + 1) / 2

        # sys.stderr.write("%d %d %d %d\n" % (k, left, n, right))

        if (left < n) and (n <= right):
            ans = k
            break

    return ans


def main():
    n = int(sys.stdin.readline())
    ans = solve(n)
    print(ans)

    return 0

if __name__ == '__main__':
    sys.exit(main())

Submission status: Accepted

Solution code:
# C - Go Home
# 問題URL:http://abc056.contest.atcoder.jp/tasks/arc070_a

import math

X = int(input())
n = int((-1 + math.sqrt(1+8*X)) / 2)
sigma = 0.5 * n*(n+1)

if X != sigma:
    print(n+1)
else:
    print(n)

Submission status: Accepted

Solution code:
if __name__ == '__main__':
  X = int(input())
  sum = 0
  i = 0
  while sum < X:
    i += 1
    sum += i
  print(i)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
X = int(raw_input())

ans = 10**8
lo, hi = 1, 10**10
while hi - lo >= 1:
    mi = (hi + lo)/2
    if X - mi <= (mi - 1)*mi/2:
        ans = min(ans, mi)
        hi = mi
    else:
        lo = mi + 1
print ans

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    X = int(input())
    s = 0
    i = 0
    while True:
        s += i
        if s >= X:
            print(i)
            break
        i += 1

Submission status: Accepted

Solution code:
n = int(raw_input())
step = 1
pos = 0
while True:
    pos += step
    if pos >= n:
        break
    step += 1
print step

Submission status: Accepted

Solution code:
X = int(input())
a = 0
while X >0:
    a += 1
    X -= a
print (a)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

X= int(raw_input())

a = 0
while X >0:
    a += 1
    X -= a
print a

Submission status: Accepted

Solution code:
import numpy as np
s = 1
X = input()
while X > s*(s+1)/2:
    s += 1
print s

Submission status: Accepted

Solution code:
s = 1
N = int(input())
while N > s*(s+1)/2:
    s += 1
print(s)

Submission status: Accepted

Solution code:
import numpy as np

x = int(input())
a = -0.5 + np.sqrt(0.25+2*x)
a = int(np.ceil(a))
print(a)

Submission status: Accepted

Solution code:
x = abs(int(input()))
total = 0
for i in range(x+1):
    total += i
    if total >= x:
        print(i)
        break

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
INF=10**10

def main():
   X=int(input())
   n=0
   while(True):
      S=n*(n+1)//2
      if S>=X:
          print(n)
          return 0
      n+=1
        
      
if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
X =int(input())
total = 0
for i in range(X+1) :
	total += i
	if total >= X :
		print(i)
		break

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

x = int(input())


total = 0
for i in range(x + 1):
    total += i
    if total >= x:
        print(i)
        break