s_id stringlengths 10 10 | p_id stringlengths 6 6 | u_id stringlengths 10 10 | date stringlengths 10 10 | language stringclasses 1
value | original_language stringclasses 11
values | filename_ext stringclasses 1
value | status stringclasses 1
value | cpu_time stringlengths 1 5 | memory stringlengths 1 7 | code_size stringlengths 1 6 | code stringlengths 1 539k |
|---|---|---|---|---|---|---|---|---|---|---|---|
s800969045 | p03778 | u453500284 | 1565881281 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 53 | w, a, b = map(int, input().split())
print(min(b-a-w)) |
s426057383 | p03778 | u874741582 | 1565706281 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 108 | W,a,b = map(int,input().split())
if b> a+W:
print(b-a-W)
elif a>b+w:
print(a-b-W)
else:
print(0) |
s418029817 | p03778 | u448655578 | 1562592825 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 96 | W,a,b = map(int,input().split())
start = max(a, b)
end = min(a+W, b+W)
print(max(start-end), 0)
|
s446679159 | p03778 | u778814286 | 1560376186 | Python | PyPy3 (2.4.0) | py | Runtime Error | 167 | 38256 | 85 | w,a,b = map(int,input().split())
ma = max(a,b)
mi = min(a,b)
print(max(max-(mi+w),0)) |
s831734231 | p03778 | u534953209 | 1559261404 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 65 | W, a, b = map(int, input().split())
print(max(0, abs(A - B) - W)) |
s097177301 | p03778 | u507116804 | 1557705951 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 195 | w,a,b=map(int,input().split())
if a=b:
print(int(0))
elif a>b:
if b+w>=a:
print(int(0))
else:
print(int(a-b-w))
else:
if a+w>=b:
print(int(0))
else:
print(int(b-a-w)) |
s655499828 | p03778 | u507116804 | 1557705884 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 197 | w,a,b=map(int,input().split())
if a=b:
print(int(0))
elif a>b:
if b+w>=a:
print(int(0))
else:
print(int(a-b-w))
else:
if a+w>=b:
print(int(0))
else:
print(int(b-a-w))
|
s511090132 | p03778 | u507116804 | 1557705829 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 182 | w,a,b=map(int,input().split())
if a=b:
print(0)
elif a>b:
if b+w>=a:
print(0)
else:
print(int(a-b-w))
else:
if a+w>=b:
print(0)
else:
print(int(b-a-w))
|
s349278639 | p03778 | u220345792 | 1556073482 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 212 | W, a, b = map(int, input().split())
if a+W = b:
tmp = b-a-W
if tmp <= 0:
print(0)
else:
print(tmp)
elif a > b+W:
tmp = a-W-b
if tmp <= 0:
print(0)
else:
print(tmp)
else:
print(0)
|
s467288192 | p03778 | u163320134 | 1555397397 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 134 | w,a,b=map(int,input().split())
if a<=b<=(a+w) or b<=(a+w)<=(b+w):
print(0)
elif (a+w)<b:
print(b-(a+w))
else:
print(abs(a-(b+w)) |
s451811942 | p03778 | u721316601 | 1553622789 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 360 | ans = 'No'
N, M = list(map(int, input().split()))
A = [input() for i in range(N)]
B = [input() for i in range(M)]
flag = False
for a in A:
if not flag and B[0] in a:
flag = True
idx = 1
elif flag and B[idx] in a:
idx += 1
if idx == M:
ans = 'Yes'
break
else:
flag = False
print(ans) |
s466366538 | p03778 | u227082700 | 1553456412 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 77 | n,a,b=map(int,input().split())
if b+w<a:print(a-b-w)
else:print(max(0,b-a-w)) |
s698022826 | p03778 | u782654209 | 1553112080 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 89 | W,a,b=map(int,input().split(' '))
print(max(0,b-(a+W)) if a<=b else print(max(0,a-(b+W))) |
s884560467 | p03778 | u717001163 | 1550986816 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 71 | w,a,b=map(int,input())
print(b-(a+w) if b>a else a-(b+w) if b<a else 0) |
s893243118 | p03778 | u514383727 | 1550984652 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 110 | w, a, b = map(int, input().split())
if abs(a-b) <= w:
print(0)
else:
print(min(abs(b-a-w), abs(a-b-w)) |
s890245597 | p03778 | u111365959 | 1543238471 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 86 | w,a,b = [int(x) for x in input().split()]
print(b-w-(b-a+w)) if a+w =< b else print(0) |
s541153212 | p03778 | u323680411 | 1540259498 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 607 | from sys import stdin
def main() -> int:
global W
W = next_int()
a, b = map(int, input())
if b + W < a:
ans = diff(b + W, a)
elif a + W < b:
ans = diff(a + W, b)
else:
ans = 0
print(ans)
return 0
def diff(a: int, b: int) -> int:
return abs(a - b)
def next_int() -> int:
return int(next_str())
def next_str() -> str:
result = ""
while True:
tmp = stdin.read(1)
if tmp.strip() != "":
result += tmp
elif tmp != '\r':
break
return result
if __name__ == '__main__':
main() |
s814813033 | p03778 | u940102677 | 1538535963 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 58 | print(-min(int(input())-abs(int(input())-int(input())),0)) |
s913001246 | p03778 | u457901067 | 1536512452 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 122 | W, A, B = map(int, input().split())
if B >= A+W:
print(abs(A+W-b))
elif B+W <= A:
print(abs(B+W-A))
else:
print(0)
|
s391732106 | p03778 | u690536347 | 1533222586 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 54 | W,a,b=map(int,input().split())
print(min(b-a,b-a+1-w)) |
s555589698 | p03778 | u962127640 | 1532057768 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 104 | W,a,b = input().split()
if b > a+W:
print(b-(a+W))
elif b+W > a:
print(a-(b+W))
else:
print(0)
|
s658398940 | p03778 | u415905784 | 1532052477 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 86 | W, a, b = map(int, input().split())
print(max(min(abs(a - b - w), abs(a - b + w)), 0)) |
s296762999 | p03778 | u019584841 | 1519858970 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 64 | w,a,b=map(int,input().split())
print(min(abs(a+w-B),abs(b+w-a))) |
s338669999 | p03778 | u319612498 | 1519350124 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 118 | w,a,b=map(int,input().split())
if a+w>=b and b+w>=a:
print(0)
elif: a+w>b:
print(a-b-w)
else:
print(b-a-w) |
s382166500 | p03778 | u853586331 | 1499785515 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 71 | a,b=map(str,input().split())
if (a==b):
print ('H')
else:
print ('D') |
s405510006 | p03778 | u879309973 | 1494322771 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 53 | print min(abs(b-a-W), abs(b-a), abs(b+W-a), abs(b-a)) |
s330142088 | p03778 | u975024434 | 1493261310 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 97 | a = map(int, input().split())
abs = max(a[1], a[2]) - min(a[1], a[2]) - a[0]
print(max(0, abs)) |
s902164916 | p03778 | u803848678 | 1490921665 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 90 | W, a, b = map(int, input().split())
return min(abs(a - b), abs(a - b + W), abs(b - a + W)) |
s681720210 | p03778 | u407106303 | 1490154974 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 83 | w,a,b=map(int,input().split())
x,y=a+w,a-w
print(0 if x<b<y else min(abs(x-b,y-b))) |
s178696626 | p03778 | u705476214 | 1490058731 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 229 | #include <stdio.h>
int main()
{
int w,a,b,t;
scanf("%d%d%d",&w,&a,&b);
if(a>b)
{
t=a;
a=b;
b=t;
}
if(b>a+w)
printf("%d",b-a-w);
else
printf("0");
return 0;
} |
s895555945 | p03778 | u705476214 | 1490058458 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 217 | #include <stdio.h>
int main()
{
int w,a,b,i,t;
scanf("%d%d%d",&w,&a,&b);
if(a>b)
{
t=a;
a=b;
b=t;
}
if(b>a+w)
printf("%d",b-a-w);
else
printf("0");
} |
s619025855 | p03778 | u705476214 | 1490058313 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 178 | #include <stdio.h>
int main()
{
int w,a,b,i,t;
scanf("%d%d%d",&w,&a,&b);
if(a>b)t=a,a=b,b=t;
if(b>a+w)
printf("%d",b-a-w);
else
printf("0");
} |
s102987656 | p03778 | u897575257 | 1489890920 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 134 | w, a, b = [int(i) for i in input().split()]
if a+w < b:
print(fabs(b-a-w))
elif b+w < a:
print(fabs(b+w-a))
else:
print(0) |
s965338365 | p03778 | u897575257 | 1489890726 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 134 | w, a, b = [int(i) for i in input().split()]
if a+w < b:
print(fabs(b-a-w))
elif b+w < a:
print(fabs(b-a-w))
else:
print(0) |
s212516168 | p03778 | u855566104 | 1489887424 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 123 | w = int(input())
a = int(input())
b = int(input())
def main(w,a,b):
if a+w >= b:
return 0
else:
return b-(a+w)
|
s023708624 | p03778 | u855566104 | 1489887275 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 142 | w = int(input())
a = int(input())
b = int(input())
def main(w,a,b):
if a+w >= b:
return 0
else:
return b-(a+w)
print(main(w,a,b))
|
s269788753 | p03778 | u855566104 | 1489886867 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 51 | w = input()
a = input()
b = input()
return b-(a+w) |
s627302259 | p03778 | u008841386 | 1489886652 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 56 | l = input().split()
a=l[1]
b=l[2]
X=abs(a-b)
print(X)
|
s058236283 | p03779 | u114722370 | 1598544710 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9104 | 137 | s, c = map(int, input().split())
c = c//2
if s == c:
print(s)
elif s > c:
print(c)
elif s < c:
t = c - s
print(s + t//2) |
s510755708 | p03779 | u581403769 | 1598484650 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9156 | 105 | x = int(input())
t = 1
while true:
if (1 + t) * t / 2 > x:
print(t)
else:
t += 1 |
s555199939 | p03779 | u752774573 | 1598108454 | Python | PyPy3 (7.3.0) | py | Runtime Error | 95 | 74696 | 138 | X=abs(int(input()))
ct=1
sum=1
while X<=sum:
ct+=1
sub+=ct
print(ct)X=int(input())
ct=1
sum=1
while X>sum:
ct+=1
sum+=ct
print(ct) |
s642684502 | p03779 | u287775083 | 1597947706 | Python | Python (3.8.2) | py | Runtime Error | 60 | 12168 | 912 | import sys
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
X = INT()
A = []
tmp = 0
for i in range(1, X):
tmp += i
A.append(tmp)
if tmp > X:
break
for i in range(1, len(A)+1):
tmp += i
if X <= A[i]:
print(i+1)
break
|
s975619221 | p03779 | u464205401 | 1597593830 | Python | PyPy3 (7.3.0) | py | Runtime Error | 82 | 74544 | 154 | x = int(input())
index = 0
for i in range(1,x+1):
if i*(i-1) < (x-index):
index+=i
else:
ans = x-index
break
# print(i,index)
print(ans) |
s893975758 | p03779 | u464205401 | 1597593755 | Python | PyPy3 (7.3.0) | py | Runtime Error | 92 | 74220 | 154 | x = int(input())
index = 0
for i in range(1,x+1):
if (i-1)*2 < (x-index):
index+=i
else:
ans = x-index
break
# print(i,index)
print(ans) |
s000341778 | p03779 | u815763296 | 1596973845 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8984 | 197 | import math
X = int(input())
ruto = math.ceil(math.sqrt(2*X))+1
kari = ruto**2+ruto
for i in range(ruto-1, 0, -1):
if i**2+i < 2*X:
ans = i+1
break
kari = i**2+i
print(ans)
|
s578369164 | p03779 | u815763296 | 1596973595 | Python | Python (3.8.2) | py | Runtime Error | 30 | 9088 | 195 | import math
X = int(input())
ruto = math.ceil(math.sqrt(2*X))
kari = ruto**2+ruto
for i in range(ruto-1, 0, -1):
if i**2+i < 2*X:
ans = i+1
break
kari = i**2+i
print(ans)
|
s467099119 | p03779 | u425762225 | 1596165391 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9912 | 127 | def calcTime(x,n=0):
if n*(n+1)//2 >= x:
return n
else:
return calcTime(x,n+1)
x = int(input())
print(calcTime(x)) |
s237582259 | p03779 | u159335277 | 1595466123 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9108 | 106 | x = int(input())
s = 0
j = 0
for i in range(1..x+1):
s += i
j += 1
if s >= x:
print(j)
break |
s477364918 | p03779 | u760771686 | 1595181888 | Python | Python (3.8.2) | py | Runtime Error | 39 | 9128 | 91 | X = int(input())
for t in range(1,X):
total = t*(t+1)/2
if total>=X:
break
print(t) |
s789905856 | p03779 | u760771686 | 1595181728 | Python | Python (3.8.2) | py | Runtime Error | 29 | 8924 | 95 | X = int(input())
for t in range(1:X):
total = t*(t+1)/2
if total>=X:
print(t)
break |
s075464330 | p03779 | u350093546 | 1593545821 | Python | PyPy3 (7.3.0) | py | Runtime Error | 88 | 75348 | 118 | n=int(input())
for i in range(pow(n*2,0.5)//1+1,0,-1):
if i*(i-1)<2*n:
continue
else:
print(i+1)
break |
s458145664 | p03779 | u350093546 | 1593545793 | Python | PyPy3 (7.3.0) | py | Runtime Error | 112 | 75164 | 108 | n=int(input())
for i in range(pow(n*2,0.5)//1+1,0,-1):
if i*(i-1)<2*n:
continue
else:
print(i+1) |
s074640533 | p03779 | u629350026 | 1592535369 | Python | Python (3.8.2) | py | Runtime Error | 37 | 9036 | 89 | x=int(input())
temp=0
for i in range(1,x):
temp=temp+i
if temp>=x:
break
print(i) |
s940770561 | p03779 | u366886346 | 1591423190 | Python | Python (3.4.3) | py | Runtime Error | 26 | 2940 | 100 | x=int(input())
count=0
for i in range(1,x**2):
count+=i
if count>=x:
break
print(i)
|
s000956575 | p03779 | u962330718 | 1591410255 | Python | Python (3.4.3) | py | Runtime Error | 27 | 2940 | 94 | X=int(input())
for i in range(X):
if X<=(i+1)*i//2:
ans=i
break
print(ans) |
s795869128 | p03779 | u962330718 | 1591409656 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 117 | X=int(input())
dp=[0]*(X+1)
for i in range(1,10**5):
if (i-1)*i//2<X<=i*(i+1)//2:
print(i)
break
|
s470946094 | p03779 | u954774382 | 1591122736 | Python | Python (3.4.3) | py | Runtime Error | 114 | 6000 | 1182 | import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
# import math
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
# sys.setrecursionlimit(int(pow(10, 2)))
# sys.stdin = open("input.txt", "r")
# sys.stdout = open("output.txt", "w")
mod = int(pow(10, 9) + 7)
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]
@lru_cache(None)
def rec(x,t,curr):
# print(x,t,curr)
if(x==curr):
return t
if(t>x):
return x
return min(rec(x,t+1,curr+t+1),rec(x,t+1,curr),rec(x,t+1,curr-t-1))
X=l()[0]
print(min(rec(X,1,1),rec(X,1,0),rec(X,1,-1))) |
s024887178 | p03779 | u488178971 | 1590493035 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 107 | # ABC 056 C
X =int(input())
for t in range(10**9):
if t * (t+1)/2 >=X:
print(t)
exit()a |
s366575420 | p03779 | u021916304 | 1589157229 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 110 | x = int(input())
num = 0
for i in range(1,1e6):
num += i
if num >= x:
print(i)
exit() |
s263294418 | p03779 | u535171899 | 1589127837 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 188 | x = int(input())
dp=[float('inf')]*(x+1)
dp[0]=0
for i in range(1,x+1):
for j in range((i-1)*i//2+1):
if 0<=j<=x and 0<=i+j<=x:
dp[i+j]=min(dp[i+j],i)
print(dp[x]) |
s234900536 | p03779 | u535171899 | 1589127650 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 182 | x = int(input())
dp=[float('inf')]*(x+1)
dp[0]=0
for i in range(1,x+1):
for j in range((i-1)*i//2+1):
if j<=x and i+j<=x:
dp[i+j]=min(dp[i+j],i)
print(dp[x]) |
s383703724 | p03779 | u116233709 | 1588553291 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 114 | x=int(input())
y=((2*x)**0.5)//1
y-=1
for i in range(y,y+x):
if (i+1)*1//2>=x:
print(i)
exit() |
s892668555 | p03779 | u374802266 | 1587867925 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 75 | n=input()
a=0
for i in range(1,10**5):
a+=i
if a>=n:
break
print(i) |
s427873193 | p03779 | u374802266 | 1587867882 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 76 | n=input()
a=[]
for i in range(1,10**5):
a+=i
if a>=n:
break
print(i) |
s941003553 | p03779 | u374802266 | 1587867864 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 76 | n=input()
a=[]
for i in range(1,10**5):
a+=i
if a>=n:
break
print(i_ |
s918996956 | p03779 | u993310962 | 1587588202 | Python | Python (3.4.3) | py | Runtime Error | 21 | 2940 | 266 | def main():
import sys
x=int(input())
cnt=0
if x==1:
print(1)
sys.exit()
for i in range(1,x):
if cnt<x:
cnt+=i
else:
t=i-1
break
print(t)
if __name__=='__main__':
main() |
s355778969 | p03779 | u993310962 | 1587588031 | Python | Python (3.4.3) | py | Runtime Error | 76 | 3956 | 252 | def main():
x=int(input())
cnt=0
for i in range(1,x):
if cnt<x:
cnt+=i
print(i,cnt)
else:
print(i,cnt)
t=i-1
break
print(t)
if __name__=='__main__':
main() |
s582633649 | p03779 | u246343119 | 1587199013 | Python | Python (3.4.3) | py | Runtime Error | 78 | 3968 | 285 | X = int(input())
ans = 10**9
def func(current, t):
global ans
if ans < t or current > X:
return
if current == X :
ans = min([ans, t])
return
func(current+(t+1), t+1)
func(current-(t+1), t+1)
func(current, t+1)
func(0, 0)
print(ans)
|
s989718514 | p03779 | u230717961 | 1587164355 | Python | Python (3.4.3) | py | Runtime Error | 133 | 41284 | 408 | import sys
sys.setrecursionlimit(40000)
def func(pos, t, x):
if pos + t == x:
return t
elif pos + t < x:
new_pos = pos + t
t += 1
return func(new_pos, t, x)
else:
new_pos = pos - t
t -= 1
return func(new_pos, t, x)
def slove(x):
ans = func(0,0,x)
return ans
if __name__ == "__main__":
x = int(input())
print(slove(x))
|
s920452365 | p03779 | u230717961 | 1587163947 | Python | Python (3.4.3) | py | Runtime Error | 75 | 3976 | 369 | def func(pos, t, x):
if pos + t == x:
return t
elif pos + t < x:
new_pos = pos + t
t += 1
return func(new_pos, t, x)
else:
new_pos = pos - t
t -= 1
return func(new_pos, t, x)
def slove(x):
ans = func(0,0,x)
return ans
if __name__ == "__main__":
x = int(input())
print(slove(x)) |
s591833032 | p03779 | u872538555 | 1586618530 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 97 | import numpy as np
x = int(input())
t = (-1 + np.sqrt(1 + 8 * x)) /? 2
t = int(t)
print(t + 1) |
s416423850 | p03779 | u595893956 | 1586567662 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 150 | 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
if ok != n:
ok+=1
print(ok) |
s831003327 | p03779 | u852790844 | 1586486547 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 118 | import sys
x = int(input())
i = 1
while True:
if i*(i+1)//2 >= x:
print(i):
sys.exit()
i += 1 |
s403784566 | p03779 | u414458988 | 1586056653 | Python | PyPy3 (2.4.0) | py | Runtime Error | 178 | 38384 | 69 | x=int(input())
ans=0
while i < x:
i+=ans
ans+=1
print(ans-1)
|
s401997323 | p03779 | u038408819 | 1586047394 | Python | Python (3.4.3) | py | Runtime Error | 68 | 9112 | 204 | X = int(input())
a = [i for i in range(1, 10**5)]
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)) |
s658086435 | p03779 | u038408819 | 1586046333 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 184 | X = int(input())
sum_ = [0] * (X // 2 + 1)
a = [i for i in range(1, X//2 + 1)]
for i in range(X//2):
sum_[i + 1] = sum_[i] + a[i]
import bisect
print(bisect.bisect_left(sum_, X))
|
s019385241 | p03779 | u038408819 | 1586045024 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3060 | 172 | X = int(input())
sum_ = [0] * (X + 1)
a = [i for i in range(1, X + 1)]
for i in range(X):
sum_[i + 1] = sum_[i] + a[i]
import bisect
print(bisect.bisect_left(sum_, X)) |
s054843447 | p03779 | u145950990 | 1585887964 | Python | PyPy3 (2.4.0) | py | Runtime Error | 287 | 47856 | 199 | x = int(input())
ans = 10**9
def bfs(i,a):
if a == x:
global ans
ans = min(ans,i-1)
elif i<=x:
bfs(i+1,a+i)
bfs(i+1,a)
bfs(i+1,a-i)
bfs(0,0)
print(ans) |
s936856555 | p03779 | u475675023 | 1585421749 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 50 | x=int(input())
n=0
while 2x>n*n+n:
n+=1
print(n) |
s292767558 | p03779 | u127499732 | 1585111207 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 323 | def main():
from itertools import accumulate
x = int(input())
l = list(range(0, x + 1))
r = accumulate(l)
for i, p in enumerate(r):
if p == x:
print(i)
break
if p + (i + 2) == x:
print(i + 2)
break
if __name__ == '__main__':
main()
|
s673923391 | p03779 | u903005414 | 1582166732 | Python | Python (3.4.3) | py | Runtime Error | 152 | 13420 | 167 | import numpy as np
X = int(input())
arr = np.arange(1, 10)
arr = arr * (arr + 1) / 2
# print(arr)
# print(arr >= X)
ans = np.nonzero(arr >= X)[0].min() + 1
print(ans)
|
s313852467 | p03779 | u311176548 | 1582025477 | Python | Python (3.4.3) | py | Runtime Error | 24 | 2940 | 110 | l=int(input())
n=0
while l>n*(n+1):
n=n+1
if (l-n*(n+1)//2)==0:
print(n)
else:
print(x-n*(n+1)//2) |
s872184619 | p03779 | u126823513 | 1581702183 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 254 | from itertools import combinations
int_x = int(input())
answer = int_x
for i in range(1, int_x + 1):
c = combinations(range(1, int_x + 1), i)
for w_c in c:
if sum(w_c) == int_x:
answer = min(answer, max(w_c))
print(answer)
|
s641217393 | p03779 | u126823513 | 1581682149 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 232 | import itertools
int_x = int(input())
answer = int_x
for i in range(1, int_x + 1):
for v in itertools.combinations(range(1, int_x + 1), i):
if sum(v) == int_x:
answer = min(answer, max(v))
print(answer)
|
s895332466 | p03779 | u126823513 | 1581682063 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 228 | import itertools
int_x = int(input())
answer = int_x
for i in range(1, int_x):
for v in itertools.combinations(range(1, int_x + 1), i):
if sum(v) == int_x:
answer = min(answer, max(v))
print(answer)
|
s460919091 | p03779 | u083960235 | 1580861585 | Python | Python (3.4.3) | py | Runtime Error | 38 | 5200 | 1323 | import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
N, M = MAP()
if N == 1 and M == 1:
print(1)
elif N == 1:
print(M - 2)
elif M == 1:
print(N - 2)
else:
print((N - 2) * (M - 2))
#A = [[0] * W for i in range(H)]
#C = ["o" * W for i in range(H)]
#C = ["#"*(W+2)] + ["#"+C[i]+"#" for i in range(H)] + ["#"*(W+2)]
#dx = [1, 1, 0, -1, -1, -1, 0, 1]
#dy = [0, 1, 1, 1, 0, -1, -1, -1]
#
#for h in range(H):
# for w in range(W):
# for i in range(8):
# if C[h+1+dx[i]][w+1+dy[i]] == "o":
# A[h][w] += 1
#ans = 0
#for h in range(H):
# for w in range(W):
# if A[h][w] % 2 == 0:
# ans += 1
#
#print(ans)
|
s827567006 | p03779 | u506858457 | 1580442464 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 125 | X=int(input())
if X==1:
print(1)
if X==2:
print(2)
for i in range(2,X):
if i*i+i>=2*X:
ans=i
break
print(ans) |
s248148999 | p03779 | u007263493 | 1578764750 | Python | Python (3.4.3) | py | Runtime Error | 30 | 2940 | 126 | x = int(input())
for i in range(x):
if i*(i+1)/2 >= x:
ans =i
break
else:
continue
print(ans) |
s535801580 | p03779 | u007263493 | 1578764663 | Python | Python (3.4.3) | py | Runtime Error | 30 | 2940 | 125 | x = int(input())
for i in range(x):
if i*(i+1)/2 > x:
ans =i
break
else:
continue
print(ans) |
s917178609 | p03779 | u007263493 | 1578764602 | Python | Python (3.4.3) | py | Runtime Error | 30 | 3064 | 148 | # t を前から試してx以下か判定する
x = int(input())
for i in range(x):
if i*(i+1)/2 > x:
ans =i
break
print(ans) |
s905518990 | p03779 | u113971909 | 1578449015 | Python | Python (3.4.3) | py | Runtime Error | 153 | 12496 | 213 | X=int(input())
import numpy as np
dp = np.zeros(X+1, dtype = int) #xに到達できる判定
dp[0] = 1
for t in range(1,X+1):
if dp[X-t]==1:
print(t)
break
else:
dp[t:] = dp[:X+1-t] |
s970959938 | p03779 | u113971909 | 1578448939 | Python | Python (3.4.3) | py | Runtime Error | 149 | 12496 | 227 | X=int(input())
import numpy as np
dp = np.zeros(X+1, dtype = int) #xに到達できる判定
dp[0] = 1
for t in range(1,X+1):
if dp[X-t]==1:
print(t)
break
else:
dp[t:] = dp[:X+1-t]
print(dp) |
s821487770 | p03779 | u113971909 | 1578440025 | Python | Python (3.4.3) | py | Runtime Error | 150 | 12452 | 269 | X=int(input())
import numpy as np
dp=[[False]*(X+1) for _ in range(X+1)]
dp[0][0]=True
for t in range(1,X+1):
if dp[t-1][X-t]==True:
ans = t
break
for x in range(0,X+1):
if x>=t:
dp[t][x]=dp[t-1][x-t]
else:
dp[t][x]=dp[t-1][x]
print(ans) |
s896370113 | p03779 | u008357982 | 1577357409 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 54 | n, m = map(int, input().split())
print([2, 1][m > 1])
|
s094890871 | p03779 | u463775490 | 1572390990 | Python | Python (3.4.3) | py | Runtime Error | 43 | 2940 | 422 | 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):
if i*(i-1)/2 < x <= i*(i+1)/2:
ans = i
break
print(ans) |
s687771153 | p03779 | u539517139 | 1571152572 | Python | Python (3.4.3) | py | Runtime Error | 25 | 3060 | 76 | x=int(input())
n=0
for i in range(1,x):
n+=i
if n>=x:
break
print(i) |
s844520992 | p03779 | u780962115 | 1569294219 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 103 | x=int(input())
for i in range(10**5):
if int(i*(i-1)/2)<x<=int(i*(i+1)/2):
print(i)
break |
s675256506 | p03779 | u780962115 | 1569294174 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 116 | x=int(input())
for i in range(10**5):
if int(i*(i-1)/2)<x<=int(i*(i+1)/2):
print(i)
break
|
s623411842 | p03779 | u450339194 | 1561431478 | Python | PyPy3 (2.4.0) | py | Runtime Error | 191 | 38512 | 297 | nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()
X = n()
dp = [0] * (X+1)
dp[1] = 1
for i in range(2, X+1):
j = dp[i-1]
if dp[i - j] < dp[i-1]:
dp[i] = dp[i-1]
else:
dp[i] = dp[i-1]+1
print(dp[X])
|
s658207328 | p03779 | u450339194 | 1561431224 | Python | PyPy3 (2.4.0) | py | Runtime Error | 177 | 38384 | 287 | nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()
X = n()
dp = [0] * (X+1)
dp[1] = 1
for i in range(2, X+1):
if dp[i - dp[i-1]] < dp[i-1]:
dp[i] = dp[i-1]
else:
dp[i] = dp[i-1]+1
print(dp[X])
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.