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:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 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 S(): return input()


def main():
    X = I()
    if X == 1:
        print(1)
        return
    nsum = 1
    n = 0
    while nsum < X:
        n += 1
        nsum = (1 + n) * n //2 
    # if nsum > X:
    #     n += 1
    print(n)
main()

Submission status: Accepted

Solution code:
#ABC056

x = int(input())

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8


target = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

ans = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

Solution code:
x = int(input())

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

print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
t = 0
while True:
    if X <= (t+1)*t /2:
        break
    t += 1
print(t)

Submission status: Accepted

Solution code:
x = int(input())

p = 1
c = 1
while p <= x:
    p += c
    c += 1
print(c-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

num = int(input().rstrip())

current = 0

ans = num
for i in range(num + 1):
    current += i
    if current >= num:
        ans = min(ans, i)
        break

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
X = int(input())

i = 1
ans = 0
while X > 0:
    X -= i
    ans += 1
    i += 1
print(ans)

Submission status: Accepted

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

def bin_isOK(index,key):
    if index*(index+1)//2 >= key:
        return True
    else:
        return False


def binary_search(key):
    ng = -1
    ok = 10**9

    while abs(ok - ng) >1:
        mid = (ok + ng)//2

        if bin_isOK(mid,key):
            ok = mid
        else:
            ng = mid
    
    return ok

ans=binary_search(X)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())
c = 0
for i in range(300000):
    c += i
    if c >= n:
        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)
        break

Submission status: Accepted

Solution code:
x = int(input())
cnt=0
cumsum=0
i=1
while True:
    cumsum+=i
    cnt+=1
    i+=1
    if x<=cumsum:
        break
print(cnt)

Submission status: Accepted

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

for i in range(1, x+1):
    now += i
    if 0 <= now-x <= i * (i-1)//2:
        print(i)
        break

Submission status: Accepted

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

x = int(readline())
i = 0
res = 0
while x > res:
    res += i
    i += 1

print(i-1)

Submission status: Accepted

Solution code:
from math import ceil, sqrt


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
X = int(input())
ans = 0
cnt = 0
for i in range(1, X+1):
    if cnt < X:
        ans += 1
        cnt += i
    else:
        break
print(ans)

Submission status: Accepted

Solution code:
x = int(input())
t = int((x * 2) ** 0.5)
min_d = int(t * 0.5 * (t + 1))
if min_d < x:
  print(t + 1)
else:
  print(t)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())

time=0
pos =0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
cnt = 0
p = 0
for i in range(n+1000):
    cnt += i
    if cnt >= n:
        p = i
        break
print(p)

Submission status: Accepted

Solution code:
import numpy as np
X = int(input())
arr = np.arange(1, 100000)
arr = arr * (arr + 1) / 2
# print(arr)
# print(arr >= X)
ans = np.nonzero(arr >= X)[0].min() + 1
print(ans)

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

a = 0
ans = 0

for i in range(1, 10**9+1):
  a += i

  if a >= N:
    ans = i
    break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())

num=int((2*x)**0.5)-1
for i in range(3):
    if num*(num+1)>=2*x:
        print(num)
        exit()
    num+=1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
a=[1]
i=0
count=2
while(a[i]<n):
    a.append(a[i]+count)
    count+=1
    i+=1
#print(a)
print(count-1)

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

Solution code:
import bisect
x = int(input())
a = [0]
b = 1
while b <= 45000:
	c = b*(b+1)//2
	a.append(c)
	b += 1
d = bisect.bisect_left(a,x)
print (d)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X=int(input())

def calc(n):
    a=(n*(n+1))//2
    a=int(a)
    return a
n=0
tmp=0
while(1):
    n+=1
    a=calc(n)
    if X<=a:
        ans=n
        print(ans)
        exit()

Submission status: Accepted

Solution code:
x = int(input())

i = 0
sum = 0

while(1):
    i += 1
    sum += i
    if sum < x:
        continue
    else:
        break

print(i)

Submission status: Accepted

Solution code:
x = int(input())

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

print(t)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import sqrt, floor

def solve(x):
    n = floor(sqrt(2 * x))
    return n if x <= n * (n + 1) // 2 else n + 1

_x = int(input())
print(solve(_x))

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    x=II()
    inf=10**9
    st=int(x**0.5)-1
    for i in range(st,inf):
        if(i+1)*i//2>=x:
            print(i)
            break

main()

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n = INT()
a = int(n ** (1/2))
ans = 0

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

print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

j = 0
t = 0
while True:
  t += 1
  j = j + t
  if j >= n:
    break
    
print(t)

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
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect
from heapq import heappush, heappop

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()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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

Submission status: Accepted

Solution code:
def kangaru(x):
    count = 0
    i = 0
    while count < x:
        count += i
        i += 1
#    while count != x:
#        if count + (i * 2 + 1) <= x:
#            count += i
#        elif count + i == x:
#            count += i
#        i += 1
    return i - 1

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
readline = sys.stdin.buffer.readline
n = int(readline())
#for i in range(10**5):
s = int((2*n)**(1/2))
for i in range(s-1,s+2):
    if n <= i*(i+1)/2: 
        print(i)
        break

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = int(input())
#for i in range(10**5):
s = int((2*n)**(1/2))
for i in range(s-1,s+2):
    if n <= i*(i+1)/2: 
        print(i)
        break

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = int(input())
#for i in range(10**5):
for i in range(int((2*n)**(1/2))-1,int((2*n)**(1/2))+2) :
    if n <= i*(i+1)/2: 
        print(i)
        break

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = int(input())
for i in range(10**5):
    if n <= i*(i+1)/2: 
        print(i)
        break

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
    X = int(input())

    def get_time(target_x):
        x = 0

        for i in range(0, 10**9):
            x = x + i + 1
            if target_x <= x:
                return i + 1

    res = get_time(X)

    return res


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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

X = int(input())

time = 0
acc = 0

while acc < X:
  time += 1
  acc += time

print(time)

Submission status: Accepted

Solution code:
X = int(input())

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


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

    ruiseki = 0
    ans = 0
    while ruiseki < N:
        ruiseki += ans
        ans += 1

    print(ans - 1)

    

if __name__ == '__main__':
    main()

Submission status: Accepted

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

def main():
    N = int(input())
    num = ((1+8*N)**(1/2)-1)/2
    print(math.ceil(num))

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
X = int(input())

t = 0

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

print(t)

Submission status: Accepted

Solution code:
X = int(input())

count = 0

if X == 1:
  print("1")
  quit()
if X == 2:
  print("2")
  quit()

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

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())
t = 0
while True:
    t += 1
    if t*(t+1)/2 >= x:
        break
print(t)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
x = 0

while x < X:
    ans += 1
    x += ans 
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
t = (-1+(1+8*x)**0.5)/2-0.00001
print(int(t)+1)

Submission status: Accepted

Solution code:
X=int(input())
XX=X*2
for n in range(XX):
    if XX<=n*(n+1):
        print(n)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC056c
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

x = int(input())
w = 0
for i in range(1, 10**8):
    if x <= (i+1)*i//2:
        w = i
        break
print(w)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
X = int(input())
sum = 0
count = 0
for i in range(1,X+1) :
    sum +=i
    if sum >= X :
        count = i
        break
print(min(X,count))

Submission status: Accepted

Solution code:
n  = int(input())

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

Submission status: Accepted

Solution code:
X = int(input())

#%%
t = 1
s = 0
while True:
    s += t
    if s >= X:
        break

    t += 1

print(t)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
x=int(input())
for i in range(10**6):
    if 2*x<=i**2+i:
        print(i)
        exit()

Submission status: Accepted

Solution code:
import math

x = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
X = int(input())

sum = 0
i = 0
while sum < X:
    i += 1
    sum += i

print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
l, r = 0, 100000
while l + 1 < r:
  m = (l + r) // 2
  if m * (m + 1) // 2 < N:
    l = m
  else:
    r = m
print(r)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

Solution code:
X = int(input())

i = 1
sum_i = 0
count = 0
while sum_i < X:
    sum_i += i
    i += 1
    count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

l = 0
ans = 0

for i in range(1, 10**9):
    l += i
    ans += 1
    if x <= l:
        print(ans)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

def check(mid):
    if (mid)*(mid-1)//2 >=X:
        return False
    else:
        return True

left = 0
right = 10**18
while (right-left) > 1:
    mid = (right+left)//2
    if check(mid):
        left = mid
    else:
        right = mid
if check(left):
    print(left)
else:
    print(right)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

def gauss(n):
    ans = int(n * (n + 1)/ 2)
    return(ans)

A = [gauss(i) for i in range(N + 1)]

ans = 0
for i in range(1, N + 1):
    if X == A[i]:
        ans = i
        break
    elif X > A[i - 1] and X < A[i]:
        ans = i
        break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

while x > d:
    t += 1
    d += t
    ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""
今回の移動方法は、全て右に進んだ場合{1, 2, 3, 4, 5, 6, …., t}となる。これは等差数列であり、
この数列の項の総和は等差数列の和の公式によってO(1)で求めることができる。
(t >= X)となる最小のｔが答えとなる。
"""

X = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
x = int(input())

ans = 0
while x > 0:
    ans += 1
    x -= ans

print(ans)

Submission status: Accepted

Solution code:
x = int(input())

tot = 0
count = 0
while tot < x:
    tot += count + 1
    count += 1

print(count)

Submission status: Accepted

Solution code:
#56c
import math
X = int(input())

#1,2,3…の等差数列の和以下ならたどり着ける
#S = n * (2*a +(n-1)*d) / 2
#d = 1,a=1より
#S = n * (2 + n - 1) / 2
#2S = n * (n + 1) = n^2 + n
#0 = n^2 + n - 2S
#→ n = -1±√1-4*1*(-2X) / 2

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
sum = 0
t = 0
while sum < X:
    t += 1
    sum += t
print(t)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())

i=0
wa=0

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

print(i)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
X = int(input().rstrip())
i = 0
S = 0
while X > S:
    i += 1
    S += i
print(i)

Submission status: Accepted

Solution code:
import bisect
tri=[i*(i+1)//2 for i in range(10**5)]
print(bisect.bisect_left(tri,int(input())))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf')
ans = 0 ;count = 0 ;pro = 1

x=int(input())
for i in range(1,10**9):
    count+=i
    if x<=count:
        print(i)
        exit()

Submission status: Accepted

Solution code:
x = int(input())
candidate = [1] * (10 ** 5 + 1)
ans = 0
for i in range(1, 10 ** 5 + 1):
    candidate[i] = candidate[i - 1] + i + 1
    if candidate[i] > 10 ** 9:
        break
for i in range(len(candidate)):
    if x <= candidate[i]:
        print(i + 1)
        exit()

Submission status: Accepted

Solution code:
import sys

x = int(sys.stdin.readline().rstrip())

def main():
    l = 0
    r = x + 1
    while l + 1 < r:
        m = (l + r) // 2
        if (1 + m) * m // 2 >= x:
            r = m
        else:
            l = m
    return r

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

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
from pprint import pprint
from copy import deepcopy
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
from pprint import pprint


sys.setrecursionlimit(2147483647)
INF = 10 ** 13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 100000000

x = I()
root = int((2 * x) ** 0.5)
if x * 2 <= root * (root + 1):
    print(root)
else:
    print(root + 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
if sys.platform in ['ios', 'win32', 'darwin']:
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return [int(x) for x in input().split()]

X = INT()

# (1+n)*n = 2*X
print(round((X*2)**0.5))

Submission status: Accepted

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

print(i)

Submission status: Accepted

Solution code:
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())

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

print(i)

Submission status: Accepted

Solution code:
X = int(input())
for N in range(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 i*(i+1)/2 >= x:
        print(i)
        exit()

Submission status: Accepted

Solution code:
x = int(input())

for k in range(10 ** 5):
    if k * (k + 1) // 2 >= x and (k-1) * k //2 < x:
        ans = k
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    X = I()
    def solve(x):
        res = (-1+sqrt(1+8*x))/2
        return res + (int(res)!=res)
    print(int(solve(X)))
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
count = 0
for i in range(1000000000):
    count += i
    if count >= x:
        print(i)
        exit()

Submission status: Accepted

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

Submission status: Accepted

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