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
s339226209
p03835
u589843455
1566959179
Python
Python (3.4.3)
py
Runtime Error
17
2940
236
k,s = map(int,input().split()) count = 0 num = range(k+1) for x in num: for y in num: if x + Y > s: break: for z in num: if x + y + z == s: count += 1 elif x + y + z > s: break: print(count)
s009620463
p03835
u589843455
1566959117
Python
Python (3.4.3)
py
Runtime Error
17
2940
234
k,s = map(int,input().split()) count = 0 num = range(k+1) for x in num: for y in num: if x + Y > s: break for z in num: if x + y + z == s: count += 1 elif x + y + z > s: break print(count)
s274004458
p03835
u397496203
1566789297
Python
Python (3.4.3)
py
Runtime Error
17
2940
161
k,s = list(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)
s930633260
p03835
u204842730
1566444755
Python
Python (3.4.3)
py
Runtime Error
17
2940
141
k,s = map(int,input().split()) ans = 0 for i in range(k+1): for j in range(k+1): z = s-x-y if(0 <= z and z <= k): ans += 1 print(ans)
s963699178
p03835
u981931040
1566356696
Python
Python (3.4.3)
py
Runtime Error
18
2940
163
K , S = int(input().split()) count = 0 for i in range(K): for j in range(K): for k in range(k): if i + j + k == S: count += 1 print(count)
s097529058
p03835
u688375653
1566170012
Python
Python (3.4.3)
py
Runtime Error
1294
1939628
429
import numpy as np def count_true(matrix:np.array, s:int): return np.count_nonzero(matrix == s) def unk(k:int, s:int): # 条件チェック if all([(2 <= k <= 2000), (0 <= s <= 3*k)]): x = y = z = np.array([range(0,k+1)]) c = count_true(np.ravel(x.T+y)+ z.T, s) print(c) if __name__ == '__main__': data = input().split(" ") data = list(map(int, data)) unk(data[0], data[1])
s876136674
p03835
u688375653
1566169899
Python
Python (3.4.3)
py
Runtime Error
17
2940
453
import numpy as np def count_true(matrix:np.array, s:int): return np.count_nonzero(matrix == s) def unk(k:int, s:int): # 条件チェック if all([(2 <= k <= 2000), (0 <= s <= 3*k)]): x = y = z = np.array([range(0,k+1)]) c = count_true(np.ravel(x.T+y)+ z.T, s) print(c) if __name__ == '__main__':     data = input().split(" ")     data = list(map(int, data))     unk(data[0], data[1])
s109428288
p03835
u896741788
1566147280
Python
Python (3.4.3)
py
Runtime Error
17
2940
248
k,s=map(int,input(),split()) ans=0 for a in range(k+1): for b in range(k+1): if 0<=(s-a-b)<=k: ans+=1 print(ans)k,s=map(int,input().split()) ans=0 for a in range(k+1): for b in range(k+1): if 0<=(s-a-b)<=k: ans+=1 print(ans)
s475378697
p03835
u503518808
1566092823
Python
Python (3.4.3)
py
Runtime Error
17
2940
183
K, S = map( input().split(), int) count = 0 for x in range(K+1): for y in range(K+1): for z in range(K+1): temp = x + y + z if temp == S: count += 1 print(count)
s984916465
p03835
u791527495
1565888782
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)
s593074228
p03835
u791527495
1565888752
Python
Python (3.4.3)
py
Runtime Error
17
2940
164
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)
s341755796
p03835
u791527495
1565888652
Python
Python (3.4.3)
py
Runtime Error
20
3064
148
K,S = map(int,input().split()) count = 0 for x in range(K + 1): for y in range(K + 1): if 0 <= S - x - y <= k: count += 1 print(count)
s268642148
p03835
u791527495
1565888439
Python
Python (3.4.3)
py
Runtime Error
17
2940
191
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): total = x + y + z if total = S: count += 1 print(count)
s365951719
p03835
u412481017
1565841137
Python
Python (3.4.3)
py
Runtime Error
17
2940
95
n=int(input()) sum=0 for _ in range(n): a,b=map(int,input().split()) sum+=b-a+1 print(sum)
s930957571
p03835
u548684908
1565787443
Python
Python (3.4.3)
py
Runtime Error
2105
323804
508
import bisect N = 1000 memo = [[0] * N for i in range(N)] def pascal(x,y): if memo[x][y] != 0: return memo[x][y] elif y == 1: return x elif x == y or y == 0 or x ==1: return 1 else: return pascal(x-1,y) + pascal(x-1,y-1) K,S = list(map(int,input().split())) sum_list = sorted([i+j for i in range(0,K+1) for j in range(0,K+1)]) cnt = 0 for X in range(0,K+1): if S-X > 2*K: continue else: cnt += pascal(2*K,S-K) print(cnt)
s295723668
p03835
u908763441
1565568681
Python
Python (3.4.3)
py
Runtime Error
18
3060
245
#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 from math import factorial K, S = map(int, input().split()) S = S if K * 3 / 2 > S else K * 3 - S count = int(factorial(S+2) / factorial(2) / factorial(S+2 - 2)) print(str(count))
s278413954
p03835
u908763441
1565566412
Python
Python (3.4.3)
py
Runtime Error
182
14240
224
#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 from scipy.special import comb K, S = map(int, input().split()) S = S if K * 3 / 2 - S > 0 else K * 3 - S count = comb(S + 2, 2, exact=True) print(str(count))
s477951120
p03835
u889344512
1565403889
Python
PyPy3 (2.4.0)
py
Runtime Error
180
38640
168
k,s = map(int,input().split()) count = 0 for i in range(k+1): for j in range(k+1): z = s-x-y if z>=0 and z<=k: count += 1 print(count)
s773056350
p03835
u638282348
1565401825
Python
Python (3.4.3)
py
Runtime Error
17
2940
173
for x in range(k + 1): for y in range(k + 1): if x + y > s: break for z in range(k + 1): count += (x + y + z == s) print(count)
s494929254
p03835
u910295650
1565213842
Python
Python (3.4.3)
py
Runtime Error
17
2940
157
a,b=map(int,input().split()) ans=0: for i in range(a+1): for j in range(a+1): for k in range(a+1): if i+j+k==b: ans++ print(ans)
s687452211
p03835
u690576712
1565203297
Python
Python (3.4.3)
py
Runtime Error
938
2940
120
k,s = map(int,input().split()) for i in range(k): for j in range(k): if 0<=(s-k-j)<=k: count+=1 print(count)
s390582238
p03835
u850200768
1565072059
Python
Python (3.4.3)
py
Runtime Error
17
2940
149
K, S = map(int,input().split()) cnt = 0 for i in range(K+1): for j in range(K+1): if 0 <= S - i - j <= k: cnt +=1 print(cnt)
s143572409
p03835
u369338402
1564346795
Python
Python (3.4.3)
py
Runtime Error
17
2940
119
k,s=map(int,input().split()) res=0 for x in range(k+1): for y in range(k+1): if s-x-y=>0: res+=1 print(res)
s832060175
p03835
u825116851
1564108423
Python
Python (3.4.3)
py
Runtime Error
18
3056
347
def solve(K, S): 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 = count + 1 if x + y + z > S: break return count if __name__ == '__main__': K, S = input().split() print(solve(K, S))
s668933983
p03835
u815797488
1564036776
Python
Python (3.4.3)
py
Runtime Error
17
2940
169
K,S = map(int, input().split()) count = 0 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)
s747346258
p03835
u756518877
1563846087
Python
Python (3.4.3)
py
Runtime Error
17
2940
188
# -*- coding: utf-8 -*- K,S=map(int,input().split()) count=0 for i in range(1,K+1): for j in range(1,K+1): for k in range(1,K+1): if i+j+k=S: count=count+1 print(count)
s492235206
p03835
u777283665
1563638770
Python
Python (3.4.3)
py
Runtime Error
17
3060
265
k, s = map(int, input().split()) ans = 0 for x in range(k+1): if x > s: break for y in range(k+1): if sum(x, y) > s: break for z in range(k+1): if sum(x, y, z) > s: break if sum(x, y, z) == s: ans += 1 print(ans)
s952033027
p03835
u539517139
1562591423
Python
Python (3.4.3)
py
Runtime Error
17
2940
187
k,s=map(int,input().split()) x=0 for a in range(k+1): if a>s: break for b in range(k+1): if a+b>s: break for c in range(k+1): if a+b+c=s: x+=1 print(x)
s055315846
p03835
u314050667
1562033898
Python
Python (3.4.3)
py
Runtime Error
17
2940
146
s,k=map(int,input().split()) cnt = 0 for x in range(k+1): for y in range(y+1): if 0 <= s-(x+y) <= 2500: cnt+=1 print(cnt)
s023515918
p03835
u538956308
1561832944
Python
Python (3.4.3)
py
Runtime Error
17
2940
326
K,S = map(int,input().split()) one = 0 three = 0 six = 0 if S%3==0: one = 1 else: one = 0 for l in range(K+1): if (S-l)%2==0 and (S-l)//2 =< K: three += 1 for m in range(K-1): for n in range(m+1,K): rest = S-(m+n) if rest>n and rest<=K: six += 1 print(one+3*(three-one)+6*six)
s319142579
p03835
u538956308
1561829847
Python
Python (3.4.3)
py
Runtime Error
2104
3064
296
K,S = map(int,input().split()) div = (K+1)//3 one = 0 three = 0 six = 0 for l in range(div): for m in range(l+1,div): for n in range(m+1,div): if l+m+n == S: six +=1 if S%3 == 0: one = 1 for i in range(K+1): if (S-i)%2 ==0 and S%3!=0: two +=1 print(one+3*three+6*six)
s896994041
p03835
u395202850
1561638889
Python
Python (3.4.3)
py
Runtime Error
18
3060
190
K=int(input()) S=int(input()) cnt= 0 for x in range(0,K+1): for y in range(0,K+1): for z in range(0,K+1): if ((x + y + z )== S): cnt += 1 print(cnt)
s140734833
p03835
u745223262
1561235678
Python
Python (3.4.3)
py
Runtime Error
17
2940
347
a = list(map(int,input().split())) k = a[0] s = a[1] num=0 for l in range(k+1): for m in range(l,k+1): n = s-l-m if(n <= k & n >= 0): if(l!=m and l!= n and m!=n): num+=3 else if (l==m and m==n): num+=1 else: num+=2 print(num)
s624491685
p03835
u745223262
1561235156
Python
Python (3.4.3)
py
Runtime Error
17
2940
139
a = list(map(int,input().split())) num=0 for l in range(a[0]+1): for m in range(a[0]+1): if(a[1]-l-m <= k): num+=1
s853853776
p03835
u745223262
1561235104
Python
Python (3.4.3)
py
Runtime Error
17
2940
137
a = list(map(int,input().split())) num=0 for l in range(a[0]+1): for m in range(a[0]+1): if(a[1]-l-m <= k): num++
s483534964
p03835
u745223262
1561234388
Python
Python (3.4.3)
py
Runtime Error
17
2940
117
k,s = input().split() for l in range(k): for m in range(k): if(s-l-m <= k): print(l,m,s-l-m)
s338548691
p03835
u062459048
1561163222
Python
Python (3.4.3)
py
Runtime Error
17
2940
176
K, S = map(int, input().split()) count = 0 for i in range(K+1): for j in range(K+1): if S - i - j <= K : count += 1 else: pass print(count)
s346475597
p03835
u623687794
1560905760
Python
Python (3.4.3)
py
Runtime Error
17
2940
142
k,s=map(int,input().split()) ans=0 for i in range(k): for j in range(k): fpr h in range(k): if i+j+h==s: ans+=1 print(ans)
s252816181
p03835
u105210954
1560027062
Python
Python (3.4.3)
py
Runtime Error
17
2940
192
k, s = map(int, input().split()) res = 0 for a in range(k + 1): for b in range(k + 1): for c in range(k + 1): if a + b + c == s: res += 1 break: print(res)
s943911857
p03835
u672494157
1560017546
Python
Python (3.4.3)
py
Runtime Error
17
3064
751
import math def inputs(num_of_input): ins = [input() for i in range(num_of_input)] return ins def solve(inputs): points = list(map(lambda x: sp(x), inputs)) N = len(points) distances = [] for i, _ in enumerate(points): for j in range(i + 1, N): distances.append( math.sqrt( (points[i][0] - points[j][0]) ** 2 + (points[i][1] - points[j][1]) ** 2 ) ) max = 0 for d in distances: max = d if max < d else max return "%.6f" % max def sp(s): new_s = s.split() return list(map(lambda x: int(x), new_s)) if __name__ == "__main__": N = int(input()) ret = solve(inputs(N)) print(ret)
s105586460
p03835
u483640741
1559942598
Python
Python (3.4.3)
py
Runtime Error
17
2940
172
k,s=map(int,input().split()) count=0 for i in range(k+1): for j in range(k+1): z=s-(i+j) if nums.count(z): count+=1 print(count)
s291818699
p03835
u016622494
1559940691
Python
Python (3.4.3)
py
Runtime Error
17
2940
46
s = input() print(s.replace(',', ' '))
s325167350
p03835
u172111219
1559932437
Python
PyPy3 (2.4.0)
py
Runtime Error
186
39664
137
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)
s931147003
p03835
u778814286
1559908544
Python
Python (3.4.3)
py
Runtime Error
18
2940
172
K, S = map(int,input().split()) import itertools ar = itertools.product(range(K+1), repeat=2) ans = 0 for a,b in ar: if S - a-b <= K and S-a-b >=: ans += 1 print(ans)
s729823480
p03835
u494514222
1559789068
Python
Python (3.4.3)
py
Runtime Error
18
3060
231
import itertools K, S = map(int, input().split()) if not ((2 <= K and K <= 2500) or (0 <= S and S <= 3*K)): exit() ans = [[x,y] for x in range(2, K+1) for y in range(2, K+1) if (0<=(S-X-Y)) and ((S-X-Y)<=K)] print(len(ans))
s914872584
p03835
u890870565
1559316121
Python
Python (3.4.3)
py
Runtime Error
17
2940
1023
# include <bits/stdc++.h> # define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i) # define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i) # define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i) # define rreps(i, n) for(int i=((int)(n)); i>0; --i) # define ALL(x) (x).begin(), (x).end() # define SZ(x) ((int)(x).size()) # define pb push_back # define optimize_cin() cin.tie(0); ios::sync_with_stdio(false) # define MSG(x) std::cout << #x << " : " << x << "\n"; using namespace std; using lint = long long; template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } int main() { int K, S; cin >> K >> S; int cnt = 0; rep (X, K+1) { rep (Y, K+1) { rep (Z, K+1) { if (X + Y + Z == S) { cnt++; } } } } cout << cnt << "\n"; return 0; }
s535335672
p03835
u614734359
1558298021
Python
Python (3.4.3)
py
Runtime Error
17
2940
173
from itertools import product k,s = (int(i) for i in input().split()) cnt = 0 for a in product(range(min(k+1,s+1),repeat=3): if sum(a) == s: cnt += 1 print(cnt)
s764597912
p03835
u194894739
1558053698
Python
Python (3.4.3)
py
Runtime Error
17
2940
142
K, S = map(int,input()) ans = 0 for x in range(K+1): for y in range(K+1): if 0 <= S - x - y <= K: ans += 1 print(ans)
s667412937
p03835
u489109659
1558020451
Python
Python (3.4.3)
py
Runtime Error
17
2940
235
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c,k,s; cin >> k >> s; int soma = 0; for(int i = 0;i<=k;i++){ for(int j = 0;j<=k;j++){ if(s-i-j >=0 and s -i - j<=k) soma ++; } } cout<<soma<<endl; }
s668185349
p03835
u977193988
1557953288
Python
Python (3.4.3)
py
Runtime Error
17
3060
171
K,S=map(int,input().split()) if S<=K: print((S+2)*(S+1)//2) elif S<=2*K: s=S-math.ceil(K/3)*3 print((s+2)*(s+1)//2) else: s=3*K-S print((s+2)*(s+1)//2)
s144585745
p03835
u220345792
1557577508
Python
Python (3.4.3)
py
Runtime Error
18
2940
155
K, S = map(int, input().split()) cnt = 0 for i in range(K+1): for j in range(K+1): k = S - i -j: if k <= 0 and S <= k: cnt += 1 print(cnt)
s391604550
p03835
u808373096
1557464542
Python
PyPy3 (2.4.0)
py
Runtime Error
2106
41052
172
K, S = map(int, input().split()) for a in range(0, K + 1): for b in range(0, K + 1): for c in range(0, K + 1): if a + b + c == S: cnt += 1 print(cnt)
s302751428
p03835
u360980679
1557341424
Python
Python (3.4.3)
py
Runtime Error
17
2940
254
def f(K, S): #ここに処理を書いてください res = 0 for i in range(K+1): for j in range(K+1): if i + j <= S and S-i-j <= K: res += 1 return res in = list(map(int, input().split())) print(f(in[0], in[1]))
s024126451
p03835
u204800924
1557179034
Python
Python (3.4.3)
py
Runtime Error
17
2940
186
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)
s096381206
p03835
u166621202
1556906929
Python
Python (3.4.3)
py
Runtime Error
17
2940
122
K,S=map(int,input()) cnt = 0 for x in range(K+1): for y in range(K+1): if 0 <= S-x-y <= K: cnt += 1 print(cnt)
s535480483
p03835
u463655976
1556499958
Python
Python (3.4.3)
py
Runtime Error
17
3064
247
import math N = int(input()) P = list(tuple(map(int, input().split())) for _ in range(N)) M = 0 for i in range(N): for j in range(1,N): M = max(M, math.sqrt((P[i][0]-P[j][0]) ** 2 + (P[i][1]-P[j][1]) ** 2)) print("{:.6f}".format(M))
s155822539
p03835
u167681750
1555994097
Python
Python (3.4.3)
py
Runtime Error
17
3060
143
n, s = map(int, (input().split())) ans = 0 for x,y in product(range(n+1), range(n+1)): if 0 <= s - x - y <= n: ans += 1 print(ans)
s968636049
p03835
u381713448
1555896440
Python
Python (3.4.3)
py
Runtime Error
17
2940
150
k,s = map(int,input().split()) c = 0 if s == 3*k: c = 1 elif s >= 2*k: c = (5 - s % k) * 3 elif s >= k: c = pass else: c = 3 * k print(c)
s365562117
p03835
u589578850
1555538581
Python
Python (3.4.3)
py
Runtime Error
17
2940
143
k,s = map(int ,input()split()) cnt =0 for x in range(s+1): for y in range(s+1): z = s - x- y if z <= k and 0 <= z: cnt += 1 print(cnt)
s138974227
p03835
u771458127
1555470356
Python
PyPy3 (2.4.0)
py
Runtime Error
171
38640
489
def count(k, s): answer = 0 for a in range(s + 1): if a > k: break if s - a > 2*k: continue for b in range(a, s + 1): x = a - 0 y = b - a z = s - b if y > k: break if z <= k and x + y + z == s: answer += 1 return answer if __name__ == '__main__': k, s = ' '.split(input()) k = int(k) s = int(s) print(count(k, s))
s028699746
p03835
u722535636
1554991287
Python
Python (3.4.3)
py
Runtime Error
17
2940
139
k,s=map(int,input().split()) cnt=0 for i in range(s+1): for j in range(i,s+12 2): if i<=k and j-i<=k and s-j<=k: cnt+=1 print(cnt)
s280711025
p03835
u411544692
1554779165
Python
Python (3.4.3)
py
Runtime Error
17
2940
141
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) <= K cnt += 1 print(cnt)
s030723642
p03835
u655048024
1554641434
Python
Python (3.4.3)
py
Runtime Error
17
3056
209
K = int(input()) S = int(input()) counter = 0 for i in range(K): for j in range(K): for l in range(K): i+j+l=M if (M==S): counter = counter + 1 else: None print(counter)
s534379554
p03835
u655048024
1554641384
Python
Python (3.4.3)
py
Runtime Error
17
2940
199
K = int(input()) S = int(input()) counter = 0 for i in range(K): for j in range(K): for l in range(K): if (i+j+l==S): counter = counter + 1 else: None print(counter)
s947438096
p03835
u655048024
1554641351
Python
Python (3.4.3)
py
Runtime Error
17
2940
190
K = int(input()) S = int(input()) counter = 0 for i in range(K): for j in range(K): for l in range(K): if (i+j+l==S): counter += 1 else: None print(counter)
s784035289
p03835
u655048024
1554641274
Python
Python (3.4.3)
py
Runtime Error
17
3060
165
K = int(input()) S = int(input()) counter = 0 for i in range(K): for j in range(K): for l in range(K): if (i+j+l==S): counter += 1 print(counter)
s066615174
p03835
u655048024
1554641169
Python
Python (3.4.3)
py
Runtime Error
17
2940
165
K = int(input()) S = int(input()) counter = 0 for i in range(K): for j in range(K): for l in raneg(K): if (i+j+l==S): counter += 1 print(counter)
s662873815
p03835
u655048024
1554641073
Python
Python (3.4.3)
py
Runtime Error
17
2940
160
S,K = map(int,input().split) counter = 0 for i in range(K): for j in range(K): for l in raneg(K): if (i+j+l==S): counter += 1 print(counter)
s042351656
p03835
u655048024
1554641036
Python
Python (3.4.3)
py
Runtime Error
18
2940
158
S,K = map(int,input().split) counter = 0 for i in range(K): for j in range(K): for l in raneg(K): if (i+J+l==S): counter+=1 print(counter)
s436808576
p03835
u382431597
1554216947
Python
Python (3.4.3)
py
Runtime Error
18
2940
373
#include <iostream> #include <string> #include <vector> #include <string.h> #include <algorithm> using namespace std; int main(){ int n; cin >> k >> s; count=0; for(int x=0; x<<k+1; x++){ for(int y=0; y<<k+1; y++){ for(int z=0; z<<k+1; z++){ if(x+y+z==s){ count++; } } } } cout << count << endl; return 0; }
s352372814
p03835
u382431597
1554216688
Python
Python (3.4.3)
py
Runtime Error
17
2940
181
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)
s325014854
p03835
u239204773
1554211635
Python
Python (3.4.3)
py
Runtime Error
18
2940
360
K,S = (int(_) for _ in input().split()) out = 0 for x in range(K+1): for y in range(x): for z in range(y) if x + y + z == S : if x == y and y == z: out += 1 elif x == y or y == z or z == x: out += 3 else: out += 6 print(out)
s395117225
p03835
u309457741
1554060758
Python
Python (3.4.3)
py
Runtime Error
18
2940
145
K, S = map(int, input().spllit()) count = 0 for x in range(K+1): for y in range(K+1): if S - K <= x + y <= S: count += 1 print(count)
s001123151
p03835
u309457741
1554060685
Python
Python (3.4.3)
py
Runtime Error
17
2940
145
K, S = map(int, input().spllit()) count = 0 for x in range(K+1): for y in range(K+1): if S - K <= x + y <= S: count += 1 print(count)
s648244894
p03835
u013408661
1553650815
Python
Python (3.4.3)
py
Runtime Error
17
2940
168
count=0 k,s=map(int,input().split()) for i in range(s): for j in range(s-i): for m in range(s-i-j): if i<=k ans j<=k ans m<=k: count+=1 print(count)
s065212652
p03835
u924737192
1552955261
Python
Python (3.4.3)
py
Runtime Error
17
2940
479
import numpy as np import sys x = [[int(i) for i in input().split()] for j in range(1)] k = x[0][0] s = x[0][1] #k = 5 #s = 15 count = 0 for x in range(k+1): if x = s: count = count + 1 break for y in range(k+1): if s < x + y: break if x + y = s: count = count + 1 break for z in range(k+1): if s - x - y < k: count = count + 1 break print(count)
s694673282
p03835
u924737192
1552955232
Python
Python (3.4.3)
py
Runtime Error
17
2940
479
import numpy as np import sys x = [[int(i) for i in input().split()] for j in range(1)] k = x[0][0] s = x[0][1] #k = 5 #s = 15 count = 0 for x in range(k+1): if x = s: count = count + 1 break for y in range(k+1): if s < x + y: break if x + y = s: count = count + 1 break for z in range(k+1): if s - x - y < k: count = count + 1 break print(count)
s390388820
p03835
u924737192
1552953499
Python
Python (3.4.3)
py
Runtime Error
150
12452
309
import numpy as np import sys x = [[int(i) for i in input().split()] for j in range(1)] k = x[0] s = x[1] #k = 5 #s = 15 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 = count + 1 break print(count)
s869890248
p03835
u598699652
1552876274
Python
Python (3.4.3)
py
Runtime Error
17
2940
187
K, S = int(input().split()) ans = 0 for o in range(2, K): for p in range(2, K-o): for q in range(2, K-o-p): if o + p + q == S: ans += 1 print(ans)
s026786615
p03835
u598699652
1552876203
Python
Python (3.4.3)
py
Runtime Error
17
2940
180
K, S = int(input().split()) ans = 0 for o in range(2, K): for p in range(2, K): for q in range(2, K): if o + p + q == S: ans += 1 print(ans)
s772089724
p03835
u350049649
1552797473
Python
Python (3.4.3)
py
Runtime Error
2104
2940
143
K,S=map(int,input().split()) for i in range(K): for j in range(K-i): for k in range(K-i-j): if i+j+k==S: ans+=1 print(ans)
s651681505
p03835
u729133443
1552525834
Python
Python (3.4.3)
py
Runtime Error
18
2940
82
k,s=map(int,input().split());k+=1;print(sum(k>=s-x//k-y%k>=0for I in range(k**2)))
s840586705
p03835
u292810930
1552383282
Python
Python (3.4.3)
py
Runtime Error
18
2940
53
K,S = map(int,input().split()) print(sum(range(S+1))
s218673765
p03835
u627417051
1551570668
Python
Python (3.4.3)
py
Runtime Error
17
3060
234
K, S = list(map(int, input().split())) if S <= K: print(int((S + 2) * (S + 1) / 2)) elif S <= 2 * K: ans = int((S - K + 1) * (2 * K - S) * (S - K) (S - K + 1) / 2) print(ans) else: print(int((3 * K - S + 1) * (3 * K - S + 2) / 2))
s032953751
p03835
u627417051
1551570613
Python
Python (3.4.3)
py
Runtime Error
18
3060
234
K, S = list(map(int, input().split())) if S <= K: print(int((S + 2) * (S + 1) / 2)) elif S <= 2 * K: ans = (S - K + 1) * (2 * K - S) * int((S - K) (S - K + 1) / 2) print(ans) else: print(int((3 * K - S + 1) * (3 * K - S + 2) / 2))
s365778965
p03835
u627417051
1551570568
Python
Python (3.4.3)
py
Runtime Error
18
3060
234
K, S = list(map(int, input().split())) if S <= K: print(int((S + 2) * (S + 1) / 2)) elif S <= 2 * K: ans = (S - K + 1) * (2 * K - S) * int((S - K) (S - K + 1) / 2) print(ans) else: print(int((3 * K - S + 1) * (3 * K - S + 2)) / 2)
s474801229
p03835
u227170240
1551234539
Python
Python (3.4.3)
py
Runtime Error
18
2940
305
K, S = map(int, input().split) count = 0 for x in range(K): if x == S: count++ break for y in range(K): if x + y == S: count++ break for z in range(K): if x + y + z == S: count++ break print(count)
s145490050
p03835
u392029857
1551200635
Python
Python (3.4.3)
py
Runtime Error
17
2940
155
k, s = map(int, input().split()) x = range(k+1) y = range(k+1) cnt = 0 for i in x: for p in y: if (s-x+y) <= k: cnt += 1 print(cnt)
s535747588
p03835
u977349332
1551099864
Python
Python (3.4.3)
py
Runtime Error
17
2940
141
K, S = map(int, input().split()) answer = 0 for x in range(K+1): for y in range(K+1): if S - x - y <= K: answer += 1 print(answer)
s976369271
p03835
u717001163
1551041992
Python
Python (3.4.3)
py
Runtime Error
18
2940
131
k,s=map(int,input().split()) ans=0 for x in range(k+1): for y in range(k+1): z=s-x+y ans += 1 if z>=0 and z<=k print(ans)
s762723583
p03835
u516272298
1550565135
Python
Python (3.4.3)
py
Runtime Error
17
3060
161
k,s = map(int,input().split()) if s/k == 3 or k/s == 3: print(1) elif k < s: print(int((1/2)*(k+1)*(k+2))) elif k >= s: print(int((1/2)*(s+1)*(s+2)))
s468656003
p03835
u401487574
1550520898
Python
Python (3.4.3)
py
Runtime Error
17
2940
185
k,s = map(int,input().split()) Xm = k Ym = k Zm = k count = 0 for i in range(Xm+1): for j in range(Ym+1): for m in range(Zm+1): if i+j+m = s: count += 1 print(count)
s965492766
p03835
u371467115
1550043273
Python
Python (3.4.3)
py
Runtime Error
18
2940
167
k,s=map(int,input().split()) cnt=0 ans=0 for i in range(k+1): for j in range(k+1): for k in range(k+1): ans=i+j+k if ans=s: cnt+=1 print(cnt)
s363821341
p03835
u762955009
1548526629
Python
Python (3.4.3)
py
Runtime Error
18
2940
328
#include <bits/stdc++.h> using namespace std; int main() { int K, S; cin >> K >> S; long long ans = 0; for (int x = 0; x <= K; ++x) { for (int y = 0; y <= K; ++y) { for (int z = 0; z <= K; ++z) { if (x + y + z == S) ans++; } } } cout << ans << endl; }
s256982065
p03835
u551351897
1548485166
Python
Python (3.4.3)
py
Runtime Error
18
2940
146
k,s=int(input()) count = 0 for x in range(k+1): for y in range(k+1): if 0 <= (s - x - y) and (s - x - y) <= k: count += 1 print(count)
s857240887
p03835
u801512570
1548129373
Python
Python (3.4.3)
py
Runtime Error
18
2940
137
K, S=map(int,input().split) answer=0 for x in range(K+1): for y in range(K+1): if S-(x+y)<=K: answer+=1 print(answer)
s290439350
p03835
u977855674
1547999361
Python
Python (3.4.3)
py
Runtime Error
17
2940
131
K, S = map(int, input().split()) ans = [i for i in itertools.product(range(K + 1), repeat=3)] print([sum(i) for i in ans].count(S))
s569052664
p03835
u494871759
1546735289
Python
Python (3.4.3)
py
Runtime Error
851
252128
352
K,S = map(int,input().split()) patterns = 0 arr = [[x+y for y in range(min(S-x+1,K+1))] for x in range(K+1)] # farr = list(chain.from_iterable(arr)) for a in arr: min_z = S - max(a) max_z = S - min(a) # if min_z <= K and max_z >=0: patterns += max(0,min(max_z,K) - max(0,min_z) + 1) # print(farr) # print(farr.count(S)) print(patterns)
s737172987
p03835
u494871759
1546735146
Python
Python (3.4.3)
py
Runtime Error
846
252128
340
K,S = map(int,input().split()) patterns = 0 arr = [[x+y for y in range(min(S-x+1,K+1))] for x in range(K+1)] # farr = list(chain.from_iterable(arr)) for a in arr: min_z = S - max(a) max_z = S - min(a) if min_z <= K and max_z >=0: patterns += min(max_z,K) - min_z + 1 # print(farr) # print(farr.count(S)) print(patterns)
s076245015
p03835
u037449077
1546202777
Python
Python (3.4.3)
py
Runtime Error
18
3056
316
import sys K, S = sys.stdin.readlines()[0].strip().split(' ') total_pattern = 0 def recursive_solver(state): for k in K: s = recursive_solver(state - k) if s == 0: total_pattern += 1 elif s < 0: return -1 else: return recursive_solver(s) recursive_solver(S) print(total_patter)