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

ans = 0
check = 0
for i in range(1, 10**7):
    ans += i
    check += 1
    if X <= ans:
        print(check)
        break

Submission status: Accepted

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

t=0
dis=0
while dis<x:
    t+=1
    dis+=t

print(t)

Submission status: Accepted

Solution code:
x=int(input())
tmp=0
for i in range(10**9):
    tmp+=i
    if x<=tmp:
        print(i)
        break

Submission status: Accepted

Solution code:
import math

X = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print(round((2*int(input()))**0.5))

Submission status: Accepted

Solution code:
x = int(input())

# 1,[2],3,[4,5],6,[7,8,9],10 ...

ans = (-1+(8*x+1)**0.5)/2
ans = -(-ans//1)

print(int(ans))

Submission status: Accepted

Solution code:
import sys
import math

X = int(sys.stdin.readline().strip())

# i秒までに進める最大の距離
max_t = int(math.sqrt(2*X)) + 1
# print(max_t)
for i in range(max_t + 1):
    if i * (i+1) >= 2 * X:
        break

print(i)

Submission status: Accepted

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

Submission status: Accepted

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

import sys
# import time
# import math
# import numpy as np
# import scipy.sparse.csgraph as cs            # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall
# import random                                # random, uniform, randint, randrange, shuffle, sample
# import string                                # ascii_lowercase, ascii_uppercase, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from datetime import date, datetime          # date.today(), date(year,month,day) => date obj; datetime.now(), datetime(year,month,day,hour,second,microsecond) => datetime obj; subtraction => timedelta obj
# from datetime.datetime import strptime       # strptime('2019/01/01 10:05:20', '%Y/%m/%d/ %H:%M:%S') returns datetime obj
# from datetime import timedelta               # td.days, td.seconds, td.microseconds, td.total_seconds(). abs function is also available.
# from copy import copy, deepcopy              # use deepcopy to copy multi-dimentional matrix without reference
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from fractions import gcd                    # for Python 3.4 (previous contest @AtCoder)



def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79...e+308
    # inf = 2 ** 64 - 1             # (for fast JIT compile in PyPy) 1.84...e+19
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    x = ii()
    for i in range(x+1):
        if i * (i + 1) // 2 >= x:
            print(i)
            exit()


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from itertools import accumulate

X = int(input())

csum = accumulate([i+1 for i in range(100000)])

for i,s in enumerate(csum):
    if s >= X:
        print(i+1)
        break

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    x=int(input())
    cnt=1
    while cnt*(1+cnt)//2<x:
        cnt+=1
    print(cnt)
resolve()

Submission status: Accepted

Solution code:
x=int(input())
r=10**9 
l=0
while r-l>1:
    mid=(r+l)//2 
    if x<=mid*(mid+1)//2:
        r=mid
    else:
        l=mid

print(r)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

def Main(X):
    if X <= 2:
        return X
    ans = 0
    for i in range(1, X):
        ans += i
        if ans >= X:
            return i
    
print(Main(X))

Submission status: Accepted

Solution code:
#3問目
#いけるまでいってはみ出したら戻る
X = int(input())
position = 0
count = 0
while position < X:
    count += 1
    position += count
print(count)

Submission status: Accepted

Solution code:
#3問目
#いけるまでいってはみ出したら戻る
X = int(input())
position = 0
count = 0
while position < X:
    count += 1
    position += count
if position == X:
    print(count)
else:
    print(count )

Submission status: Accepted

Solution code:
X = int(input())

cnt = 0
dist = 0

while X > dist:
    dist += (cnt + 1)
    cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def main():
    n = int(input())
    pos = 0
    count = 0
    while pos < n:
        count += 1
        pos += count
    print(count)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    X=int(input())
    s=0
    for i in range(10**7):
        s+=i
        if s>=X:
            print(i)
            exit()

if __name__ == '__main__':
    main()

Submission status: Accepted

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

a_i = 0
n = 1
while a_i < X:
    a_i = a_i + n
    ans = n
    n += 1

print(ans)

Submission status: Accepted

Solution code:
from math import sqrt
x = int(input())
t = 0
while t>=0:
  if 2*x <= t**2+t:
    print(t)
    break
  t += 1

Submission status: Accepted

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

# 最大以上のどの点にも移動できる。
# max(i) = i*(i+1)/2

tar = (-1 + (1 + 8 * x) ** 0.5) * 0.5
ans = math.ceil(tar)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if (sqrt(1 + 8*x) - 1)%2 == 0:
    x_ = (sqrt(1 + 8*x) - 1)//2 
else:
    x_ = (sqrt(1 + 8*x) - 1)//2 +1

print(int(x_))

Submission status: Accepted

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

if (sqrt(1 + 8*x) - 1)%2 == 0:
    x_ = (sqrt(1 + 8*x) - 1)//2 
else:
    x_ = (sqrt(1 + 8*x) - 1)//2 +1

print(int(min(x, x_)))

Submission status: Accepted

Solution code:
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()

from collections import defaultdict, deque, Counter
from sys import exit
import heapq
import math
import copy
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7

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

Submission status: Accepted

Solution code:
import numpy as np
import bisect
X = int(input())
A = np.cumsum(range(1, 10 ** 5))
idx = bisect.bisect_left(A, X)
print(idx + 1)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import numpy as np
import bisect
X = int(input())
A = np.cumsum(range(1, 10 ** 5))
if np.any(A == X):
    print(A.tolist().index(X) + 1)
else:
    idx = bisect.bisect_left(A, X)
    print(idx + 1)

Submission status: Accepted

Solution code:
x = int(input())
t = 1
while 1:
    if x <= t*-~t//2:
        print(t)
        exit()
    t += 1

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# sys.stdin.readline()
import numpy as np
import math
import sys
from collections import defaultdict
input = sys.stdin.readline
s= int(input())

ans = 0
for i in range(100000000):
    ans +=i
    if ans >= s:
        print(i)
        sys.exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""
異なる数の足し算で
行ける最大の距離を一秒ずつ算出し，こした時がその値
つまり，そこまでの内で一つを除けば辿りつくはず

数列の和を求めていく
"""

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

Submission status: Accepted

Solution code:
x = int(input())

distance = 0
count = 0

i = 1
while distance < x:
    distance += i
    count += 1
    i += 1

print(count)

Submission status: Accepted

Solution code:
from itertools import accumulate
from math import pow

X = int(input())

for t, max_d in enumerate(accumulate(range(int(pow(10, 9))))):
    if max_d >= X:
        print(t)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import collections
import itertools as it
import math
#import numpy as np
 
#  = input()
x  = int(input())
#  = map(int, input().split())
#  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()

sum_ = 0
for i in range(x+1):
    sum_ += i

    if sum_ >= x:
        print(i)
        break

Submission status: Accepted

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

X = int(input())

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Wed May 13 14:22:58 2020

@author: shinba
"""

import bisect
x = int(input())
A = [n*(n+1)//2 for n in range(10**5)]

print(bisect.bisect_left(A,x))

Submission status: Accepted

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

Submission status: Accepted

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

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:
import sys
import re
import math
import collections
import decimal
import bisect
import itertools
import fractions
import functools
import copy

# import heapq
# from collections import deque
# import decimal

sys.setrecursionlimit(10000001)
INF = sys.maxsize
MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))

# ===CODE===
tMOD = 998244353


def main():
    x = ni()

    cnt = 0
    total=0
    while total < x:
        cnt += 1
        total += cnt

    print(cnt)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
X = int(input())
X = X if X > 0 else -X

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:
X = int(input())
a = 0
i = 0

while a < X:
  i += 1
  a += i
  
print(i)

Submission status: Accepted

Solution code:
X=int(input())

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

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc056/tasks/arc070_a
x = int(input())

l = 0
r = x
ans = float('inf')
while l <= r:
    mid = (l + r) // 2
    if (mid + 1) * mid // 2 >= x:
        ans = min(ans, mid)
        r = mid - 1
    else:
        l = mid + 1
print(ans)

Submission status: Accepted

Solution code:
n = int(open(0).read())
i = 0
while i*(i+1)//2 < n:
    i += 1
print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
t = 0
i=1
nums = []
while t<X:
    t += i
    nums.append(i) 
    i += 1
ans = nums[-1]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
MOD = 10**9 + 7

x = int(input())
li = []
i = 1
while True:
    a = (1/2)*(i)*(i+1)
    if a>x:
        break
    li.append(int(a))
    i += 1
li.append((1/2)*(i+1)*(i+2))
if x == 1:
    print(1)
    sys.exit()
elif x == 2:
    print(2)
    sys.exit()
else:
    for i in range(len(li)-1):
        if x>li[i] and x<=li[i+1]:
            print(i+2)
            sys.exit()

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

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

    l = [int(x) for x in range(1, int(8*x**0.5+1)+3)]
    for i in range(len(l)):
        if l[i]*(l[i]+1)//2 >= x:
            return i+1


print(solve())

Submission status: Accepted

Solution code:
n = int(input())

t = 0
while True:
    t += 1
    if t*(t+1) >=2*n:
        print(t)
        exit()

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7



def main():
    X = int(readline())
    X *=2
    i = 1
    while True:
        if i**2 + i >= X:
            print(i)
            break
        else:
            i += 1
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

left=0
right=x
while right-left>1:
  mid=(left+right)//2
  if (mid**2+mid)/2==x:
    right=mid
    break
  if (mid**2+mid)/2<x:
    left=mid
  else:
    right=mid
print(right)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
ok = 10**5
ng = 0
while abs(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())
a = 1
c = 1
while a < X:
    c += 1
    a += c
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())
# 何もしないの全探索
ans,i=0,0
while True:
    if ans>=x:
        break
    ans+=i
    i+=1
print(i-1)

Submission status: Accepted

Solution code:
x = int(input())
sum_n = lambda n: (n * (n + 1)) // 2
t = 0
while sum_n(t) < x:
    t += 1
print(t)

Submission status: Accepted

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

print(i)

Submission status: Accepted

Solution code:
x = int(input())
s= 0
i=1
while s<x:
    s=s+i
    i+=1
print(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:
import math
def main():
    X = int(input())
    T = math.ceil((-1 + math.sqrt(8*X+1))/2)  
    print(T)
            
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math
def myAnswer(X:int) -> int:
   return
def modelAnswer(X:int) -> int:
   return math.ceil(((-1 + (8*X +1)**0.5)/2))
def main():
   X = int(input())
   print(modelAnswer(X))
if __name__ == '__main__':
   main()

Submission status: Accepted

Solution code:
import math

x = int(input())

num = 1

while num**2+num < 2*x:
    num += 1

print(num)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
n = int(input())

if n == 1:
  print(1)
  sys.exit()
l, r = 0, n*2
while r-l > 1:
  key = (r+l)//2
  if (key)*(key+1)//2 >= n:
    r = key
  else:
    l = key

print(r)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

i = 1
koho_sum = i
while koho_sum < X:
    i += 1
    koho_sum += i
print(i)

Submission status: Accepted

Solution code:
def create_koho(X):
    koho = [1]
    koho_sum = 1
    i = 1
    while koho_sum < X:
        i += 1
        koho.append(i)
        koho_sum += i

    return koho


X = int(input())
koho = create_koho(X)
nokori = X
ans = 0
for i in reversed(koho):
    if nokori >= i:
        nokori -= i
        ans += 1

print(len(koho))

Submission status: Accepted

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

Submission status: Accepted

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

if '__main__' == __name__:
    resolve()

Submission status: Accepted

Solution code:
X = int(input())

ans = 0
num = 1
tmp = 0
while tmp<X:
    tmp += num
    num += 1
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
count = 0
point = 0
width = 1
while True:
    count += 1
    point += width
    if point >= n:
        break
    width += 1
print(count)

Submission status: Accepted

Solution code:
from math import sqrt,ceil
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())
ans = math.ceil(((1+8*x)**0.5 - 1)/ 2)
print(ans)

Submission status: Accepted

Solution code:
X = int(input())
t = 0 
sum_x = 0
while sum_x < X:
  t += 1
  sum_x += t # jump with t
print(t)

Submission status: Accepted

Solution code:
X = int(input())
ans = 0
dist = 1

while 1:
  ans += dist
  if ans >= X:
    break
  else:
    dist += 1
print(dist)

Submission status: Accepted

Solution code:
import sys

X = int(input())

t = 1
while t*(t+1)*0.5 < X:
    t = t + 1

print(t)

Submission status: Accepted

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

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

    # [1,t]総和がXを超えるとき
    # 超過分に相当する距離のジャンプが区間に含まれる


if __name__ == '__main__':
    main()

# import sys
# input = sys.stdin.readline
# 
# sys.setrecursionlimit(10 ** 7)
# 
# (int(x)-1 for x in input().split())
# rstrip()
#
# def binary_search(*, ok, ng, func):
#     while abs(ok - ng) > 1:
#         mid = (ok + ng) // 2
#         if func(mid):
#             ok = mid
#         else:
#             ng = mid
#     return ok

Submission status: Accepted

Solution code:
X=int(input())
#最初０
def calc(n):
    return n*(n+1)//2

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

Submission status: Accepted

Solution code:
x = int(input())

count = 1
num = 0
while True:
    num += count
    if x<=num:
        print(count)
        exit()
    else:
        count += 1

Submission status: Accepted

Solution code:
x=int(input())
t=((1+8*x)**.5-1)/2
t=int(t)

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

Submission status: Accepted

Solution code:
x = int(input())
count = 0
sum = 0
while(1):
    count += 1
    sum += count
    if sum >= x:
        print(count)
        break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
n = int(input())
num=0
for i in range(1,n+1):
    num+=i
    if num>=n:
        print(i)
        exit(0)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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())
if x==1:
  print(1)
  exit(0)
for i in range(1,100001):
  t=i*(i+1)//2
  s=(i+1)*(i+2)//2
  if t<x<=s:
    print(i+1)
    exit(0)

Submission status: Accepted

Solution code:
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    X = int(input())
    sum = 0
    i = 1
    while sum <= 10**9:
        sum += i
        if sum >= X:
            print(i)
            exit()
        i += 1

if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
from math import ceil, sqrt


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:
x=int(input())

t=0
a=0
while a<x:
  t+=1
  a+=t

print(t)

Submission status: Accepted

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


def main():
    x = int(input())
    total = 0
    i = 1
    cnt = 0
    while total < x:
        total += i
        i += 1
        cnt += 1
    print(cnt)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right

# https://atcoder.jp/contests/abc056/tasks/arc070_a
X = read_a_int()
s = 0
for i in range(X + 1):
    s += i
    # print(i, s)
    if s >= X:
        break
print(i)

Submission status: Accepted

Solution code:
x = int(input())

a = 1
now = 0
while True:
    now += a
    a += 1
    if now >= x:
        print(a - 1)
        exit()

Submission status: Accepted

Solution code:
n = int(input())
t = 1
tt = 1
ans = 1
while True:
    if n <= tt:
        print(ans)
        exit()
    else:
        t += 1
        tt += t
        ans += 1

Submission status: Accepted

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

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

print(n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

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

print(n)

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

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