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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s367779901 | p03835 | u768256617 | 1589569722 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 146 | k,s=map(int,input().split())
cnt=0
for x in range(k+1):
for y in range(k+1):
z=s-x-y
ifz>=0 andz<=2500:
cnt+=1
print(cnt) |
s635447101 | p03835 | u536034761 | 1589461596 | Python | Python (3.8.2) | py | Runtime Error | 759 | 9160 | 143 | K, S = map(int, input().split())
count = 0
for x in range(K + 1):
for y in range(K + 1):
if S - x - y <= K:
conut += 1
print(count) |
s548711439 | p03835 | u294385082 | 1589423084 | Python | Python (3.8.2) | py | Runtime Error | 20 | 8928 | 168 | k,s = map(int(),input().split())
a = 0
for x in range(k+1):
for y in range(k+1):
for z in range(k+1):
if x+y+z == s:
a += 1
print(a)
|
s112877242 | p03835 | u872748813 | 1589358782 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3060 | 277 | import sys
input = sys.stdin.readline
K,S=map(int,input().split())
z = list(range(K+1))
ans = []
for i in z:
s_z = S - i
if s_z < 0:
pass
elif K < s_z:
if (K + 1) > (s_z - K):
ans.extend(2*K - s_z + 1)
else:
ans.extend(s_z + 1)
print(sum(ans)) |
s887550370 | p03835 | u872748813 | 1589358524 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 287 | import sys
input = sys.stdin.readline
K,S=map(int,input().split())
z = list(range(K+1))
ans = [None]*(K+1)
for i in z:
s_z = S - i
if s_z < 0:
ans[i] = 0
elif K < s_z:
if (K + 1) > (s_z - K):
ans[i] = 2*K - s_z + 1
else:
ans[i] = s_z + 1
print(sum(ans)) |
s235758696 | p03835 | u872748813 | 1589358198 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 277 | import sys
input = sys.stdin.readline
K,S=map(int,input().split())
z = list(range(K+1))
ans = []
for i in z:
s_z = S - i
if s_z < 0:
ans[i] = 0
elif K < s_z:
if (K + 1) > (s_z - K):
ans[i] = 2*K - s_z + 1
else:
ans[i] = s_z + 1
print(sum(ans)) |
s111079063 | p03835 | u872748813 | 1589355258 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 271 | import sys
input = sys.stdin.readline
K,S=map(int,input().split())
z = list(range(K+1))
ans = []
for i in z:
s_z = S - i
if s_z < 0:
pass
elif K < s_z:
if (K + 1) > (s_z - K):
ans[i] = K + 1 - (s_z - K)
else:
ans[i] = s_z + 1
print(sum(ans)) |
s868357311 | p03835 | u872748813 | 1589351984 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 312 | k,s=map(int,input().split())
ans=0
z = list(range(0,K+1))
answer = []
for i in z:
s_z = S - i
if K < s_z:
for x in list(range(s_z - K,K+1)):
y = s_z - x
answer.append([x, y, z])
else:
for x in list(range(0,s_z+1)):
y = s_z - x
answer.append([x, y, z])
print(len(answer)) |
s666856163 | p03835 | u975016227 | 1589351033 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 143 | k, s = list(map(input().split()))
num = 0
for x in range(k+1):
for y in range(k+1):
if s-k <= x+y <= s:
num += 1
print(num) |
s693591416 | p03835 | u975016227 | 1589350685 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 143 | k, s = list(map(input().split()))
num = 0
for x in range(k+1):
for y in range(k+1):
if s-k <= x+y <= s:
num += 1
print(num) |
s929815372 | p03835 | u524534026 | 1589346493 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 184 |
import sys
import itertools
k,s=map(int,input().split())
ans=0
for x in range(k+1):
for y in range(k+1):
z=s-(x+y)
if z>=0 andz<=k:
ans+=1
print(ans) |
s655751129 | p03835 | u115877451 | 1589147417 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 126 | a,b=map(int,input().split())
c=0
for i in range(a+1):
for j in range(a+1):
z=k-(i+j)
if 0<=z<=a:
c+=1
print(c) |
s051624092 | p03835 | u271752889 | 1589137755 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 133 | x,s=map(int(input().split()))
n=x+1
a=0
for i in range(n):
for j in range(n):
if 0<=s-(i+j)<=x:
a+=1
print(a) |
s102580839 | p03835 | u556657484 | 1589008398 | Python | Python (3.4.3) | py | Runtime Error | 1724 | 3064 | 437 | K, S = map(int, input().split())
ans = 0
for x in range(K+1):
for y in range(K+1):
if S - x - y < 0:
break
if K >= S - x - y >= 0:
ans += 1
print(ans)
k,s = map(int, input().split())
ans = 0
for right in range(max(s-k, 0), min(s+1, 2*k+1)):
lower = max(0, right-k)
upper = min(k, right)
if right % 2 != 0:
ans += upper - lower + 1
else:
ans += upper - lower + 1
print(ans)
|
s607381533 | p03835 | u165268875 | 1588977595 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 198 |
K, S = map(int, input().split())
count = 0
for i in range(K+1) :
for j in range(K+1) :
if S < x + y :
break
if S - i - j <= K :
count += 1
print(count)
|
s816706195 | p03835 | u144072139 | 1588964793 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 147 | K,S=map(int,input().split)
ans=0
for x in range(K+1):
for y in range(K+1):
for z in range(K+1):
if x+y+z==S:
ans+=1
print(ans) |
s867463241 | p03835 | u312078744 | 1588952547 | Python | Python (3.4.3) | py | Runtime Error | 16 | 2940 | 551 | import itertools
k, s = map(int, input().split())
#data = [i for i in range(k + 1)]
# print(data)
#dd = itertools.product(data, repeat=3)
# print(dd)
#dd = list(dd)
target = s / 3
ans = 0
if (target < k):
pass
elif:
for x in range(0, k + 1):
#temp = s - x
# 2なら、(0、2)(1、1)(2、0)
for y in range(0, k + 1):
if (0 <= s - (x + y) <= k):
ans += 1
print(ans)
'''
ans = 0
for i in dd:
#print(sum(i))
if (sum(i) == s):
ans += 1
print(ans)
'''
|
s325115899 | p03835 | u870518235 | 1588912276 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 241 | import sys
import copy
sys.setrecursionlimit(1000000)
K, S = map(int, input().split())
ans = 0
for x in range(K + 1):
for y in range(K + 1):
z = S - (x + y)
if z >= 0 and z <= K:
ans += 1
print(ans) |
s091290390 | p03835 | u181195295 | 1588818976 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 180 | k, s = map(int, input().split())
ans = 0
num = max(k, s)
for i in range(num+1):
for j in range(num+1):
res = S - (i+j)
if res >= 0:
ans += res+1
print(ans) |
s169740099 | p03835 | u737508101 | 1588816933 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 162 | K, S = map(int, input().split())
count = 0
for X in range(K+1):
for Y in range(K+1):
Z = S - X - Y
if 0 <= Z and Z <= K
count += 1
print(count)
|
s490998631 | p03835 | u737508101 | 1588816810 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 162 | k, s = map(int, input().split())
count = 0
for x in range(k+1):
for y in range(k+1):
z = s - x - y
if 0 <= z and z <= k
count += 1
print(count)
|
s542960890 | p03835 | u737508101 | 1588816204 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 194 | k, s = map(int, input().split())
x <= k
y <= k
z <= k
count = 0
for e in range(s+1):
for f in range(s+1):
for g in range(s+1):
if e + f + g == s:
count =count+1
print(count)
|
s220428850 | p03835 | u737508101 | 1588816016 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 194 | k, s = map(int, input().split())
x <= k
y <= k
z <= k
count = 0
for x in range(s+1):
for y in range(s+1):
for z in range(s+1):
if x + y + z == s:
count =count+1
print(count)
|
s704890568 | p03835 | u916662650 | 1588798275 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 250 | K,S = (int(x) for x in input().split())
count = 0
for x in range(K+1):
if x > S:
break
for y in range(K+1):
z = s - x - y
if 0 <= z <= K:
count += 1
elif x + y > S:
break
print(count) |
s528835710 | p03835 | u186542450 | 1588748031 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2106 | 41564 | 259 | K, S = map(int, input().split())
X = []
def dfs(A):
if len(A) == 3:
if A[0] + A[1] + A[2] == S:
X.append(A.copy())
return
for i in range(K + 1):
A.append(i)
dfs(A)
A.pop()
dfs([])
print(len(X))
|
s844368265 | p03835 | u699944218 | 1588725782 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 173 | K, S = list(map(int,input().split()))
count = 0
for x in range(K+1):
for y in range(K+1):
for z in range(K+1):
if X + Y + Z == S:
count += 1
print(count) |
s086656353 | p03835 | u840570107 | 1588651014 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 1 | a |
s294028479 | p03835 | u345966487 | 1588650660 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 94 | K,S=map(int,input().split())
print(sum(1for x in range(K+1)for y in range(K+1)if0<=S-x-y<=K))
|
s898548078 | p03835 | u870518235 | 1588566292 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 168 | K, S = map(int, input().split())
res = 0
for X in range(K+1):
for Y in range(K+1):
Z = S - X - Y
if Z in range(K+1)
res += 1
print(res) |
s204790505 | p03835 | u285891772 | 1588539966 | Python | Python (3.4.3) | py | Runtime Error | 164 | 13708 | 916 | import sys, 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, groupby
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()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
import numpy as np
K, S = MAP()
count = 0
for X in range(0, K+1):
for Y in range0, (K+1):
Z = S - X - Y
if 0 <= Z <= K:
count += 1
print(count) |
s281088699 | p03835 | u761154175 | 1588296480 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 180 | import math
k, s = map(int, imput().split())
res = 0
for x in range(k+1):
for y in range(k+1):
if x+y < s:
z = s - x - y
res += 1
print(res) |
s467680530 | p03835 | u761154175 | 1588296436 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 180 | import math
k, s = map(int, imput().split())
res = 0
for x in range(k+1):
for y in range(k+1):
if x+y < s:
z = s - x - y
res += 1
print(res) |
s486356252 | p03835 | u985949234 | 1588102377 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 181 | K,S = map(int, input().split())
ans = 0
for i in range(K+1):
if 0<= S-i <= K:
ans += (S-i)+1
elif S-i <= 2K:
a = (S-i) -K
ans += (K-a)+1
print(ans)
|
s931758782 | p03835 | u290795687 | 1587772425 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 173 | K = input()
S = input()
count = 0
for x in range(int(K)+1):
for y in range(int(K)+1):
z = int(S) - x - y
if 0 <= z and z <= int(K):
count += 1
print(count) |
s661056019 | p03835 | u290795687 | 1587772216 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 168 | K = input()
S = input()
count = 0
for x in range(K+1):
for y in range(K+1):
z = S - x - y
if 0 <= z and z <= K:
count = count + 1
print(count) |
s104020504 | p03835 | u290795687 | 1587771896 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 160 | K = input()
S = input()
count = 0
for x in range(K+1):
for y in range(K+1):
z = S - x - y
if 0 <= z and z <= K:
count += 1
print(count) |
s335570428 | p03835 | u581603131 | 1587758443 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 101 | K, S = map(int, input().split())
print(len([for X in range(K+1) for Y in range(K+1) if 0<=S-X-Y<=K])) |
s607290050 | p03835 | u581603131 | 1587756473 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 128 | #リスト内方表記1,
K, S = map(int, input().split())
print(len([1 for X in range(K+1) for Y in range(K+1) if 0<=S-X=Y<=K])) |
s810211629 | p03835 | u581603131 | 1587756130 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 101 | K, S = map(int, input().split())
print(len[1 for X in range(K+1) for Y in range(K+1) if 0<=S-X=Y<=K]) |
s659977740 | p03835 | u625495026 | 1587749092 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 137 | N,A,B = map(int,input().split())
ans = 0
for i in range(1,N+1):
if A<=(i//10)+(i%10) and (i//10)+(i%10)<=B:
ans+=i
print(ans) |
s810905636 | p03835 | u290795687 | 1587742668 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 186 | K = input()
S = input()
count = 0
for x in range(int(K)):
for y in range(int(K)):
z = int(S) - x - y
if 0 <= z and z <= int(K):
count += 1
print(count)
|
s854881416 | p03835 | u290795687 | 1587742609 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 186 | K = input()
S = input()
count = 0
for x in range(int(K)):
for y in range(int(K)):
z = int(S) - x - y
if 0 <= z and z <= int(K):
count += 1
print(count)
|
s311553658 | p03835 | u290795687 | 1587742480 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 166 | K = input()
S = input()
count = 0
for x in range(K):
for y in range(K):
z = S - x - y
if 0 <= z and z <= K:
count += 1
print(count)
|
s099713478 | p03835 | u290795687 | 1587742128 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 161 | K = input()
S = input()
count = 0
for x in range(K):
for y in range(K):
z = S - x - y
if 0=< z and z =< K:
count += 1
print(count)
|
s188256255 | p03835 | u652656291 | 1587607159 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 148 | k,s = int(input())
ans = 0
for x in range(k+1):
for y in range(k+1):
for z in range(k+1):
if x + y + z == s:
ans += 1
print(ans) |
s079146126 | p03835 | u203898698 | 1587407265 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 134 | K,S=map(int,input().split())
cnt=0
for X in range(K+1):
for Y in range(K+1):
if 0<=S-X-Y and S-X-Y <= k:
cnt+=1
print(cnt) |
s365408656 | p03835 | u692311686 | 1586811592 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2106 | 41052 | 263 | K,S=map(int,input().split())
asn=0
for i in range(K+1):
for j in range(i,K+1):
for k in range(j,K+1):
if i+j+k==S:
if i<j<k:
ans+=6
elif i<j==k or i==j<k:
ans+=3
else:
ans+=1
print(ans)
|
s560878865 | p03835 | u731448038 | 1586563366 | Python | Python (3.4.3) | py | Runtime Error | 1350 | 2940 | 137 | k,s=map(int, input().split())
for i in range(k+1):
for j in range(k+1):
x = s-i-j
if x>=0 and x<=k:
ans += 1
print(ans) |
s655139367 | p03835 | u266143155 | 1586410211 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 134 | k, s = map(int, input().split())
ans = 0
for i in range(k+1):
for j in range(k+1):
if 0 < s- (i + j) < k:
ans += 1
print(ans) |
s170718742 | p03835 | u266143155 | 1586409760 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 178 | k, s = map(int, input().split())
ans = 0
for i in range(k+1):
for j in range(k+1):
for k in range(k+1):
if i + j + k ==s:
ans += 1
print(ans) |
s910156146 | p03835 | u696444274 | 1586373673 | Python | PyPy3 (2.4.0) | py | Runtime Error | 172 | 38384 | 354 |
import math
import itertools
import statistics
#import numpy as np
import collections
#n = int(input())
k, s = list(map(int, input().split()))
#a = list(map(int, input().split()))
count = 0
for x in range(k+1):
for y in range(s-x+1):
z = s-x-y
ans = x+y+z
if ans==s and y <= k and z <= k:
count += 1
print(count)
|
s670297318 | p03835 | u458396858 | 1586293297 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 166 | k = int(input())
s = int(input())
ans = 0
for x in range(k+1):
for y in range(k+1):
r = s - (x + y)
if r >= 0 and r <= k:
ans += 1
print(ans
|
s583167702 | p03835 | u971124021 | 1586262637 | Python | Python (3.4.3) | py | Runtime Error | 1156 | 3060 | 187 | k,s = list(map(int,input().split()))
cnt = 0
def est():
for x in range(k+1):
for y in range(k+1):
if s-(x+y) >=0 and s-(x+y) <= k:
cnt += 1
return cnt
print(est()) |
s138524154 | p03835 | u015467545 | 1586195600 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 136 | n,k=map(int,input().split())
ans=0
for i in range(n+1):
for j in range(n+1):
for l in range(n+1):
if i+j+l==k:
ans+=1
print(ans) |
s417632347 | p03835 | u857547702 | 1586055145 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2106 | 41052 | 168 | K,S=map(int,input().split())
for i in range(K+1):
for j in range(K+1):
for k in range(K+1):
if (i+j+k)==S:
count+=1
print(count) |
s666043183 | p03835 | u857547702 | 1586054970 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 2940 | 168 | K,S=map(int,input().split())
for i in range(K+1):
for j in range(K+1):
for k in range(K+1):
if (i+j+k)==S:
count+=1
print(count) |
s409726503 | p03835 | u314837274 | 1585625857 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 153 | k,s=map(int,input().split())
count=0
for x in range(k+1):
for y in range(k+1):
for z in range(k+1):
if x+y+z=s:
count+=1
print(count) |
s073976312 | p03835 | u514118270 | 1585577519 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 133 | k,s = list(map(int,input().split()))
ans = 0
for i in range(k):
for j in range(k):
if 0 <= s-i-j <= k
ans += 1
print(ans) |
s880241271 | p03835 | u686390526 | 1585526662 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 124 | K,S = map(int, input().split())
c=0
for i in range(K+1):
for j in range(K+1):
if k > S-i-j:
c+=1
print(c)
|
s779912185 | p03835 | u731665172 | 1585191419 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 134 | K,S=map(int,input().split())
ans=0
for i in range(S+1):
for j in range(S+1-i):
if 0<=i,j,S-i-j<=K:
ans+=1
print(ans) |
s302928622 | p03835 | u805552010 | 1585182233 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 166 | K,S = map(int,input().split())
ans = 0
for x in range(K+1):
for y in range(K+1):
z = S - (x + y)
if 0 <= z <= k:
ans += 1
print(ans)
|
s635661358 | p03835 | u260036763 | 1584819551 | Python | Python (3.4.3) | py | Runtime Error | 16 | 2940 | 165 | K, S = map(int, input().split())
count = 0
for X in range(K+1):
for Y in range(K+1):
Z = S - X - Y:
if 0 <= Z and Z <= K:
count += 1
print(count) |
s789113138 | p03835 | u260036763 | 1584819248 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 167 | K, S = map(int, input().split())
count = 0
for X in range(K+1):
for Y in range(K+1):
for Z in range(K+1):
if X + Y + Z = S:
count += 1
print(count) |
s465251624 | p03835 | u163501259 | 1584206617 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 161 | k, s = map(int, input().split())
ans = 0
for x in range(k+1):
for y in range(k+1):
z = s-x-y
if k >= z >= 0:
ans += 1
print(ans)) |
s641167244 | p03835 | u163501259 | 1584206576 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 161 | k, s = map(int, input().split())
ans = 0
for x in range(k+a):
for y in range(k+1):
z = s-x-y
if k >= z >= 0:
ans += 1
print(ans)) |
s206415125 | p03835 | u000123984 | 1584138366 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 157 | ans = 0
k, s = map(int, input().split())
for x in range(k):
for y in range(k):
int z = s - x - y
if 0 <= z and z <= k:
ans += 1
print(ans) |
s790094274 | p03835 | u000123984 | 1584136888 | Python | Python (3.4.3) | py | Runtime Error | 114 | 3940 | 229 | def comb(n, r):
if r == 0 or n == r: return 1
else: return comb(n-1, r) + comb(n-1, r-1)
k, s = map(int, input().split())
if s <= k: print(comb(s+2, 2))
elif s <= 2*k: print(3*comb(s-k+2, 2))
else: print(3*comb(s-2*k+2,2)) |
s096881540 | p03835 | u000123984 | 1584136810 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 228 | def comb(n, r):
if r == 0 or n == r: return 1
else: return comb(n-1, r) + comb(n-1, r-1)
k, s = map(int, input().split())
if s <= k: print(comb(s+2, 2))
elif s <= 2*k: print(3*comb(s-k+2, 2))
else: print(3*comb(s-2k+2,2)) |
s038612541 | p03835 | u000123984 | 1584136744 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 226 | def comb(n, r):
if r == 0 or n == r: return 1
else: return comb(n-1, r) + comb(n-1, r-1)
k, s = map(int, input().split())
if s < k: print(comb(s+2, 2))
elif s < 2*k: print(3*comb(s-k+2, 2))
else: print(3*comb(s-2k+2,2)) |
s062287604 | p03835 | u000123984 | 1584136709 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 224 | def comb(n, r):
if r == 0 or n == r: return 1
else: return comb(n-1, r) + comb(n-1, r-1)
k, s = map(int, input().split())
if s < k: print(comb(s+2, 2))
elif s < 2k: print(3*comb(s-k+2, 2))
else: print(3*comb(s-2k+2,2)) |
s013845956 | p03835 | u000123984 | 1584136240 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 150 | def comb(n, r):
if r == 0 or n == r: return 1
else: return comb(n-1, r) + comb(n-1, r-1)
k, s = map(int, input().split())
print(comb(s-3k+2, 2)) |
s489922033 | p03835 | u000123984 | 1584135981 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 151 | def comb(n, r):
if r == 0 or n == r: return 1
else: return comb(n-1, r) + comb(n-1, r-1)
k, s = map(int, input().split())
print(comb(s-3k+2, 2)) |
s460624579 | p03835 | u000123984 | 1584135951 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 151 | def comb(n, r):
if r == 0 or n == k: return 1
else: return comb(n-1, r) + comb(n-1, r-1)
k, s = map(int, input().split())
print(comb(s-3k+2, 2)) |
s522554962 | p03835 | u000123984 | 1584135868 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 150 | def comb(n, k):
if k == 0 or n == k: return 1
else: return comb(n-1, k) + comb(n-1, k-1)
k, s = map(int, input().split())
print(comb(n-3k+2, 2)) |
s182137767 | p03835 | u814663076 | 1584132078 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 148 | K, S = map(int, input().split())
ans = 0
for x in range(K+1):
for y in range(K+1):
z = k - x - y
if 0 <= z <= K:
ans += 1
print(ans) |
s289722724 | p03835 | u676833945 | 1584117168 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 177 | vec = input().split(' ')
k = int(vec[0]) + 1
count = 0
for x in range(k):
for y in range(k):
z = int(vec[1]) - x - y
if z >= 0 and z <= k:
count += 1
print(count) |
s562580913 | p03835 | u185405877 | 1583976810 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 165 | x,y = list(map(int, input().split()))
count=0
for i in range(x+1):
for j in range(x+1):
k=y-i-j
if k=<x and 0=<k:
count+=1
print(count) |
s371626115 | p03835 | u185405877 | 1583976407 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 174 | x,y = list(map(int, input().split()))
count=0
for i in range(x):
for j in range(x):
for k in range(x):
a=i+j+K
if y==a:
count+=1
print(count) |
s440098409 | p03835 | u815878613 | 1583899169 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 186 | import itertools
K, S = map(int, input().split())
cnt = 0
K = list(range(K + 1))
for i, j in itertools.product(K, repeat=2):
if 0 <= S - i - j <= K:
cnt += 1
print(cnt)
|
s411610482 | p03835 | u898428248 | 1583721362 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 343 | import numpy as np
K,S = map(int, input().split())
def main():
cnt = 0
for x in range(K+1):
for y in range(K+1):
for z in range(K+1):
if x+y+z == S
cnt += 1
else:
pass
print(cnt)
if __name__ == "__main__":
main()
|
s989525160 | p03835 | u547605071 | 1583688620 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 39 | a,b,c = input().split(',')
print(a,b,c) |
s644880628 | p03835 | u547605071 | 1583688390 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 1389 | def solve(K: int, S: int):
cnt = 0
for x in range(K+1):
for y in range(K+1):
z = S - x - y
if z >= 0 and z <= K:
cnt += 1
print(cnt)
return
# Generated by 1.1.6 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()
K = int(next(tokens)) # type: int
S = int(next(tokens)) # type: int
solve(K, S)
if __name__ == '__main__':
main()
#!/usr/bin/env python3
import sys
def solve(K: int, S: int):
cnt = 0
for x in range(K+1):
for y in range(K+1):
z = S - x - y
if z >= 0 and z <= K:
cnt += 1
print(cnt)
return
# Generated by 1.1.6 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()
K = int(next(tokens)) # type: int
S = int(next(tokens)) # type: int
solve(K, S)
if __name__ == '__main__':
main()
提出情報 |
s593004541 | p03835 | u016901717 | 1583680533 | Python | PyPy2 (5.6.0) | py | Runtime Error | 34 | 27884 | 170 | k,s=map(int,input().split())
ans=0
for x in range(k+1):
for y in range(k+1):
for z in range(k+1):
if x+y+z==s:
ans+=1
print(ans)
|
s934511131 | p03835 | u540698208 | 1583257886 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 178 | K, S = map(int, input().split())
ANS = 0
for x in range(K + 1):
for y in rage(K + 1):
z = S - x - y
if (0 <= z) and z <= K:
ANS += 1
print(ANS) |
s281874483 | p03835 | u765607957 | 1582816887 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 171 | counter = 0
for x in range(K + 1):
for y in range(K + 1):
if S - (x + y) <= K:
z = S - (x + y)
if z >= 0 and z <= K:
counter += 1
print(counter) |
s814098620 | p03835 | u745687363 | 1582517767 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 99 | k,s=map(int,input().split())
ans=0
for i, j in range(k+1):
if s-k<=i+j<=s:
ans+=1
print(ans)
|
s613040946 | p03835 | u083494782 | 1582490449 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 168 | K,S=map(int,input().split())
ans = 0
z = 0
for x in range(K):
for y in range(K):
z = S - x - y
if z >= 0 and Z <= K:
ans += 1
print(ans) |
s892627577 | p03835 | u083494782 | 1582490386 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 162 | K,S=map(int,input().split())
ans = 0
for x in range(K):
for y in range(K):
z = S - x - y
if z >= 0 and Z <= K:
ans += 1
print(ans) |
s805145011 | p03835 | u757030836 | 1582294882 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 158 | K,S = map(int,input().split())
ans = 0
for x in range(K + 1):
for y in range (K + 1):
z = S - (x + y)
if 0 <= z <= k:
ans += 1
print(ans)
|
s527036337 | p03835 | u974792613 | 1582160276 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 190 | k, s = map(int, input().split(" "))
answer = 0
for i in range(k + 1):
for j in range(k + 1):
rem = 3 * k - i - j
if 0 <= rem <= k:
answer += 1
print(answer)
|
s577519995 | p03835 | u143976525 | 1581557970 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 153 | k,s=map(int,input().split())
ans=0
for x in range(k+1):
for y in range(k+1):
z=s-x-y
if 0<=z and z<=k
ans+=1
print(ans)
|
s802895917 | p03835 | u325206354 | 1581365131 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 184 | a,b=list(map(int,input().split()))
count=0
for x in range(a+1):
for y in range(a+1):
if b < x+y:
break
if b-x-y <= z:
count+=1
print(count)
|
s372945274 | p03835 | u796708718 | 1581288310 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 158 | K, S = int(input().split(" "))
cnt = 0
for x in range(K+1):
for y in range(K+1):
for z in range(K+1):
if x+y+z == S:
cnt +=1
print(cnt) |
s887650683 | p03835 | u609814378 | 1581267487 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 274 | K,S= map(int, input().split())
number_lis = []
ans = 0
for i in range(0,K+1):
number_lis.append(i)
for j in number_lis:
for k in number_lis:
for l in number_lis:
if 0<= (S -j -k) <=K:
ans = ans + 1
print(ans) |
s999461313 | p03835 | u840974625 | 1580871900 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 216 | k, s = map(int, input().split())
res = 0
for x in range(k+1):
if x <= s:
for y in range(k+1):
if (x + y) <= s:
for z in range(k+1):
if (x + y + z) == s:
res += 1
print(res) |
s239099237 | p03835 | u268792407 | 1580622878 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 232 | k,s=map(int,input().split())
from math import factorial
def c(n,k):
return factorial(n)//factorial(n-k)//factorial(k)
if s<k:
print(c(s+2,2))
elif 3*k < s:
print(0)
else:
# k<=s<=3k の場合
くっそ~わかんねぇ~ |
s175265698 | p03835 | u843722521 | 1580013015 | Python | PyPy3 (2.4.0) | py | Runtime Error | 256 | 41068 | 130 | k,s=map(int,input().split())
a=0
for i in range(k+1):
for j in range(k+1):
if s-i-j <=k and s-i-j >=0:
a+=1
print(ans) |
s382764680 | p03835 | u779170803 | 1579502161 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 490 | INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
n=INT()
ts=LIST()
m=INT()
xs=[0]*m
for i in range(m):
p,x=INTM()
xs[i]=ts[p-1]-x
tst=sum(ts)
for i in range(m):
#print(xs[i])
print(tst-xs[i])
#print(ts)
if __name__ == '__main__':
do() |
s055513672 | p03835 | u210369205 | 1579198344 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 276 | def Sumofnum(K,S):
A = min(K,S) + 1
a = max(S - 2*K, 0)
c = 0
for x in range (a,A):
B = min(S - x,K) + 1
b = max(S - x - K,0)
for y in range (b,B):
c = c + 1
print(c)
s = list(map(int,input().split()))
Sumofnum(K,S) |
s296370930 | p03835 | u617037231 | 1578915421 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 231 | K,S = map(int,input().split())
res = 0
for X in range(0,K+1):
if X > S:
break
for Y in range(0,K+1):
if X + Y > S:
break
elif 0<=(S-X-Y) and (S-X-Y)) <= K:
res += 1
print(res) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.