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:
# -*- coding: utf-8 -*-
import sys
from collections import deque, defaultdict
from math import sqrt, factorial, gcd
# def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline().strip() # warning bytes
# def input(): return sys.stdin.buffer.readline().decode('utf-8')


def solve():
    n = int(input())
    pos = 0
    i = 0
    while pos < n:
        i += 1
        pos += i
    print(min(n, i))

t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()


"""

abc

"""

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

s = 0

t = 1
while True:
    s += t
    if s >= x:
        break
    
    t += 1
    
print(t)

Submission status: Accepted

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

    print(cnt)

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

X = int(input())

s = 0
i = 1
while True:
    s += i
    if X <= s:
        print(i)
        break
    i += 1

Submission status: Accepted

Solution code:
X = int(input())
acc = 0
# X > 0 なのでマイナス方向にジャンプする選択肢は選ばない
for i in range(X + 1):
    acc += i
    if X <= acc:
        ans = i
        break
print(i)

Submission status: Accepted

Solution code:
import math
X = int(input())
m = math.sqrt(X * 2)
t = 0
for i in range(1, math.ceil(m) + 1):
  t += i
  if t >= X:
    print(i)
    exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
x = int(input())
itr = list(itertools.accumulate([i for i in range(100000)]))
for i in range(100000):
  if itr[i] < x <= itr[i + 1]:
    print(i + 1)
    exit()

Submission status: Accepted

Solution code:
from collections import defaultdict
from collections import deque
import itertools
import math

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

x = readInt()
ans = math.ceil((-1+(x*8)**0.5)/2)
print(ans)

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy,deepcopy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(map(int,input().split()))
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

X = i()
cnt = 0
for i in range(1,10**7):
    cnt += i
    if cnt >= X:
        print(i)
        exit()

Submission status: Accepted

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

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())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
cnt=0
for i in range(1,10**5):
    cnt += i
    if cnt >= x:
        print(i)
        exit()

Submission status: Accepted

Solution code:
N = int(input())

ans = 0
sum = 0

for i in range(1, 10**9):
    sum += i
    ans += 1
    if sum >= N:
        print(ans)
        exit()

Submission status: Accepted

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

# In[5]:


X = int(input())


# In[6]:


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


# In[ ]:

Submission status: Accepted

Solution code:
def resolve():
    '''
    code here
    '''
    X = int(input())
    memo = 0
    res = 0
    for i in range(1, X+3):
        memo += i
        if memo >= X:
            res = i
            break
    print(res)

if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
X = int(input())

y = 0

for i in range(1, X+1):
    y += i
    if y >= X:
        print(i)
        break

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())
now = 0
for i in range(1, x + 1):
    now += i
    if now >= x:
        print(i)
        exit()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline


def read():
    X = int(input().strip())
    return X,


def solve(X):
    t = 0
    x = 0
    while x < X:
        t += 1
        x += t
    return t


if __name__ == '__main__':
    inputs = read()
    print(solve(*inputs))

Submission status: Accepted

Solution code:
def main():
    X = int(input())
    r = 0
    for i in range(X+1):
        r += i
        if r >= X:
            return i
print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X=int(input())
ans=[0]
for i in range(1,10**9):
    temp=ans[-1]+i
    ans.append(temp)
    if temp>=X:
        print(i)
        exit()

Submission status: Accepted

Solution code:
x=int(input())

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

print(i)

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0

N = i()

for i in range(1,N+1):
    if 2*N <= (i+1)*i:
        print(i)
        break

Submission status: Accepted

Solution code:
X=int(input())
a=0
b=0
for i in range(1,10**6):
  b+=i
  a+=1
  if X<=b:
    print(a)
    exit()

Submission status: Accepted

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

Submission status: Accepted

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

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

print(i)

Submission status: Accepted

Solution code:
x = int(input())
si = 0
i = 1
while True:
    nsi = si + i
    if si < x <= nsi:
        break
    si = nsi
    i += 1

print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

total = 0
now = 1

while total < x:
    total += now
    now += 1

print(now-1)

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

x = INT()
i = 1
while(x-i>0):
    x -= i
    i += 1
print(i)

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:

def main():
    X = int(input())
    maxX = 0
    time = 0
    while maxX < X :
        time += 1
        maxX += time

    print(time)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    n = int(readline())

    for i in range(1, n + 1):
        min_lim = (i - 1) * i // 2 + 1
        max_lim = i * (i + 1) // 2
        if min_lim <= n <= max_lim:
            print(i)
            sys.exit()


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC056-C
x = int(input())

#2次方程式を解く
t = int((-1+(1+8*x)**0.5)//2)

if t * (t+1) // 2 >= x:
    print(t)
else:
    print(t+1)

Submission status: Accepted

Solution code:
# input()
# int(input())
# map(int, input().split())
# list(map(int, input().split()))
# list(map(int, list(input()))) # スペースがない数字リストを読み込み
import math
import fractions
import sys
import bisect
import heapq  # 優先度付きキュー(最小値取り出し)
import collections
from collections import Counter
from collections import deque
import pprint
import itertools

sr = lambda: input()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""


def factorization(n):
    arr = []
    temp = n
    if n == 1:
        return arr

    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


# a^n
def power(a, n, mod):
    x = 1
    while n:
        if n & 1:
            x *= a % mod
        n >>= 1
        a *= a % mod
    return x % mod


# n*(n-1)*...*(l+1)*l
def kaijo(n, l, mod):
    if n == 0:
        return 1
    a = n
    tmp = n - 1
    while (tmp >= l):
        a = a * tmp % mod
        tmp -= 1
    return a


inf = 10 ** 18
mod = 10 ** 9 + 7

x = ir()
tmp = x
ans = 0
while tmp > 0:
    ans += 1
    tmp-=ans
print(ans)

Submission status: Accepted

Solution code:
x = int(input())

s = 0
for i, a in enumerate(range(1, x+1), start=1):
    s += a
    if s >= x:
        print(i)
        exit()

exit()

Submission status: Accepted

Solution code:
import math
#import numpy as np
import queue
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    x = int(ipt())
    for i in range(10**9):
        if i*(i+1)//2 >= x:
            print(i)
            exit()

    return

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

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

Submission status: Accepted

Solution code:
x = int(input())

y = 0
i = 1
cnt = 0
while y < x:
   y += i
   i += 1
   cnt += 1
   if y >= x:
      break
print(cnt)

Submission status: Accepted

Solution code:
X = int(input())

count = 0
num = 1
jamp_count = 0
while count < X:
    count += num
    num += 1
    jamp_count += 1

print(jamp_count)

Submission status: Accepted

Solution code:
x = int(input())

for t in range(int(1e5)):
    s = (t + 1) * t / 2
    if s >= x:
        print(t)
        exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

from itertools import accumulate

pos = 0
ans = 0
while pos < x:
    ans+=1
    pos+=ans

print(ans)

Submission status: Accepted

Solution code:
d = int(input())
t = 0 
while True:
  if t*(t+1)//2 >=d:
    print(t)
    exit()
  t +=1

Submission status: Accepted

Solution code:
x =int(input())

ans=0
sum=0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
for i in range(1, 2*10**5):
    score = (i*(i+1))//2
    if score >= n:
        print(i)
        exit()

Submission status: Accepted

Solution code:
x = int(input())

ans = 0
total = 0
for i in range(1, 10**9):
    total += i
    if total >= x:
        ans = i
        break

print(ans)

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())
ans = 0
i = 1
while ans < X:
    ans += i
    i += 1
print(i-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

x = int(input())

t = np.arange(100000)
ans = np.where(t*(t + 1)//2 >= x)[0][0]

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:
X=int(input())
S=[0]*10**6
goukei=0
for i in range(10**6):
    goukei+=i
    S[i]=goukei
    
for i in range(10**6):
    if X<=S[i]:
        print(i)
        exit()
    
#print(S[(10**6)-1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect
n = int(input())
sl = []
for i in range(1,100000):
	sl.append(i*(i-1)//2+1)
ans = bisect.bisect_right(sl, n)
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
if (int((2*n)**(1/2))+1)*(int((2*n)**(1/2)))/2 < n:
    print(int((2*n)**(1/2))+1)
else:
    print(int((2*n)**(1/2)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

for i in range(10**5):
    if X <= i*(i+1)/2:
        print(i)
        exit()

Submission status: Accepted

Solution code:
import math

x = int(input())
ans = math.ceil((2 * x) ** 0.5 - 0.5)
print(ans)

Submission status: Accepted

Solution code:
x = int(input())

cnt = 0
for i in range(10**5):
    cnt += i
    if x <= cnt:
        print(i)
        break

Submission status: Accepted

Solution code:
print(round((2*int(input()))**.5))

Submission status: Accepted

Solution code:
x = int(input())

n = 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    X = int(input())
    for t in range(pow(10, 6)):
        s = (t*(t+1))//2
        if s >= X:
            print(t)
            break

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:
X = int(input())
A = 0
B = 0
for i in range(1,10**5):
    if A < X:
        A+=i
    else:
        print(i-1)
        exit()

Submission status: Accepted

Solution code:
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    x=int(readline())

    l=0
    r=10**9
    while l<r-1:
        m=(l+r)//2
        if m*(m+1)//2>=x:
            r=m
        else:
            l=m

    print(r)

if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:

def calculate(n):

    t = 1
    while True:
        s = ((1 + t) * t) // 2
        if s >= n:
            print(t)
            return t
        t = t + 1



calculate(int(input()))

Submission status: Accepted

Solution code:
# 2020/06/09
# AtCoder Beginner Contest 056 - C

# Input
x = int(input())

wkx = 0
idx = 0

while wkx < x:
    idx = idx + 1
    wkx = wkx + idx

# Output
print(idx)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
X = int(input())
P = 0
i = 0
while X > P:
  i += 1
  P += i

print(i)

Submission status: Accepted

Solution code:
import numpy as np

X = int(input())
arr = np.arange(100000)
cumsum = arr.cumsum()
# print(cumsum[:5])
idx = np.searchsorted(cumsum, X)
print(idx)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
x = int(input())
ans = 0
num = 0
while True:
    if x<=num:
        break
    ans += 1
    num += ans
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x= int(input())

if x==1:
    print(1)
    exit(0)

cnt=1
iterate=2
while cnt<x:
    cnt+=iterate

    if x<=cnt:
        break
    iterate+=1


print(iterate)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
d = 0
for j in range(10 ** 9):
	d += j
	if d >= x:
		print(j)
		exit()

Submission status: Accepted

Solution code:
s = list(map(int, input().split()))
for i in range(1,s[0]+1):
    a=i*(i+1)/2
    if a>=s[0]:
        print(i)
        break

Submission status: Accepted

Solution code:
x = int(input())
k = 1
n = 0
while k <= x:
    n += 1
    k += n

print(n)

Submission status: Accepted

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

Submission status: Accepted

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

print(int(numpy.ceil( (-1+numpy.sqrt(1+8*x))/2 )))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


def solve(X: int):
    t = 1
    while True:
        if t * (t + 1) // 2 >= X:
            print(t)
            return
        t += 1
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    solve(X)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
# import math
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
# sys.setrecursionlimit(int(pow(10, 2)))
# sys.stdin = open("input.txt", "r")
# sys.stdout = open("output.txt", "w")
mod = int(pow(10, 9) + 7)
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]





# @lru_cache(None)

X=l()[0]
i=1
while(X-i>0):
    X-=i
    i+=1

print(i)

Submission status: Accepted

Solution code:
X = int(input())

ans = X
m = int(X ** .5)
t = m * (m + 1) // 2
while True:
  if X <= t:
    break
    
  m += 1
  t = m * (m + 1) // 2

print(m)

Submission status: Accepted

Solution code:
n = int(input())

ans = 0
c = 1
while True:
    ans += c
    if ans >= n:
        print(c)
        exit()
    c+= 1

Submission status: Accepted

Solution code:
# Python3 (3.4.3)
import sys
input = sys.stdin.readline

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


# -------------------------------------------------------------
# main
# -------------------------------------------------------------
X = int(input())

for i in range(1,X+1):
    if i*(i+1)//2 >= X:
        print(i)
        sys.exit()

Submission status: Accepted

Solution code:
X = int(input())
ans = (-1 + (1+8*X)**(1/2)) / 2
if ans % 1 <= 10**(-7):
    print(int(ans))
else:
    print(int(1 + ans//1))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    X = int(input())
    n = 1
    while True:
        if (n - 1) * n // 2 < X <= n * (n + 1) // 2:
            break
        n += 1
    print(n)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

x=I()
sm=0
for i in range(1,10**5):
    sm+=i
    if sm>=x:
        print(i)
        sys.exit()

Submission status: Accepted

Solution code:
def main():
    x = int(input())
    sum = 0
    ans = 0
    while sum < x:
        sum += ans + 1
        ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:
X = int(input())

def f(n):
  return n*(n+1) // 2

for i in range(1, X+1):
  if f(i) >= X:
    print(i)
    quit()

Submission status: Accepted

Solution code:
X = int(input())

def f(n):
  return n*(n+1) // 2

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

print(n)

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy, copy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
import numpy as np

X = INT()
i = int ((2*X)**0.5 - 1)

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy, copy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
import numpy as np

X = INT()
i = int (X**0.5)

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy, copy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
import numpy as np

X = INT()
ans = ceil((-1 + (1 + 8*X)**0.5)/2)
print(int(ans))

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy, copy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
import numpy as np

X = INT()
ans = 0
tmp = 0
for i in range(1, 45721):
	ans += i
	if ans == X:
		print(i)
		break
	elif X < ans:
		print(i)
		break

Submission status: Accepted

Solution code:
x = int(input())
time = 0
 
for i in range(1,10**10):
  time += i
  if time >= x:
    print(i)
    exit()

Submission status: Accepted

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

ans = (-1 + (1+8*X)**0.5)/2
print(math.ceil(ans))

Submission status: Accepted

Solution code:
X = int(input())

total = 1
i = 1
while True:
  if total >= X:
    print(i)
    exit()
  else:
    i += 1
    total += i

Submission status: Accepted

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



if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
X = int(input())

for i in range(1, 50000):
    n = i * (i + 1) / 2
    if n >= X:
        print(i)
        break

Submission status: Accepted

Solution code:
X = int(input())

for i in range(10 ** 9):
    if (i * (i + 1)) // 2 >= X:
        print(i)
        exit()

Submission status: Accepted

Solution code:
# ABC 056 C
X =int(input())
for t in range(10**9):
    if t * (t+1)/2 >=X:
        print(t)
        exit()

Submission status: Accepted

Solution code:
x = int(input())
cnt = 0
time = 0
for t in range(1, x + 1):
    cnt += t
    time += 1
    if cnt >= x:
        break
print(time)

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:
n=int(input())
p=int(-0.5+(2*n+0.25)**0.5)
q=p*(p+1)//2
print(p if q==n else p+1)

Submission status: Accepted

Solution code:
import sys
X = int(input())
a = 0
if X <= 2:
    print(X)
else:
    for i in range(1,X):
        a += i
        if a >= X:
            print(i)
            sys.exit()