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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
import bisect

n = int(stdin.readline().rstrip())
i = 1
while True:
    if i*(i+1)//2 >= n:
        break
    else:
        i += 1
print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X=int(input())

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

Submission status: Accepted

Solution code:
X = int(input())
# 二分探索
up = X #可能
down = 0 #不可能
while up > down + 1:
    mid = (up + down) // 2
    if (mid + 1) * mid // 2 >= X:
        up = mid
    else:
        down = mid
print(up)

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())
num = 0
for i in range(1, 10**9 + 1):
    num += i
    if num >= X:
        print(i)
        break

Submission status: Accepted

Solution code:
x = int(input())

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

print(t)

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())
s = 0
t = 0
while s < x:
    t += 1
    s += t
print(t)

Submission status: Accepted

Solution code:
import sys
from functools import reduce
import copy
import math
from pprint import pprint
import collections
import bisect


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def int_inputs(num_of_input):
    ins = [int(input()) for i in range(num_of_input)]
    return ins


def solve(inputs):
    X = int(inputs[0])
    i = 1
    current = 0
    while current < X:
        current += i
        i += 1
    return i - 1


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

Submission status: Accepted

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

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

print(i-1)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
from bisect import bisect_left
X=int(input())
x=[i for i in range(2*10**5)]
x=list(itertools.accumulate(x))
n=bisect_left(x,X)
print(n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:
def examC():
    X = I()
    cur = int(0)
    i = 1
    while (X>cur):
        cur += i
        i +=1
    print(i-1)

import sys
import copy
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examC()

Submission status: Accepted

Solution code:
x = int(input())

ans = 1
ad = 0
while True:
    if x <= ad:
        break
    ad += ans
    ans += 1

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

Submission status: Accepted

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

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())
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())
k=0
j=0
if x==1:
  print("1")
  exit()
elif x==2:
  print("2")
  exit()
else:
  for i in range(x):
    if j<x:
      j+=i
      k+=1
    else:
      print(k-1)
      exit()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.buffer.readline
    N = int(input())
    from itertools import accumulate
    S = [i for i in accumulate(range(1, min(N+1, 44725)))]

    def is_ok(mid):
        if N <= S[mid]:
            return True
        else:
            return False

    def binary_search_meguru():
        left = -1
        right = len(S)
        while right - left > 1:
            mid = left + ((right - left) // 2)
            if is_ok(mid):
                right = mid
            else:
                left = mid
        return right

    ans = binary_search_meguru() + 1
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.buffer.readline
    N = int(input())
    from itertools import accumulate
    S = [i for i in accumulate(range(1, min(N+1, 100000)))]

    def is_ok(mid):
        if N <= S[mid]:
            return True
        else:
            return False

    def binary_search_meguru():
        left = -1
        right = len(S)
        while right - left > 1:
            mid = left + ((right - left) // 2)
            if is_ok(mid):
                right = mid
            else:
                left = mid
        return right

    ans = binary_search_meguru() + 1
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from math import sqrt

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from math import sqrt

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

    a = int(sqrt(2 * X))

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

    print(ans)




if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())

sum = 0
for i in range(n+1):
    sum += i
    if sum >= n:
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect
x = int(input())
xx = x//2
a = []
s = 0
for i in range(x+1):
	if (i * (i+1))/2 >= x:
		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)
        exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())

total=0
for i in range(1,10**10):
    total+=i
    if(total>=N):
        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:
x=int(input())
over=0
i=1

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

print(i-1)

Submission status: Accepted

Solution code:
X = int(input())

n = int((2 * X)**0.5)
if n * (n + 1) >= 2 * X:
    ans = n
else:
    ans = n + 1

print(ans)

Submission status: Accepted

Solution code:
x = int(input())
'''
if x == 1:
    ans = 1
elif x == 2:
    ans = 2
elif x == 3:
    ans = 2
elif x == 4:
    ans = 3
elif x == 5:
    ans = 3
elif x == 6:
    ans = 3
elif x == 7:
    ans = 4
elif x == 8:
    ans = 4
elif x == 9:
    ans = 4
elif x == 10:
    ans = 4
11から15までは5
122333444455555...の群数列
'''
for i in range(1,x+1):
    if i*(i-1)/2 < x <= i*(i+1)/2:
        ans = i
        break
print(ans)

Submission status: Accepted

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


def solve(X: int):
    i=1
    sum_a=0
    while sum_a < X:
        sum_a+=i
        i+=1

    print(i-1)
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    solve(X)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from operator import rshift


def main():
    X = int(input())
    ans = 1
    while rshift(ans ** 2 + ans, 1) < X:
        ans += 1
    print(ans)
    return


main()

Submission status: Accepted

Solution code:
from operator import rshift


def main():
    X = int(input())
    ans = 1
    while rshift(ans * (ans + 1), 1) < X:
        ans += 1
    print(ans)
    return


main()

Submission status: Accepted

Solution code:
def main():
    X = int(input())
    ans = 1
    while ans * (ans + 1) * 0.5 < X:
        ans += 1
    print(ans)
    return


main()

Submission status: Accepted

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


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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


main()

Submission status: Accepted

Solution code:
def main():
    X = int(input())
    accum = 1
    ans = 1
    while accum < X:
        ans += 1
        accum += ans
    print(ans)
    return


main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
X=int(input())
Y=[0]*(10**5)
for i in range(10**5):
  if(i):
    Y[i]=Y[i-1]+i
ans=0
for i in range(10**5):
  if(X<=Y[i]):
    print(i)
    break

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
# input=lambda :sys.stdin.readline().rstrip()
def resolve():
    x=int(input())
    ans=0
    while(ans*(ans+1)<2*x): ans+=1
    print(ans)
resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

i = 0
while True:
    if i * (i + 1) // 2 < X <= (i + 1) * (i + 2) // 2:
        i += 1
        break
    else:
        i += 1

print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

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

print(i)

Submission status: Accepted

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

Submission status: Accepted

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

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=math.sqrt(X)//1
while n*(n+1)<2*X:
  n+=1
print(int(n))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# C - Go Home

X = int(input())

# バックジャンプは考慮しなくてよい

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

print(t)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

ttl = 0
i = 1

while(ttl < n):
    ttl += i
    i += 1

print(i-1)

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs= sys.stdin.buffer.readlines
#rstrip().decode('utf-8')

#import numpy as np
#import operator
import bisect
#from heapq import heapify,heappop,heappush
#from math import gcd
#from fractions import gcd
#from collections import deque
#from collections import defaultdict
#from collections import Counter
#from itertools import accumulate
#from itertools import groupby
#from itertools import permutations
#from itertools import combinations
#from scipy.sparse import csr_matrix
#from scipy.sparse.csgraph import floyd_warshall
#from scipy.sparse.csgraph import csgraph_from_dense
#from scipy.sparse.csgraph import dijkstra
#sys.setrecursionlimit(10**7)

#map(int,input().split())

def main():
    X=int(input())
    li=[i*(i+1)//2 for i in range(10**5) if i*(i+1)//2<10**9]
    print(bisect.bisect_left(li,X))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC056 C - Go Home
X = int(input())

T = []
total = 0
idx = 0
ans = 0

while total < 2500000000:
    idx += 1
    total += idx
    T.append(total)

for i in range(len(T)-1):
    if i == 0:
        if X == T[i]:
            ans = i+1
            break
    if T[i-1]<X<=T[i]:
        ans = i+1
        break
print(ans)

Submission status: Accepted

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

i=0
count=0
while True:
    i+=1
    count+=i
    if count>=X:
        print(i)
        exit()

Submission status: Accepted

Solution code:
def main():
    import sys
    import math
    import collections
    import itertools

    input = sys.stdin.readline().rstrip

    x = int(input())
    i = 1
    while i * (i + 1) < 2 * x:
        i += 1

    # i -= 2
    # print(x - i * (i + 1) // 2)
    print(i)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
X = int(input())

sum_ = 0
for i in range(10**5):
  sum_ += i
  if(sum_ >= X): 
    ans = i
    break

print(ans)

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

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

def main():
  n = ni()
  t = 0
  for i in range(1, n + 1):
    t += i
    if t >= n:
      print(i)
      return
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())
###
k = (x*2+1/4)**(1/2) - 1/2
###

k=int(k)

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

print(k+1)

Submission status: Accepted

Solution code:
from math import sqrt

X = int(input())

result = int(sqrt(X * 2)) - 1  # n(n+1)/2 >= X  ->  (n+1)(n+1)/2 >= X
while result * (result + 1) // 2 < X:
    result += 1
print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

X = int(input())
cnt = 0
tmp = 0
for i in range(1, X + 5):
    if tmp < X:
        tmp += i
        cnt += 1
    else:
        print(cnt)
        sys.exit()

Submission status: Accepted

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

Submission status: Accepted

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

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

n = 0
for i in range(1, x+1):
    n += i
    if n >= x:
        r = n-x
        t = i
        break

# i == r のときに0進み、残りはi進むと
print(t)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import math

def main():
    x = int(input())
    for i in range(x+1):
        if i*(i+1)/2>=x:
            print(i)
            sys.exit()

if __name__ == "__main__":
    sys.exit(main())

Submission status: Accepted

Solution code:
X = int(input())

i = 0
num = 0

while True:
  num += i
  if num >= X:
    break
  i += 1

print(i)

Submission status: Accepted

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

Submission status: Accepted

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

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())
time = 0
while X > 0:
  time += 1
  X -= time
print(time)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
ans = 0
i_sum= 0
while True:
    if i_sum >= x:
        break
    ans += 1
    i_sum += ans
    # print(i_sum)
print(ans)

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:
X = int(input())

def main():
    t = 0
    curr = 0
    while curr < X:
        t += 1
        curr += t
    print(t)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ns = lambda : stdin.readline().rstrip()
na = lambda : map(int, stdin.readline().split())
ni = lambda : int(ns())
def main():
  n = ni()
  f = lambda x: (x * (x+1)) // 2
  for i in range(1, n+1):
    if (f(i) >= n):
      print(i)
      return
main()

Submission status: Accepted

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

x = int(input())

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

print(t)

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


n = 0
tmp = 0
while tmp < X:
    n += 1
    tmp += n

print(n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
X = int(stdin.readline().rstrip())
dist = 0
ans = 0
for i in range(0,10**9+1):
    if dist >= X:
        break
    dist += i
    ans += 1
print(ans-1)

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())
lo = 0
hi = x


def check(n, a):
    return (n * (n + 1)) // 2 >= a


while hi - lo > 1:
    m = lo + (hi - lo) // 2
    if check(m, x):
        hi = m
    else:
        lo = m
print(hi)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
x=int(input())

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

Submission status: Accepted

Solution code:

import sys
input = sys.stdin.readline
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
# A = [ int(input()) for _ in range(N) ]
##############################

N = int(input())
summary = 0

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

print(i)

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
res = 0
for i in range(1,10**10):
    res += i
    if res >= n:
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
x,count = 1,1
while x < n:
    x += count
    count += 1
print(count if x == n else count-1)

Submission status: Accepted

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


if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
def resolve():
    x = int(input())
    for i in range(1, 10 ** 5):
        steps = i * (i + 1) // 2
        if steps >= x:
            print(i)
            return 0


if __name__ == "__main__":
    resolve()

Submission status: Accepted

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


def solve(X: int):

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


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    global X
    X = int(next(tokens))  # type: int
    solve(X)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
X=int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import floor
x = int(input())
a = floor((2*x)**.5)
while a * (a + 1) / 2 < x:
  a += 1
  
print(a)

Submission status: Accepted

Solution code:

x = int(input())
ans = 0
m = 0
while x > m:
    ans += 1
    m += ans
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ans = -((0.5 - ((1+8*n)**0.5)/2)//1)
print(int(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print(int((2*int(input())-.25)**.5+.5))

Submission status: Accepted

Solution code:
N = int(input())

ans = 0
tmp = 0
while tmp < N:
  ans += 1
  tmp += ans
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

ans = 0

for i in range(N+1):
    ans += i
    if N <= ans:
        print(i)
        exit()

Submission status: Accepted

Solution code:
n=int(input())

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

Submission status: Accepted

Solution code:
import sys

N = int(input())
tmp = 0
for i in range(10**5 + 1000):
	tmp += i
	if tmp >= N:
		print(i)
		sys.exit()

Submission status: Accepted

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

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

print(a)

Submission status: Accepted

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

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

print(a)

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

Submission status: Accepted

Solution code:
import sys
import copy
import string
import  math
from _bisect import *
from collections import *
from operator import itemgetter
from math import factorial
"""
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
"""
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

x = ni()
s = 0
i = 1
while True:
    s += i
    if s >= x:
        ans = i
        break
    i += 1
print(ans)

Submission status: Accepted

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

while True:
    t += 1
    x += t
    if x >= X:
        break

print(t)

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

Solution code:
x = int(input())

i = 1
temp = 0

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

print(i-1)

Submission status: Accepted

Solution code:
x = int(input())

fact = 1
cnt = 1
while fact < x:
    cnt += 1
    fact += cnt
print(cnt)

Submission status: Accepted

Solution code:
x = int(input())

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

print(ans)

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())
count = tmp = i = 0
while(tmp<X):
    i += 1
    count += 1
    tmp += i
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

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