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())
for i in range(x+10):
    if (i*(i+1) / 2 < x) & (((i+1)*(i+2)) / 2 >= x):
        break
ans = i+1
print(ans)

Submission status: Accepted

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

print(i)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

Solution code:
X = int(input())
cnt = 0
for t in range(0, X+1):
    if t*(t+1)/2 >= X:
        break
    else:
        cnt += 1
print(cnt)

Submission status: Accepted

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

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

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def read_input():
    x = int(input())
    return x

def sumup(y):
    return y*(y+1)/2

def submit():
    x = read_input()

    for i in range(1, x + 1):
        if x <= sumup(i):
            print(i)
            break


if __name__ == '__main__':
    submit()

Submission status: Accepted

Solution code:
X = int(input())

sum = 0
import sys
for i in range (1,10**5):
    sum += i
    if sum >= X:
        print(i)
        sys.exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy
print(int(numpy.ceil((2*int(input())+1/4)**0.5-1/2)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

x = int(input())

def answer(x):
    for i in range(x):
        if(i*(i+1)//2 < x):
            continue
        else:
            return i

result = answer(x)

if(result == None):
    print(x)
else:
    print(answer(x))

Submission status: Accepted

Solution code:
X = int(input())

k = 1
while True:
    if k*(k-1)/2 < X <= k*(k+1)/2:
        break
    k += 1

print(k)

Submission status: Accepted

Solution code:
x = int(input())

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

print(tim)

Submission status: Accepted

Solution code:
X = int(input())
i = 1
while True:
    if (i * (i + 1)) / 2 >= X:
        print(i)
        exit()
    i += 1

Submission status: Accepted

Solution code:
X = int(input())

check = 0
for i in range(int(1e5)):
    check += i
    if X <= check:
        ans = i
        break

print(ans)

Submission status: Accepted

Solution code:
X = int(input())

c = 0
dist = 0

while dist < X:
    c += 1
    dist += c

print(c)

Submission status: Accepted

Solution code:
X = int(input())

c = 0
dist = 0
while True:
    c += 1
    dist += c
    if dist >= X:
        break

print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def pf(s): return print(s, flush=True)

N=_I()

#1/2n(n-1)>=N
def ans(n):
	return 1/2*n*(n-1)

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

Submission status: Accepted

Solution code:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n= f()[0]
    ans = 0
    k = 1
    for i in range(1, int(1e5)):
        ans += i
        k = i
        if ans>= n:
            break
    print(k)

solve()

Submission status: Accepted

Solution code:
X = int(input())
c = 0
for i in range(1, 1000000000):
    c += i
    if c > X:
        print(i)
        exit()
    elif c == X:
        print(i)
        exit()

Submission status: Accepted

Solution code:
x = int(input())
k = 0
for i in range(1,x+1):
    k+=i
    if x<=k:
        print(i)
        exit()

Submission status: Accepted

Solution code:
x = int(input())
count = 0
max_d = 0
jump = 1
while max_d < x:
    max_d += jump
    jump += 1
    count += 1
print(count)

Submission status: Accepted

Solution code:
import sys
import collections
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())

x = abs(ni())
summ = 0
for i in range(10 ** 5):
    summ += i
    if summ >= x:
        print(i)
        exit()

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def main():
    input = sys.stdin.readline
    N = int(input())

    i = 1
    cnt = 0
    while cnt < N:
        cnt += i
        i += 1

    return i - 1


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

Submission status: Accepted

Solution code:
from functools import reduce
import math

def main():
    # N! を求める
    # f = math.factorial(N)
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    X = int(input().rstrip())
    i = 0
    sum = i
    while True:
        if X <= sum: 
            ans = i
            break
        else:
            i+=1
            sum += i

    print(ans)
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
X = int(input())

left = 0    # ng
right = X   # ok
mid = X
while left + 1 < right:
    mid = (left + right) // 2
    if mid * (mid+1) // 2 >= X:
        right = mid
    else:
        left = mid
        mid += 1

print(mid)

Submission status: Accepted

Solution code:
X = int(input())
l = [(i+1)*i//2 for i in range(1,10**5)]
def bs_left(l, target): # l=sorted, target以上の値をもつ要素のうち一番左のindexを返す
    low, high = 0, len(l)
    while low < high:
        mid = (low+high)//2
        if l[mid] < target:
            low = mid+1
        else:
            high = mid
    if low == len(l):
        return -1
    return low
id = bs_left(l,X)

print(id+1)

Submission status: Accepted

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

Submission status: Accepted

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

x = int(input())

length = 0
for i in range(10000000000):
    length += i
    if length >= x:
        print(i)
        break

Submission status: Accepted

Solution code:
X = int(input())
Flag = True
count = 0
ret = 0
while Flag:
#     print(ret,count)
    count += 1
    ret += count
    if ret >= X:
        print(count)
        Flag = False

Submission status: Accepted

Solution code:
# 累積和してXを越えるところまでいったら、そこまでの数の組み合わせで達成できる
# （ことがエスパーでわかる）
# TLEなったけど1WAなんで1かなこれ
# 配列は使わないことにする
X = int(input())
n = 0
c = 0
while True:
    if n >= X:
        break
    else:
        c += 1
        n += c

print(c)

Submission status: Accepted

Solution code:
def go_home(X: int) -> int:
    t = 1
    while t * (t + 1) // 2 < X:
        t += 1
    return t


if __name__ == "__main__":
    X = int(input())
    ans = go_home(X)
    print(ans)

Submission status: Accepted

Solution code:
X = int(input())
temp = 0
add = 1
while temp < X:
    temp += add
    add += 1
print(add-1)

Submission status: Accepted

Solution code:
Acsum=[]
acsum=0
for i in range(5*10**4):
  acsum+=i
  Acsum.append(acsum)
def binarysearch(x):
  ng=-1
  ok=5*10**4
  while abs(ok-ng)>1:
    mid=(ok+ng)//2
    if Acsum[mid]>=x:
      ok=mid
    else:
      ng=mid
  return ok
n=abs(int(input()))
print(binarysearch(n))

Submission status: Accepted

Solution code:
Acsum=[]
acsum=0
for i in range(10**5):
  acsum+=i
  Acsum.append(acsum)
def binarysearch(x):
  ng=-1
  ok=10**5
  while abs(ok-ng)>1:
    mid=(ok+ng)//2
    if Acsum[mid]>=x:
      ok=mid
    else:
      ng=mid
  return ok
n=int(input())
print(binarysearch(n))

Submission status: Accepted

Solution code:
X=int(input())

for i in range(max(1, int(X**0.5)-1) ,X+1):
  #print(i)
  if i*(i+1) >= 2*X:
    print(i)
    exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print(int((2*int(input())+1/4)**0.5+0.5-10**(-5)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())

cnt=0

for i in range(1,10**8):
    cnt+=i
    if cnt>=x:
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
X=int(input())
for t in range(X+1):
    if t*(t+1)//2>=X:
        print(t)
        break

Submission status: Accepted

Solution code:
x = int(input())
s = 0
cnt = 0
i = 1
while s <= x:
    s += i
    cnt += 1
    if s >= x:
        print(cnt)
        exit()
    i += 1

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on 2019/3/24
Solved on 2019/3/
@author: shinjisu
"""


# ABC 056 C - Go Home
def getInt(): return int(input())
def zeros(n): return [0]*n
def zeros2(n, m): return [zeros(m) for i in range(n)] # obsoleted zeros((n, m))で代替
class Debug():
    def __init__(self):
        self.debug = True
 
    def off(self):
        self.debug = False
 
    def dmp(self, x, cmt=''):
        if self.debug:
            if cmt != '':
                print(cmt, ':  ', end='')
            print(x)
        return x


def prob():
    d = Debug()
    d.off()
    X = getInt()
    d.dmp((X), 'X')
    sm = 0
    for i in range(1, 10**9+1):
        sm += i
        if X <= sm:
            break
    return i


ans = prob()
if ans is None:
    pass
elif type(ans) == tuple and ans[0] == 1:  # 1,ans
    for elm in ans[1]:
        print(elm)
else:
    print(ans)

Submission status: Accepted

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

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())
for i in range(1,10**5):
    if i*(i+1) >= 2 * x:
        print(i)
        break

Submission status: Accepted

Solution code:
x = int(input())

i = 0
total = 0
while total < x:
  i += 1
  total += i
print(i)

Submission status: Accepted

Solution code:
def main():
    X = int(input())
    total = 0
    i = 0
    while total < abs(X):
        i += 1
        total += i
    print(i)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
a=s=0
x=int(input())
while True:
  if s>=x:
    break
  s+=a
  a+=1
print(a-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X=int(input())
X*=2
ans=int(X**0.5)-1
while True:
    if ans*(ans+1)>=X:
        print(ans)
        break
    ans+=1

Submission status: Accepted

Solution code:
#ABC056C
X=int(input())
s=0
for i in range(10**5):
	if s>=X:
		print(i-1)
		break
	else:
		s+=i

Submission status: Accepted

Solution code:
x = int(input())

ans = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X=int(input())
sum=0
for i in range(1,X+1):
    sum += i
    if sum >= X:
        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)
        break

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A

#B

#C
x = I()
a = 0
i = 1
while a < x:
    a += i
    i += 1
print(i-1)
#D

#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T

Submission status: Accepted

Solution code:
X = int(input())
def f(i):
    return i*(i+1)/2

for i in range(1,10**1000000):
    if  f(i) >= X:
        print(i)
        break

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
import math
x=int(input())
print(math.ceil((-1+math.sqrt(8*x+1))/2))

Submission status: Accepted

Solution code:
ans = (int(input())*8 + 1)**0.5 - 1
if not ans.is_integer():
    ans += 2
print(int(ans//2))

Submission status: Accepted

Solution code:
y=int(input())*2
a=[x*(x+1) for x in range(100000) if x*(x+1)<y]
print(len(a))

Submission status: Accepted

Solution code:
# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde	s=input()	s='abcde'
# abcde	s=list(input())	s=['a', 'b', 'c', 'd', 'e']
# 5(1つだけ)	a=int(input())	a=5
# 1 2	| x,y = map(int,input().split())|	x=1,y=2
# 1 2 3 4 5 ... n 　	li = input().split()	li=['1','2','3',...,'n']
# 1 2 3 4 5 ... n 　	li = list(map(int,input().split()))	li=[1,2,3,4,5,...,n]
# FFFTFTTFF 　	li = input().split('T')	li=['FFF', 'F', '', 'FF']

# INPUT
# 3
# hoge
# foo
# bar
# ANSWER
# n=int(input())
# string_list=[input() for i in range(n)]

import collections
import math

#### START
x = int(input())

n = 1
while(True):
  s = int(1/2*n*(n+1))
  if x<=s:
    print(n)
    break
  n += 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

X = int(input())

ans = float('inf')
pos = 0
time = 0
while pos < X:
    time += 1
    pos = (time)*(time+1)//2

diff = pos - X
print(time)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
posi = 0
for n in range(1, 10**5):
    posi += n
    if x <= posi:
        print(n)
        break

Submission status: Accepted

Solution code:
X = int(input())

ans = 0
cnt = 0
for i in range(1,10**9):
    ans += i
    cnt += 1
    if ans >= X:
        break
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
time = 0
leap = 0
while leap < x:
    time += 1
    leap += time
print(time)

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

Solution code:
X=int(input())

time=0
Dear=0
while True:
    Dear+=time
    if Dear>=X:
        print(time)
        exit(0)
    time+=1

Submission status: Accepted

Solution code:
x = int(input())
leap = 0
time = 0
while leap < x:
    time += 1
    leap += time
print(time)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())


def solve(X):
    n = 1
    while True:
        if n*(n-1)//2 < X <= n*(n+1)//2:
            return n
        n += 1

print(solve(X))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
s = 0
if a < 3:print(a)
else:
    for i in range(1,a):

        s+=i
        if s-i < a <= s:
            print(i)
            break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

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

print(i)

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:
x=int(input())

t=1
k=0
i=0

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

print(t-1)

Submission status: Accepted

Solution code:
X = int(input())
for n in range(1,10**5):
    if n*(n-1)//2 < X and X <= (n+1)*n//2:
        print(n)
        break

Submission status: Accepted

Solution code:
X = int(input())
for i in range(1, 10**6):
    if X <= 0.5 * i * (i + 1):
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stderr, setrecursionlimit
from functools import reduce
from operator import add
from math import sqrt, ceil
setrecursionlimit(2147483647)
def f(): return [int(i) for i in input().split()]
def debug(*x, sep=" ", end="\n"):
    for item in x:
        stderr.write(str(item))
        stderr.write(sep)
    stderr.write(end)


'''
n秒間で移動できる最大距離はn(n+1)/2

1 -> 1(r)
2 -> 2(n->r)
3 -> 2(r->r)
4 -> 3(l->r->r)
5 -> 3(n->r->r)
6 -> 3(r->r->r)
7 -> 4(n->n->r->r)
8 -> 4(r->n->r->r)
9 -> 4(n->r->r->r)
10 -> 4(r->r->r->r)
11 -> 5(n->r->n->r->r)
12 -> 5(n->n->r->r->r)


これを満たす最小のnっぽい。
n(n+1)/2=xを解くと、n>0よりx=ceil((-1+sqrt(1+8x))/2)
'''

print(ceil((-1+sqrt(1+8*int(input())))/2))

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

t = (-1+sqrt(8*x+1))/2
a = int(t)

if a == t:
    print(a)
else:
    print(a+1)

Submission status: Accepted

Solution code:
import bisect
from math import sqrt
x = int(input())
a = [1]
s = 1
for i in range(2, 2*int(sqrt(x))):
    s += i
    a.append(s)

if x in a:
    print(a.index(x) + 1)
    exit()

print(bisect.bisect_right(a, x)+1)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
x = int(input())
sum_x = 0
for n in range(1, 10 ** 9 + 1):
    sum_x += n
    if sum_x >= x:
        print(n)
        break

Submission status: Accepted

Solution code:
a = int(input())

for time in range(1,10**5):
  if time == 1 and time == a:
      print(time)
      break
  else:
    summ = int(time * (time + 1) / 2)
    if summ >= a:
      print(time)
      break
    else:
      continue

Submission status: Accepted

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

Submission status: Accepted

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

#(t-1)(t-2)//2 < X <= t(t-1)//2 を満たすtを求める
t = int(math.sqrt(2*X))
while True:
    if t*(t-1) < 2*X:
        t += 1
    else:
        break

print(t-1)

Submission status: Accepted

Solution code:
X = int(input())

r = 1
num = 0

while num < X:
    num += r
    r += 1

print(r-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

i = 0
while True:
    if n <= int((i*(i+1))/2):
        print(i)
        exit()
    else:
        i += 1

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

ans = 0
for i in range(1, X+1):
    sum = (i*(i+1))/2
    if sum >= X:
        ans = i
        break
print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False

# --------------------------------------------

dp = None


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

    s = 0
    a = 0

    while s < X:
        a += 1
        s += a

    print(a)


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
N = int(1e+5)
n_sum = lambda n: n*(n+1)/2
ans = 0
for i in range(N):
    if X <= n_sum(i):
        ans = i
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools

x = int(input())
s = 0
for i in itertools.count(1):
  s += i
  if s >= x:
    print(i)
    break

Submission status: Accepted

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

Submission status: Accepted

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


X = int(input().strip())
sum = 0
n = 1
while True:
    sum = sum + n
    if X <= sum:
        print(n)
        break

    n = n + 1

Submission status: Accepted

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

Submission status: Accepted

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

# sumX = []
sum = 0
for i in range(1,X+1):
    sum += i
    # print("sum=",sum)
    if sum >= X:
        print(i)
        # print("i=", i)
        break

Submission status: Accepted

Solution code:
x = int(input())
cnt= 1
ans = 0
while True:
    tmp = cnt**2 + cnt
    if tmp >= 2*x:
        ans = cnt
        break
    cnt += 1
print(ans)

Submission status: Accepted

Solution code:
iX = int(input())
iK =  int((2*(iX)) ** 0.5)
for k in [iK,iK+1]:
    if k*(k-1) < iX *2 <= k*(k+1):
        print(k)
        exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())


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

Submission status: Accepted

Solution code:
a = int(input())
count = 0
j = 1
ar = []
while count < a:
    count += j
    ar.append(j)
    j += 1
print(ar[len(ar)-1])

Submission status: Accepted

Solution code:
X = int(input())
ans = []
def move(x, T):
    for i in range(T, 0, -1):
        if x >= i:
            x -= i
    if x == 0:
        return T
    else:
        return 50000

for i in range(1, 45000):
    ans.append(move(X, i))

print(min(ans))