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

t=int(((-1+(8*x+1)**0.5)-10**(-10))/2)+1
print(t)

Submission status: Accepted

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

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

    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x = int(input())

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X=int(input())
N=int(-0.5+(0.25+2*X)**0.5)

for k in range(N+2):
    if 0.5*N*(N-1)<X<=0.5*N*(N+1):
        print(N)
        break
    N+=1

'''
count=0
x=[[0]]
for k in range(0,1000000):
    if X in x[k]:
        print(k)
        break
    x.append(list(set(x[k])))
    for j in range(len(x[k])):
        x[k+1].append(x[k][j]+k+1)
        x[k+1].append(x[k][j]-k-1)
    x[k+1]=list(set(x[k+1]))
'''

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:
x = int(input())
#h, w = list(map(int, input().split()))
#((n+1)*n)//2 >= x
# (n+1)*n = 2*x
n = 1
a = ((n+1)*n)//2
while a < x:
    a = ((n+1)*n)//2
    n += 1

if (n-1)*n < 2*x:
    print(n)
else:
    print(n-1)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    import sys
    x=int(input())
    cnt=0
    if x==1:
        print(1)
        sys.exit()
    if x==2:
        print(2)
        sys.exit()
    for i in range(1,x):
        if cnt<x:
            cnt+=i
        else:
            t=i-1
            break
    print(t)

if __name__=='__main__':
    main()

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
x = int(input())

ans = 0
time = 0

while ans < x:
    time += 1
    ans += time

print(time)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
tmp = 0
num_list = []
for i in range(1,10**9):
    if tmp < 10**9:
        tmp += i
        num_list.append(tmp)
    else:
        break
for i in range(len(num_list)):
    if num_list[i] >= n:
        print(i+1)
        break

Submission status: Accepted

Solution code:
N = int(input())

cnt = 0
i = 0
while True:
    i += 1
    cnt += i
    if cnt >= N:
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
i = 0
d = 0
while True:
    i += 1
    d += i
    if d >= n:
        break

print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

t = 0
i = 1
while True:
    t += i
    if t >= X:
        print(i)
        break
    else:
        i += 1

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
def slove(x):
    t = 1
    ans = t
    while ans <x:
        t += 1
        ans += t
    return t
if __name__ == "__main__":
    x = int(input())
    print(slove(x))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

x = int(read())
cnt = 0
for i in range(45000):
    cnt += i
    if cnt >= x:
        print(i)
        exit()

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

import itertools

x = int(read())
cumsum = list(itertools.accumulate([i for i in range(45000)]))
for i in range(45000):
    if cumsum[i] >= x:
        print(i)
        exit()

Submission status: Accepted

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

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

n=1

while (n*(n-1)>=2*X) or (2*X > n*(n+1)):
  if (n*(n-1)< 2*X) and (2*X <= n*(n+1)):
    break
  n+=1

print(n)

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())
i = 1
while True:
    if i * (i + 1) >= 2 * X:
        break
    else:
        i += 1

print(i)

Submission status: Accepted

Solution code:
X = int(input())
l = -1
r = 10**10
while r - l > 1:
    m = l + (r-l)//2
    if m*(m+1)//2 > X:
        r = m
    else:
        l = m
    # print(l, m, r)
print(l if l*(l+1)//2 == X else r)

Submission status: Accepted

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

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:
n=int(input())
tot=0
for i in range(n+1):
    tot+=i;
    if tot>=n:
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

def main():
    n = int((x * 2) ** 0.5)
    res = n if (1 + n) * n // 2 >= x else n + 1
    print(res)

if __name__ ==  '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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

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

    print(t)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
x = int(input())

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

x = I()
i = 0
while 1:
    if i*(i+1)//2 >= x:
        print(i)
        quit()
    i += 1

Submission status: Accepted

Solution code:
#
# Written by NoKnowledgeGG @YlePhan
# ('ω')
#
#import math
#mod = 10**9+7
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""

""" n! mod m 階乗
mod = 1e9 + 7
N = 10000000
fac = [0] * N
def ini():
  fac[0] = 1 % mod
  for i in range(1,N):
    fac[i] = fac[i-1] * i % mod"""

"""mod = 1e9+7
N = 10000000
pw = [0] * N
def ini(c):
  pw[0] = 1 % mod
  for i in range(1,N):
    pw[i] = pw[i-1] * c % mod"""

"""
def YEILD():
  yield 'one'
  yield 'two'
  yield 'three'
generator = YEILD()
print(next(generator))
print(next(generator))
print(next(generator))
"""
"""def gcd_(a,b):
  if b == 0:#結局はc,0の最大公約数はcなのに
    return a
  return gcd_(a,a % b) # a = p * b + q"""
"""def extgcd(a,b,x,y):
  d = a
  if b!=0:
    d = extgcd(b,a%b,y,x)
    y -= (a//b) * x
    print(x,y)
  else:
    x = 1
    y = 0
  return d"""


def readInts():
  return list(map(int,input().split()))
mod = 10**9 + 7
def main():
  x = int(input())
  
  ans = 0
  while ans*(ans+1)/2 < x:
    ans += 1
  print(ans)
  
if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
import numpy as np

x = int(input())

numerator = (-1 + np.sqrt(1 + 8 * x))
t = int(numerator // 2)

if numerator % 2 == 0:
    print(t)
else:
    print(t + 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from fractions import gcd
from math import factorial, sqrt
from functools import lru_cache
INF = 1 << 60
mod = 1000000007
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

# UnionFind
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

# ダイクストラ
def dijkstra_heap(s, edge, n):
    #始点sから各頂点への最短距離
    d = [10**20] * n
    used = [True] * n #True:未確定
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        #まだ使われてない頂点の中から最小の距離のものを探す
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d

#　素因数分解
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

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

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

    return arr

# ここから書き始める
x = int(input())
total = 0
ans = 0
while True:
    if total >= x:
        print(ans)
        break
    ans += 1
    total += ans

Submission status: Accepted

Solution code:
X = int(input())

ok = 10**9 # 解が存在する値
ng = 0 # 解が存在しない値
def bisearch(function, ok, ng):
    while abs(ok-ng) > 1:
        mid = (ok + ng)//2
        if function(mid):
            ok = mid
        else:
            ng = mid
    return ok

def check(mid):
    return mid*(mid+1)/2 >= X
    
print(bisearch(check, ok, ng))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

Solution code:
x=int(input())

i=0
isum=0
while isum<x:
    i=i+1
    isum=isum+i

print(i)

Submission status: Accepted

Solution code:
import math

x = int(input())
x = abs(x)

# sum = sec(sec+1)/2
a = math.ceil((2 * x) ** (0.5))
s = a * (a+1) // 2

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

print(a+1)

Submission status: Accepted

Solution code:
def resolve():

    X=int(input())
    cnt=1
    while True:
        val=cnt*(cnt+1)//2
        if val>=X:
            print(cnt)
            break
        else:
            cnt += 1


resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
X=abs(int(input()))
n=int(math.sqrt(2*X))
if(2*X>n*(n+1) and 2*X<=(n+1)*(n+2)):
  print(n+1)
else:
  print(n)

Submission status: Accepted

Solution code:
import math

X = int(input())
sqX = math.floor(X**(1/2))
temp = sqX**2
i = 0
while True:
    t = sqX + i
    temp = t*(t+1) // 2
    if temp >= X:
        print(sqX + i)
        break
    i += 1

Submission status: Accepted

Solution code:
x = int(input())
cnt = 0
total = 0

while x > total:
    cnt += 1
    total = int((1 + cnt) * (cnt/2))
    
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding: utf-8
import math
import heapq
import bisect
import numpy as np
from collections import Counter, deque
#from scipy.misc import comb

X = int(input())
ans = 0
i = 1
while 1:
    ans += i
    if X <= ans:
        print(i)
        break
    i += 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
a = [i for i in range(1, 10**5)]
import bisect
from collections import deque
s = deque([])
s.append(0)
i = 0
while s[i] < 10 ** 9:
    s.append(s[i] + a[i])
    i += 1

print(bisect.bisect_left(s, X))

Submission status: Accepted

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

t=(-1+math.sqrt(1+8*X))//2

if math.sqrt(8*X +1) == math.floor(math.sqrt(8*X +1)):
    print(int(t))
else:
    print(int(t)+1)

Submission status: Accepted

Solution code:
n=int(input())

memo = 0

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin
inf = 1 << 60
mod = 1000000007

ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

x = ni()

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

print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# C - Go Home
# 標準入力の取得
X = int(input())

# 1, 2, 3・・・と足していったときに、最初に|X|以上となったときの回数
i = 0
sum_i = 0
while sum_i < abs(X):
    i += 1
    sum_i += i

print(i)

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())


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

Submission status: Accepted

Solution code:
n=int(input())
t=a=1
while n>t: a+=1; t+=a
print(a)

Submission status: Accepted

Solution code:
x = int(input())


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

Submission status: Accepted

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

if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
pos = 0
i = 0
while i*2 <= X:
  i += 1
  pos += i
  #print(i, pos)
  if pos >= X: break
print(i)

Submission status: Accepted

Solution code:
def main():
    x = int(input())
    k = int(x ** .5)

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:
import numpy as np
x = abs(int(input()))

# case of 98: (n-1)**2<n(n-1)<196<=n(n+1)<(n+1)**2, m=np.floor((2n)**1/2)-1,+1,+2  
# x - m(m-1)/2 until m-1, [x - m(m-1)/2] - m = wait, +add after wait (+1)

n = int(np.floor((2*x)**(1/2)))
m_cand = [n-1,n,n+1,n+2,n+3]


for i in m_cand:
    if (i*(i+1)<=2*x) & ((i+1)*(i+2)>2*x):
        m = i
        break
        
if m*(m+1)/2 == x:
    ans=m
else:
    ans = m+1
print(int(ans))

Submission status: Accepted

Solution code:
x = int(input())

if x <0:
    x = -1 * x
i = 0
ans = 0
while True:
    ans += i
    if ans >=x:
        print(i)
        exit()
    i += 1

Submission status: Accepted

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

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:
X=int(input())
Y=0;i=0
while Y<X:
  i=i+1
  Y=Y+i
print(i)

Submission status: Accepted

Solution code:
X = int(input())

ans, loc = 0, 0

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

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:
def resolve():
    x = int(input())
    ans = 0
    dist = 0
    for i in range(1, x+1):
        dist += i
        ans += 1
        if dist >= x:
            break
    print(ans)

if __name__ == '__main__':
    resolve()

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

cnt = 0

for i in range(1, 100000000):
    cnt += i
    if cnt >= x:
        ans = i
        break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

sum = 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(1, 10 ** 5):
    if X <= i * (i + 1) // 2:
        break
print(i)

Submission status: Accepted

Solution code:
x = int(input())

cnt = 0
for i in range(1, 10**10):
    cnt += i
    if x <= cnt:
        print(i)
        exit()

Submission status: Accepted

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

print(i)

Submission status: Accepted

Solution code:
x=int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    x = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    X=I()
    temp=0
    for i in range(10**7):
        temp+=i
        if temp>=X:
            print(i)
            break

main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
from itertools import count

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

    for i in count(start=1):
        if i * (i+1) / 2 >= n:
            yield i

print(next(main()))

Submission status: Accepted

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

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

    for i in range(n+1):
        if i * (i+1) / 2 >= n:
            yield i

print(next(main()))

Submission status: Accepted

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

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

    for i in range(n+1):
        if i * (i+1) / 2 >= n:
            print(i)
            return

main()

Submission status: Accepted

Solution code:
X = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
X = int(input())

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

print(a)

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 STR(): return input()
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 = sys.maxsize
mod = 10 ** 9 + 7

x = INT()
n = ceil(sqrt(2 * x))
k = inf
ans = 0
for i in range(max(0, n - 100), n + 100):
    tmp = x - i * (i + 1) // 2
    if k > tmp >= 0:
        ans = i
        k = tmp
if k > ans:
    ans += k * 2
elif k != 0:
    ans += 1
print(ans)

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:
def keisan(A,i):
	if i*(i+1)//2>=X:
		if i*(i-1)//2<X:
			return i
		else:
			return -2
	else:
		return -1

X=int(input())
ans=0
max=(10**9)
min=1
while(1):
	i=(max+min)//2
	if keisan(X,i)==i:
		print(i)
		exit()
	elif keisan(X,i)==-1:
		min=i
	elif keisan(X,i)==-2:
		max=i

Submission status: Accepted

Solution code:
X = int(input())

for i in range(X+1):
    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):
    X -= i
    ans += 1
    if X <= 0: break
print(ans)

Submission status: Accepted

Solution code:
X = int(input())

time = 1
while True:
    if X <= time * (time + 1) // 2:
        print(time)
        exit()
    time += 1

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

    def is_ok(mid):
        if X <= mid*(mid+1)//2:
            return True
        else:
            return False

    def binary_search_meguru():
        ng = -1
        ok = 10**9 + 1
        while abs(ok - ng) > 1:
            mid = ng + (ok - ng) // 2
            if is_ok(mid):
                ok = mid
            else:
                ng = mid
        return ok

    print(binary_search_meguru())


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

def solve():
    X = int(input())
    for i in range(1, 10**5):
        if i * (i + 1) // 2 >= X:
            minI = i
            break
    print(minI)
    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
X = int(input())

i, a = 0, 0
while a < X:
    i += 1
    a += i

print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
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())
i=1
buf=0
while True:
 if (buf<N) and (N<=buf+i):
  print(i)
  break
 else:
  buf=buf+i
  i=i+1

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
n = int(input())
tmp = []
for i in range(1,44722):
  if i*(i+1)/2 >= n:
    tmp.append(i)
print(tmp[0])

Submission status: Accepted

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