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: Wrong Answer

Solution code:
x = int(input())

n = int((2*x)**0.5)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:
x = int(input())
i = 1
while True:
    if x-i == 0:
        print(i)
        exit(0)
    elif x-i <= i:
        i += 1
    else:
        x -= i
        i += 1

Submission status: Wrong Answer

Solution code:
import sys

X = int(input())
a = 1
cnt = 0

while a < X:
  a=int(cnt*(cnt+1)/2)
  cnt = cnt+1
print(cnt-1)

Submission status: Wrong Answer

Solution code:
X = int(input())
acc,ind = 0,0
for i in range(X+1):
    ind = i
    acc += i
    acc1 = acc+(i+1)
    if acc1>=X:
        m = min(abs(X-acc),abs(X-acc1))
        if m==abs(X-acc1) and abs(X-acc)!=abs(X-acc1):
            ind += 1
            break
        break
print(m+ind)

Submission status: Wrong Answer

Solution code:
import itertools
import numpy as np

X = int(input())
L = np.array(list(range(int(X**.5)+1)),dtype=np.float32)
L = np.array(list(itertools.accumulate(L)),dtype=np.float32)

def getNearestValue(list, num):
    idx = np.abs(np.asarray(list) - num).argmin()
    return list[idx]

tmp = getNearestValue(L, X)
tmp1 = abs(X-tmp)
print(int((np.argwhere(L==tmp)+tmp1)[0]))

Submission status: Wrong Answer

Solution code:
X = int(input())
acc,ind = 0,0
for i in range(X):
    ind = i
    acc += i
    acc1 = acc+(i+1)
    if acc1>=X:
        m = min(abs(X-acc),abs(X-acc1))
        if m==abs(X-acc1) and abs(X-acc)!=abs(X-acc1):
            ind += 1
            break
        break
print(m+ind)

Submission status: Wrong Answer

Solution code:
import sys
import math
from collections import deque
X = int(input())
place = 0
for i in range(1, 10**9):
    if X-(place + i) > i:
        place += i
    elif X == place +i:
        print(i)
        break

Submission status: Wrong Answer

Solution code:
import math

x = int(input())

n = math.ceil(x**0.5)

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

Submission status: Wrong Answer

Solution code:
n = int(input())
import sys
for i in range(1,n**2):
    if round(i*(i+1)/2) >= n:
        print(i)
        sys.exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import os
if sys.platform=="darwin":
	base = os.path.dirname(os.path.abspath(__file__))
	name = os.path.normpath(os.path.join(base, '../Documents/input.txt'))
	#print(name)
	sys.stdin = open(name)

x = int(input())
chk = 0
i = 1

while chk < x:
	chk = chk + i
	i = i + 1
	print(chk,i)

print(i-1)

Submission status: Wrong Answer

Solution code:
x = int(input())

i = 1

while x != i:
	if x-i <= i:
		i = i + 1
	else:
		x = x - i
		i = i + 1

print(i)

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
print(-(-((x*2+1/4)**0.5-1/2)//1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=abs(int(input()))

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

Submission status: Wrong Answer

Solution code:
x=int(input())

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

Submission status: Wrong Answer

Solution code:
x=int(input())

jump_count=0
for i in range(x+1):
    if x-i > i+1:
        x-=i
        jump_count+=1
    elif x-i == i+1:
        exit()
        jump_count+=1
print(jump_count)

Submission status: Wrong Answer

Solution code:
x=int(input())

jump_count=0
for i in range(x+1):
    if x-i > i+1:
        x-=i
        jump_count+=1
    elif x-i == i+1:
        #exit()
        jump_count+=1
        break
print(jump_count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
for i in range(1):
  r = i+1
  x=x-r
  if x <= 0:
    print(r)

Submission status: Wrong Answer

Solution code:
x = int(input())
for i in range(1):
  r = i+1
  if x>=r:
    x=x-r
  if x-r <= 0:
    print(r)

Submission status: Wrong Answer

Solution code:
x = int(input())
for i in range(1):
  r = i+1
  if x-r>r:
    x=x-r
  elif x-r == 0:
    print(r)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())

cnt = 1

while True:
    if x < cnt:
        print(cnt -1 + x)
        exit()
    x -= cnt
    if x == 0:
        print(cnt)
        exit()
    cnt += 1

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(a ** 0.5)
c = int(b * 0.5 * (b + 1))
for i in range(b+1, b+1+10**9):
    c += i
    if c >= a:
        print(i)
        exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
tmp=0
for i in range(100000):
  tmp+=i
  if tmp>=n:
    print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())
queue = [(X, 0, 1)]
while(queue):
    last, count, time = queue.pop(0)
    if last == 0:
        print(time-1)
        break
    if last-time == 0 or last-time > time:
        queue.append((last-time, count+1, time+1))
    else:
        queue.append((last, count, time+1))

Submission status: Wrong Answer

Solution code:
x = int(input())
a = 0
(x // 2 + 1) * (x // 2 + 1)/2

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

Submission status: Wrong Answer

Solution code:
x = int(input())

print(x//2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

t=0
x=0
while(x+t<X):
    t += 1
    x += t
    
print(min([X-x+t,x+(2*t)-X+1]))

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

possible_locations = [0]
previous_point = 0

for i in range(100):
    length = i + 1

    possible_locations_previous = possible_locations[:]
    for start_from in possible_locations_previous:
        new_points = [start_from, start_from + length ,start_from - length]
        possible_locations += new_points

    possible_locations = list(set(possible_locations))

    if X in possible_locations:
        print(i+1)
        break

Submission status: Wrong Answer

Solution code:
X = int(input())
for i in range(1, X + 1):
    if X <= i:
        if i == X:
            print(i)
        else:
            over = i - X
            k = i - 1
            oover = 2 * i + 1 - X
            print(min(X + k, k + over * 2, oover - 2))

        break
    X -= i

Submission status: Wrong Answer

Solution code:
X = int(input())
for i in range(1, X + 1):
    if X <= i:
        if i == X:
            print(i)
        else:
            over = i - X
            k = i - 1
            print(min(X + k, k + over * 2))
        break
    X -= i

Submission status: Wrong Answer

Solution code:
X = int(input())
sum = 0
k = 0
over = 0
for i in range(1, X + 1):
    sum += i
    if sum >= X:
        if sum == X:
            print(i)
        else:
            over = sum - X
            sum = sum - i
            k = i - 1
            print(min(X - sum + k, k + over * 2))
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = input()
print x/2 + (x%2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
t = 0
while x >= 2*(t+1)+1:
    x -= t+1
    t += 1
print(t + min(2 * abs(t+1 - x) + 1, x-t))

Submission status: Wrong Answer

Solution code:
import sys

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

    k = 1

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

    k -= 1

    ans = x - k * (k + 1) // 2

    print(ans)

def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None

if __name__ == '__main__':
    solve()

Submission status: Time Limit Exceeded

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

P = [x for x in range(1, X+1)]
Q = itertools.accumulate(P)
for i, q in enumerate(Q):
    if q>=X:
        print(i+1)
        break

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
X = int(input())
A = [i for i in range(1,X+1)]
anslist = []
for i in range(1 << len(A)):
    output = []
    for j in range(len(A)):
        if ((i >> j) & 1) == 1:
            output.append(A[j])
    if sum(output)==X:
        anslist.append(output)
print(min([max(a) for a in anslist]))

Submission status: Time Limit Exceeded

Solution code:
x = int(input())
a = 0
for i in range(1,x//2+1):
    a = a + i

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

Submission status: Time Limit Exceeded

Solution code:
x = int(input())
s = {0}
ans = 0
i = 1
while x not in s:
	t = set()
	for u in s:
		t |= {u + i, u, u - i}
	s = t
	i += 1

print(i - 1)

Submission status: Time Limit Exceeded

Solution code:
x = int(input())
t = 1
ds = {0}
while True:
    dc = ds.copy()
    for d in dc:
        if d + t == x or d - t == x:
            break
        ds.add(d + t)
        ds.add(d - t)
    else:
        t += 1
        continue
    break

print(t)

Submission status: Time Limit Exceeded

Solution code:
X = int(input())

possible_locations = [0]
previous_point = 0

for i in range(100000000):
    length = i + 1

    possible_locations_previous = possible_locations[:]
    for start_from in possible_locations_previous:
        new_points = [start_from, start_from + length ,start_from - length]
        possible_locations += new_points

    possible_locations = list(set(possible_locations))

    if X in possible_locations:
        print(i+1)
        break

Submission status: Time Limit Exceeded

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

candidates = [0]

for i in range(1, x + 1):
    # print(candidates)
    new_candidates = []
    for c in copy.deepcopy(candidates):
        new_candidates.append(c)
        new_candidates.append(c+i)
        new_candidates.append(c-i)

    if x in new_candidates:
        print(i)
        break

    candidates = copy.deepcopy(new_candidates)

Submission status: Time Limit Exceeded

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

candidates = [0]

for i in range(1, x + 1):
    # print(candidates)
    for c in copy.deepcopy(candidates):
        candidates.append(c+i)
        candidates.append(c-i)

    if x in candidates:
        print(i)
        break

Submission status: Time Limit Exceeded

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


def make_sum(ind):
    return sum(range(1, ind + 1))

ans = 0

if num == 1:
    print(1)
else:
    while True:
        ans += 1
        if make_sum(ans) < num <= make_sum(ans + 1):
            break

    print(ans + 1)

Submission status: Time Limit Exceeded

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


def make_sum(ind):
    num_sum = 0
    for i in range(1, ind + 1):
        num_sum += i
    return num_sum

ans = 0

if num == 1:
    print(1)
else:
    while True:
        ans += 1
        if make_sum(ans) < num <= make_sum(ans + 1):
            break

    print(ans + 1)

Submission status: Time Limit Exceeded

Solution code:
X=int(input())
place=[]
time=1
place.append(0)
while True:
	next=[]
	for i in place:
		if i+time not in place:
			next.append(i+time)
		if i-time not in place:
			next.append(i+time)
	if X in next:
		break
	time+=1
	place.extend(next)
print(time)

Submission status: Time Limit Exceeded

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

x = int(input())
S = {0}
i = 0
while x not in S:
    i += 1
    S = S | {s - i for s in S} | {s + i for s in S}
print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from bisect import bisect_left
def main():
        x=int(input())
        l,h=0,x
        ans=-1
        while(l<=h):
            m=(l+h)//2
            if(m*(m+1)//2<x):
                l=m+1
            else:
                h=m-1
                ans=m
        print(ans)
main()

Submission status: Accepted

Solution code:
x = int(input())

n = int((2*x)**0.5)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

dammy=1
t=1
while True:
    # print(dammy,t)
    if dammy>=X:
        break
    else:
        dammy+=(t+1)
        t+=1

print(t)

Submission status: Accepted

Solution code:
X = int(input())
a,k = 0,0
while k < X:
    k = a*(a+1)//2
    a+=1
print(a-1)

Submission status: Accepted

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

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:
N = int(input())
total = 0
count =0
while N > total:
  total += count
  count +=1
  
print(count-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

now = 0
cnt = 1

while now < X:
    now += cnt
    cnt += 1

print(cnt-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline

x, = map(int,read().split())

for i in range(100000):
    if i*(i+1)//2 >= x:
        break

print(i)

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    n = int (input())

    count =0
    ans = 0

    for i in range(1,n+1):
        count+=i
        ans +=1
        if n <= count:
            print(ans)
            break

Submission status: Accepted

Solution code:
import sys

X = int(input())
a = 1
cnt = 0

if X == 1:
  print("1")
else:
  while a < X:
    a=int(cnt*(cnt+1)/2)
    cnt = cnt+1
  print(cnt-1)

Submission status: Accepted

Solution code:
from math import*

n=int(input())
x1=(-1+sqrt(1+8*n))//2
x2=(-1-sqrt(1+8*n))//2
ans=int(max(x1,x2))
if (ans*(ans+1))//2==n:
	print(ans)
else:
	print(ans+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())
sum=0
for i in range(1000000):
  sum+=i
  if x<=sum:
    print(i)
    break
  else:
    pass

Submission status: Accepted

Solution code:
import math
import sys
import resource
n = int(input());
dp = []
def dfs(x, i) :
  dp[i] = dp[i-1] + i
  # print(i, dp[i])
  if dp[i] >= n : 
    return i
  return dfs(dp[i], i+1)

sys.setrecursionlimit(100000)

sz = 100000
dp = [0] * sz
print(dfs(0, 1))

Submission status: Accepted

Solution code:
x = int(input())
i = 1
while (1):
    x -= i
    if x < 1:
        print(i)
        exit()
    else:
        i += 1

Submission status: Accepted

Solution code:
x=int(input())

i=1
t=1
cnt=1
while t<x:
    i+=1
    t+=i
    cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


def solve(X: int):
    s = 0
    for i in range(1, X+1):
        s += i
        if s >= X:
            print(i)
            exit()
    return


# Generated by 1.1.6 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())

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

Submission status: Accepted

Solution code:
# ARC 070: C – Go Home
X = int(input())

i = 1

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

print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import string
import fractions
import random
from operator import itemgetter
import itertools
from collections import deque
import copy
import heapq
from bisect import bisect, bisect_left, bisect_right

MOD = 10 ** 9 + 7
INF = float('inf')
input = lambda: sys.stdin.readline().strip()

sys.setrecursionlimit(10 ** 8)

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

Submission status: Accepted

Solution code:
x = int(input())

ok = x
ng = 0

while ok - ng > 1:
    mid = (ok + ng) // 2
    if mid * (mid + 1) // 2 >= x:
        ok = mid
    else:
        ng = mid

print(ok)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())
ng=0
ok=10**9
while ok-ng>1:
    mid=(ok+ng)//2
    if mid*(mid+1)>=2*x:
        ok=mid
    else:
        ng=mid
print(ok)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
from collections import deque
X = int(input())
sum = 0
for i in range(1, 10**9):
    sum += i
    if sum >= X:
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:

#合計値がXにすることができる整数の合計値の最小個数
#Xまでの整数を使う、使わないで行くと、計算数が多すぎる
#ARC070-C GO HOME

x = int(input())
x = abs(x)
ans = 0
sum = 0
i = 0

while sum + i < x:
    sum += i
    i += 1
print(i)

Submission status: Accepted

Solution code:
n = int(input())
import sys
if n == 1:
    print(1)
    sys.exit()
for i in range(1,n**2):
    if round(i*(i+1)/2) >= n:
        print(i)
        sys.exit()

Submission status: Accepted

Solution code:
import sys
import os
if sys.platform=="darwin":
	base = os.path.dirname(os.path.abspath(__file__))
	name = os.path.normpath(os.path.join(base, '../Documents/input.txt'))
	#print(name)
	sys.stdin = open(name)

x = int(input())
chk = 0
i = 1

while chk < x:
	chk = chk + i
	i = i + 1
	#print(chk,i)

print(i-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

X = int(read())

def test(x):
    return x * (x + 1) // 2 >= X

left = 0 # 足りない
right = X + 10
while left + 1 < right:
    x = (left + right) // 2
    if test(x):
        right = x
    else:
        left = x

answer = right
print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import sqrt
X = int(raw_input())

ans = 0
Init = int(sqrt(2*X)) + 1
for N in xrange(X+1):
    if (N+1) * N >= 2 * X:
        ans = N
        break
    
print ans

Submission status: Accepted

Solution code:
# ARC 070: C – Go Home
x = int(input())

position = 0
times = 1

while position < x:
    position += times
    times += 1

print(times - 1)

Submission status: Accepted

Solution code:
X=int(input())
n=1
i=1
while n<=X:
  n+=i
  i+=1
print(i-1)

Submission status: Accepted

Solution code:
x = int(input())*2
t = int(x**0.5)
for i in range(t, t+2):
  if i*(i-1) < x <= i*(i+1):
    print(i)
    break

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(-int(-((x*2+1/4)**0.5-1/2)//1))

Submission status: Accepted

Solution code:
x=int(input())
low=1
high=10**5
while low<high:
    mid=(low+high)//2
    su=(mid*(mid+1))//2
    if su>=x:
        high=mid
    else:
        low=mid+1
print(low)

Submission status: Accepted

Solution code:
x = int(input())

a = 0

for i in range(x+1):
    d = (i*(i+1))//2
    if(d>=x):
        a = i
        break

print(a)

Submission status: Accepted

Solution code:
import sys, math

def input():
    return sys.stdin.readline()[:-1]

def main():
    X = int(input())
    ans = 0
    d = 0
    while d < X:
        ans  += 1
        d += ans
    print(ans)
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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:
def slove():
    import sys
    input = sys.stdin.readline
    x = int(input().rstrip('\n'))
    t = 0
    cnt = 0
    for i in range(1, 10 ** 10):
        cnt += 1
        t += i
        if t >= x:
            print(cnt)
            exit()


if __name__ == '__main__':
    slove()

Submission status: Accepted

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

t = (-1 + math.sqrt(1 + 8 * x))
if t % 2 == 0:
  print(int(t)//2)
else:
  print(int(t)//2+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
import bisect as b
x=int(input())
a=[i*(i+1)//2 for i in range(1,100000)]
print(b.bisect_left(a,x)+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 2019/08/19

x=int(input())
acc=0
ans=0
i=1
while x>acc: 
    acc+=i
    ans=i
    i+=1
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())

tmp = 0
for i in range(10**7):
    tmp += i
    if tmp >= X:
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

cnt = 1
temp = 0
while True:
    temp += cnt
    if x <= temp:
        print(cnt)
        exit()
    cnt += 1

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

X = int(input())
i = 1
ctr = 0

while True:
    ctr += i
    if X <= ctr:
        print(i)
        exit()
    i += 1

Submission status: Accepted

Solution code:
###template###
import sys
def input(): return sys.stdin.readline().rstrip()
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, ceil, floor
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
import heapq
INF = float("inf")
MOD = 10**9 + 7
sys.setrecursionlimit(10**7)
# 4近傍（右, 下, 左, 上）
dy = [0, -1, 0, 1]
dx = [1, 0, -1, 0]
def inside(y: int, x: int, H: int, W: int) -> bool: return 0 <= y < H and 0 <= x < W
def mi(): return map(int, input().split())
def ii(): return int(input())
###template###


X = ii()

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

Submission status: Accepted

Solution code:
a = int(input())
b = 0
for i in range(10 ** 9):
    b += i
    if b >= a:
        print(i)
        exit()

Submission status: Accepted

Solution code:
a = int(input())
b = 0
for i in range(10**9):
    b += i
    if b >= a:
        print(i)
        exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

total = 0
i = 0
ans = 0
while True:
    i += 1
    total += i
    ans += 1
    if X <= total:
        break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
s = 0
k = 0
while s < X:
    k += 1
    s += k
print(k)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())
k=(-1+(1+8*x)**(1/2))/2
if k%1==0:
    print(int(k))
else:
    print(int(k+1))

Submission status: Accepted

Solution code:
# ARC070C - Go Home (ABC056C)
from math import ceil


def main():
    x = int(input())
    print(ceil((-1 + (8 * x + 1) ** 0.5) / 2))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from math import ceil, sqrt

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ARC070C - Go Home (ABC056C)
x = int(input())
for i in range(1, x + 1):
    if i * (i + 1) * 0.5 >= x:
        print(i)
        break

Submission status: Accepted

Solution code:
x = int(input())
n = 0
cnt = 0
while True:
    cnt += 1
    n += cnt
    if n>=x:
        print(cnt)
        exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
tmp=0
for i in range(100000):
  tmp+=i
  if tmp>=n:
    print(i)
    break