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
s075064281
p03835
u717265305
1578702833
Python
Python (3.4.3)
py
Runtime Error
18
2940
228
k, s = map(int, input().split()) p = 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: p+=1 if (x+y+z) >= s: break if (x+y+Z) >= s: break print(p)
s159801386
p03835
u190875453
1578432209
Python
Python (3.4.3)
py
Runtime Error
18
3060
260
K,S = map(int, input().split()) if K == S: print( (K+5)*(K+4)//2 ) sys.exit( ) ans = 0 for X in range(K+1): S1 = S - X if S1 < 0: break else: if S1 <= K: ans += S1 + 1 elif S1 <= 2 * K: ans += S1 - 2*K + 1 else: continue print(ans)
s410471021
p03835
u148551245
1578043368
Python
Python (3.4.3)
py
Runtime Error
17
2940
1764
fn main() { let s: i32 = read(); let k: i32 = read(); let mut ans = 0; for i in 0..k+1 { for j in 0..k+1 { for l in 0..k+1 { if i+j+l == s { ans += 1; } } } } println!("{}", ans); } // 以下関数 use std::io::*; use std::str::FromStr; pub fn read<T: FromStr>() -> T { let stdin = stdin(); let stdin = stdin.lock(); let token: String = stdin .bytes() .map(|c| c.expect("failed to read char") as char) .skip_while(|c| c.is_whitespace()) .take_while(|c| !c.is_whitespace()) .collect(); token.parse().ok().expect("failed to parse token") } pub const MOD: u64 = 1_000_000_007; pub fn is_prime(n: i32) -> bool { if n < 2 { return false; } else if n == 2 { return true; } let mut i = 2; while i * i < n { if n % i == 0 { return false; } else { i += 1; continue; } } true } pub fn lcm(mut n: i32, mut m: i32) -> i32 { n = if n > m { m } else { n }; m = if n > m { n } else { m }; let mut i = n; while i % m != 0 { i += n; } i } pub fn abs(n: i32) -> i32 { if n >= 0 { n } else { -n } } pub fn max(n: i32, m: i32) -> i32 { if n >= m { n } else { m } } pub fn min(n: i32, m: i32) -> i32 { if n <= m { n } else { m } } pub fn factorial(n: u32) -> u32 { if n == 0 { return 1; } let mut r = n; for i in 0..n - 1 { r *= n - i - 1; } r } pub fn combination(n: u32, m: u32) -> u32 { factorial(n) / factorial(m) / factorial(n - m) }
s632918413
p03835
u506858457
1577988603
Python
Python (3.4.3)
py
Runtime Error
18
2940
143
K,S=map(int,input().split()) cnt=0 K+=1 for i in range(K): for j in range(K): k=S-(i+j) if (S>=0) and (S<=K) cnt+=1 print(cnt)
s332918470
p03835
u155283965
1577816228
Python
PyPy3 (2.4.0)
py
Runtime Error
172
38512
167
N, K = map(int, input() .split()) candidate = list(range(N+1)) comb = list(itertools.product(candidate, repeat=3)) l = [c for c in comb if sum(c) == K] print(len(l))
s979009116
p03835
u063073794
1577496812
Python
Python (3.4.3)
py
Runtime Error
17
2940
159
yandy K, S = map(int, input().split()) ans = 0 for z in range(K+1): for y in range(K+1): if 0 <= S - z - y <= K: ans += 1 print(ans)
s758202806
p03835
u311669106
1577314104
Python
Python (3.4.3)
py
Runtime Error
17
2940
170
k,s=map(int,input().split()) ans=0 for i in range(k+1): for j in range(k+1): for l in range(s-i-j+1): if s-i-j-l==0: ans+=1 print(ans)
s065755992
p03835
u609814378
1577031399
Python
Python (3.4.3)
py
Runtime Error
17
2940
160
K,S = [int(i) for i in input().split()] ans = 0 for x in range(K+1): for y in range(K+1): if 0 <= S-x-y <=k: ans = ans + 1 print(ans)
s284366870
p03835
u609814378
1577031364
Python
Python (3.4.3)
py
Runtime Error
17
2940
154
K, S = map(int, input().split()) ans = 0 for x in range(K+1): for y in range(K+1): if 0 <= S-x-y <=k: ans = ans + 1 print(ans)
s672786889
p03835
u875600867
1576849620
Python
PyPy3 (2.4.0)
py
Runtime Error
2106
41964
291
K,S = map(int, input().split()) ans = 0 if K*3<S: print(0) exit() for x in range(K, -1, -1): if x >S: continu for y in range(K, -1, -1): if x+y >S: continue for z in range(K, -1, -1): if x+y+z==S: ans+=1 elif x+y+z<S: break print(ans)
s545907642
p03835
u311669106
1576699616
Python
Python (3.4.3)
py
Runtime Error
17
2940
152
k,s=int(input()) i=0 for x in range(k+1): for y in range(k+1): for z in range(k+1): if (x+y+z)==s: i+=1 print(i)
s417686812
p03835
u311669106
1576699560
Python
Python (3.4.3)
py
Runtime Error
18
2940
150
k,s=int(input()) i=0 for x in range(k+1): for y in range(k+1): for z in range(k+1): if x+y+z==s: i+=1 print(i)
s328546974
p03835
u417014669
1576697594
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): for z in range(k+1): if x+y+z=s: count+=1 print(count)
s845247882
p03835
u417014669
1576697497
Python
Python (3.4.3)
py
Runtime Error
17
2940
169
k,s=map(int, input().split()) x+y+z=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+=1 print(count)
s876202401
p03835
u417014669
1576697437
Python
Python (3.4.3)
py
Runtime Error
17
2940
169
k,s=map(int, input().split()) x+y+z=s count=0 for x in range(k+1): for y in range(k+1): for z in range(z+1): if x+y+z=s: count+=1 print(count)
s995729125
p03835
u905582793
1576553712
Python
Python (3.4.3)
py
Runtime Error
17
2940
125
k,s=map(int,input().split()) ans = 0 for i in range(1,k+1): for j in range(1,k;1): if s-i-j<=k: ans+=1 print(ans)
s172588343
p03835
u778720350
1576429055
Python
Python (3.4.3)
py
Runtime Error
17
2940
196
k, s = map(input, input().split(' ')) r = 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: r += 1 print(r)
s704033213
p03835
u288786530
1576374570
Python
Python (3.4.3)
py
Runtime Error
17
3060
197
k,s = map(int, input().split()) ans = 0 x = range(k + 1) y = range(k + 1) z = range(k + 1) for i in x: for j in y: for k in z: if s - i - j <= z and i + j + k == s: ans += 1 print(ans)
s139837706
p03835
u771756419
1576370801
Python
Python (3.4.3)
py
Runtime Error
17
2940
169
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)
s261331034
p03835
u873616440
1576097172
Python
Python (3.4.3)
py
Runtime Error
17
2940
192
k, s = input().split() c = 0 for i range(k+1): x = i for j range(k+1): y = j for h range(k+1): z = h sum = x + y + z if sum == k: c += 1 print(c)
s894907057
p03835
u873616440
1576096651
Python
Python (3.4.3)
py
Runtime Error
17
2940
183
k, s = input() c = 0 for i range(k+1): x = i for j range(k+1): y = j for h range(k+1): z = h sum = x + y + z if sum == k: c += 1 print(c)
s502162166
p03835
u780475861
1575659961
Python
Python (3.4.3)
py
Runtime Error
17
2940
243
k,s = [int(i) for i in input().split()] def a(n): return int(n * (n + 1) / 2) if s <= k: print(a(s + 1)) elif s >= 2 * k and s <= 3 * k: print(a(3 * k - s + 1)) elif s > k and s < 2 * k: print(a(s + 1) - 3 * a(s - k)) else: print(0)
s727866016
p03835
u780475861
1575659840
Python
Python (3.4.3)
py
Runtime Error
73
3896
271
k,s = [int(i) for i in input().split()] def a(n): if n == 1: return n else: return n + a(n-1) if s <= k: print(a(s + 1)) elif s >= 2 * k and s <= 3 * k: print(a(3 * k - s + 1)) elif s > k and s < 2 * k: print(a(s + 1) - 3 * a(s - k)) else: print(0)
s632363795
p03835
u780475861
1575659780
Python
Python (3.4.3)
py
Runtime Error
73
3896
252
k,s = [int(i) for i in input().split()] def a(n): if n == 1: return n else: return n + a(n-1) if s <= k: print(a(s+1)) elif s >= 2 * k and s <= 3 * k: print(a(3 * k - s + 1)) elif s > k and s < 2 * k: print(a(s + 1) - 3 * a(s - k))
s969110356
p03835
u780475861
1575659713
Python
Python (3.4.3)
py
Runtime Error
17
2940
260
k,s = [int(i) for i in input().split()] def a(n): if n == 1: return n else: return n + a(n-1) if k >= s: print(a(s+1)) elif s >= 2 * k and s <= 3 * k: print(a(3 * k - s + 1)) elif s > k and s < 2 * k: print(a(s + 1) - 3 * a(s - k)) else:
s551783758
p03835
u780475861
1575659115
Python
Python (3.4.3)
py
Runtime Error
73
3896
233
k,s = [int(i) for i in input().split()] def a(n): if n == 1: return n else: return n + a(n-1) if k >= s: print(a(s+1)) elif s >= 2 * k and s <= 3 * k: print(a(3 * k - s + 1)) else: print(a(s + 1) -3 * a(s - k))
s860792089
p03835
u074338678
1575348492
Python
Python (3.4.3)
py
Runtime Error
17
2940
169
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 <= k: count += 1 print(count)
s611325290
p03835
u074338678
1575348431
Python
Python (3.4.3)
py
Runtime Error
17
2940
169
k,s = map(int, input().split()) count = 0 for x in range(k+1): for i in range(k+1): z = S - (x + y) if 0 <= z <= k: count += 1 print(count)
s640951289
p03835
u329706129
1575246756
Python
Python (3.4.3)
py
Runtime Error
17
2940
316
#include <iostream> using namespace std; int main() { int k, s; int x, y, z; int cnt = 0; cin >> k >> s; for (x = 0; x <= k; x++) { for (y = 0; y <= k; y++) { if (0 <= s - x - y && s - x - y <= k) cnt++; } } cout << cnt << endl; }
s455876871
p03835
u343523553
1575238941
Python
Python (3.4.3)
py
Runtime Error
17
2940
313
K,S = map(int,input().split()) sum=0 for x in range(0,K+1): for y in range(x,K+1): if x+y-S<=0: z = S-x-y if x==y and y==z and z==x: sum+=1 elif x!=z and z!=y and y!=x: sum+=6 else: sum+=3 print(sum)
s491517061
p03835
u457554982
1575238161
Python
Python (3.4.3)
py
Runtime Error
17
3060
193
[k,s]=list(map(int,input().split())) counter=0 imax=min(s+1,k+1) jmax=min(s-i+1,k+1) for i in range(imax): for j in range(0,jmax): if i<=k and j<=k and s-i-j<=k: counter+=1 print(counter)
s479704323
p03835
u782616557
1575085946
Python
Python (3.4.3)
py
Runtime Error
17
2940
178
K,S=map(int,input().split()) for x in range(K+1): num=X for y in range(K+1): num+=y for z in range(K+1): num+=z if num==S: result+=1 print(result)
s040067734
p03835
u357949405
1575079903
Python
Python (3.4.3)
py
Runtime Error
19
3060
309
K, S = list(map(int, input().split())) ans = 0 for x in range(K+1): xyz = x if S > xyz: continue for y in range(K+1): xyz += y if S > xyz: continue: for z in range(K+1): xyz += z if xyz == S: ans += 1 print(ans)
s012499484
p03835
u703442202
1574869940
Python
Python (3.4.3)
py
Runtime Error
17
2940
143
k,s = map(int,input().split()) counter = 0 for i in range(k+1): for m in range(k+1): if 0 <= s -i- m <= k: counter+= 1 print(counter)
s722717533
p03835
u703442202
1574869795
Python
Python (3.4.3)
py
Runtime Error
17
2940
145
k,s = map(int,input().split()) counter = 0 for i in range(k+1): for m in range(k+1): if 0 <= (s -i- m) <= k: counter+= 1 print(counter)
s315284953
p03835
u161776322
1574561125
Python
Python (3.4.3)
py
Runtime Error
18
2940
187
K, S = map(int, input().split()) result = 0 for x in range(K + 1): for y in range(K + 1): Z = S - X - Y if 0 <= Z and Z <= K: result += 1 print(result)
s660461944
p03835
u161776322
1574560962
Python
Python (3.4.3)
py
Runtime Error
17
2940
180
K, S = map(int, input().split()) result = 0 for x in range(K + 1): for y in range(K + 1): Z = S - X - Y if 0 <= Z <= K: result += 1 print(result)
s860830870
p03835
u836737505
1574222827
Python
Python (3.4.3)
py
Runtime Error
17
2940
164
K, S = map(int, input().split()) c = 0 for i in range(K+1): for j in range(K+1): b = S - i - j if b <= k and b >= 0: c += 1 print(c)
s549019352
p03835
u836737505
1574222769
Python
Python (3.4.3)
py
Runtime Error
17
2940
164
K, S = map(int, input().split()) c = 0 for i in range(K+1): for j in range(K+1): b = S - i - j if b <= k and b >= 0: c += 1 print(c)
s898590846
p03835
u187109555
1573956992
Python
Python (3.4.3)
py
Runtime Error
17
2940
174
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)
s867794230
p03835
u187109555
1573956910
Python
Python (3.4.3)
py
Runtime Error
17
2940
173
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)
s591284088
p03835
u470359972
1573845511
Python
Python (3.4.3)
py
Runtime Error
17
2940
141
k,s=map(int,input().split()) cnt=0 for i in range(k): for j in range(k): for l in range(k): if i+j+l=s: cnt+=1 print(cnt)
s055994150
p03835
u602677143
1573747688
Python
Python (3.4.3)
py
Runtime Error
17
2940
223
k,s = map(int,input().split()) n = 0 for x in range(k+1): for y in range(k+1): z = s-(x+y) if z <= k and z > 0=: if x+y+z==s: n += 1 print(n)
s529878688
p03835
u783278511
1573242694
Python
Python (3.4.3)
py
Runtime Error
18
2940
155
K , S = map(int, input().split()) count = 0 for i in range(K + 1): n = S - i if t >= 0: count += max(0, (t + 1) - 2*(max(0, t - k ))) print(count)
s069174137
p03835
u783278511
1573242537
Python
Python (3.4.3)
py
Runtime Error
17
2940
141
K , S = map(int , input().split()) count = 0 for i in range(K+1): n = S-i if t>=0: count += max(0,(t+1)-2*(max(0,t-k))) print(count)
s496995072
p03835
u783278511
1573242327
Python
Python (3.4.3)
py
Runtime Error
17
2940
123
K,S=map(int, input().split()) count=0 for i in range(K+1): if S-i>=0: count=max(0,S-i+1-max(0,S-i-k)*2) print(count)
s835222382
p03835
u783278511
1573242287
Python
Python (3.4.3)
py
Runtime Error
18
2940
129
K,S=list(map(int, input().split())) count=0 for i in range(K+1): if S-i>=0: count=max(0,S-i+1-max(0,S-i-k)*2) print(count)
s276547934
p03835
u783278511
1573241732
Python
Python (3.4.3)
py
Runtime Error
17
2940
154
K,S=list(map(int, input().split())) count=0 for i in range(K+1): int j=S-i if i<=S and j<=K*2: count=(j+1)-max(0,j-k)*2 ans+=count print(ans)
s548305785
p03835
u783278511
1573241628
Python
Python (3.4.3)
py
Runtime Error
18
2940
149
K,S=list(map(int, input().split())) count=0 for i in range(K+1): j=S-i if i<=S and j<=K*2: count=(j+1)-max(0,j-k)*2 ans+=count print(ans)
s094128312
p03835
u992759582
1573194050
Python
Python (3.4.3)
py
Runtime Error
17
2940
148
a,s = map(int,input().split()) sum = 0 for i in range(0,a+1): for j in range(0,a+1): if s-i-j <= a: sum + = 1 print(sum)
s358631030
p03835
u633548583
1573177945
Python
Python (3.4.3)
py
Runtime Error
2104
2940
177
K,S=map(int,input().split()) conut=0 for x in range(K+1): for y in range(K+1): for z in range(K+1): while x+y+z==S: count+=1 print(count)
s211414748
p03835
u633548583
1573177869
Python
Python (3.4.3)
py
Runtime Error
17
2940
176
K=int(input()) S=int(input()) conut=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)
s065132641
p03835
u633548583
1573177773
Python
Python (3.4.3)
py
Runtime Error
2103
3316
174
K,S=map(int,input().split()) conut=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)
s550499146
p03835
u633548583
1573177712
Python
Python (3.4.3)
py
Runtime Error
17
2940
174
K,S=map(int,inpit().split()) conut=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)
s425683633
p03835
u633548583
1573177687
Python
Python (3.4.3)
py
Runtime Error
17
2940
174
K,S=map(int,inpit().split()) conut=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)
s368133133
p03835
u633548583
1573177602
Python
Python (3.4.3)
py
Runtime Error
17
2940
186
K,S=map(int,inpit().split()) conut=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)
s848936489
p03835
u434282696
1573165397
Python
PyPy3 (2.4.0)
py
Runtime Error
171
38256
125
k,s=map(int,input().split()) res=0 for i in range(k+1): for j in range(K+1): if 0<=s-i-j and s-i-j<=k:res+=1 print(res)
s330425444
p03835
u557494880
1572745975
Python
Python (3.4.3)
py
Runtime Error
17
2940
259
K,S = int(input()) ans = 0 for i in range(K): for j in range(K): for k in range(K): V = i + j + k if V == S: ans += 1 break elif V > S: break print(ans)
s514997998
p03835
u557494880
1572745857
Python
Python (3.4.3)
py
Runtime Error
18
2940
257
K,S = int(input()) ans = 0 for i in range(K): for j in range(K): for k in range(K): V = i + j + k if V = S: ans += 1 break elif V > S: break print(ans)
s113348190
p03835
u279292103
1572701729
Python
Python (3.4.3)
py
Runtime Error
17
2940
159
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 <=k: count = count +1 print(count)
s624571024
p03835
u947315641
1572279749
Python
Python (3.4.3)
py
Runtime Error
28
3692
304
# -*- coding: cp932 -*- import math import sys import os import csv import pandas as pd k, s = map(int, input().split()) i = 0 for n1 in range(k +1): for n2 in range(k+1): for n3 in range(k+1): if n1 + n2 + n3 == s: i = i + 1 print(i,end="")
s318630677
p03835
u947315641
1572279700
Python
Python (3.4.3)
py
Runtime Error
27
3692
298
# -*- coding: cp932 -*- import math import sys import os import csv import pandas as pd k, s = map(int, input().split()) i = 0 for n1 in range(k +1): for n2 in range(k+1): for n3 in range(k+1): if n1 + n2 + n3 == s: i = i + 1 print(i)
s197632241
p03835
u947315641
1572279647
Python
Python (3.4.3)
py
Runtime Error
22
3444
271
import math import sys import os import csv import pandas as pd k, s = map(int, input().split()) i = 0 for n1 in range(k +1): for n2 in range(k+1): for n3 in range(k+1): if n1 + n2 + n3 == s: i = i + 1 print(i)
s401839071
p03835
u215315599
1571787239
Python
Python (3.4.3)
py
Runtime Error
374
251184
399
K, S = map(int,input().split()) listK = [i for i in range(K+1)] list2K = [i for i in range(K**2)] ans = 0 for i in range(K+1): id = bisect.bisect_left(list2K,S-i) if id < len(list2K) and list2K[id] == S-i: for j in range(K+1): id2 = bisect.bisect_left(listK,list2K[id]-j) if id2 < len(listK) and listK[id2] == list2K[id]-j: ans += 1 print(ans)
s539433895
p03835
u215315599
1571754821
Python
Python (3.4.3)
py
Runtime Error
18
3060
249
K, S = map(int,input().split()) listK = [i for i in range(K+1)] ans = 0 for i in range(K+1): for j in range(K+1): id = bisect.bisect_left(listK,S-i-j) if id < len(listK) and listK[id] == S-i-j: ans += 1 print(ans)
s957305221
p03835
u239528020
1570937773
Python
Python (3.4.3)
py
Runtime Error
17
3060
270
start = time.time() K, S = map(int, input().split()) K+=1 count=0 for i in range(K): for j in range(0, K-i): tmp = S - (i + j) if tmp>=0 and tmp<=K: count+=1 # print(i,j,tmp) print(count) end = time.time() print(end-start)
s757775419
p03835
u871596687
1570718603
Python
Python (3.4.3)
py
Runtime Error
17
2940
187
k = int(input()) s = int(input()) x = 0 y = 0 z = 0 i = 0 for x in range(k): for y in range(k): for z in range(k): if x+y+z == s: i +=1 print(i)
s232395883
p03835
u871596687
1570718571
Python
Python (3.4.3)
py
Runtime Error
17
3064
183
k = int(input()) s = int(input()) x = 0 y = 0 z = 0 i = 0 for x in range(k) for y in range(k) for z in range(k) if x+y+z == s: i +=1 print(i)
s108032168
p03835
u365152996
1570151568
Python
Python (3.4.3)
py
Runtime Error
17
3060
210
def f(K, S): num=0 for a in range(K+1): if S-a>=0 and S-a<=2*K: if S-a<=K: num+=S-a+1 else: num+=min((S-a)-K,K)+1 return num (K,S)=input() print(f(K,S))
s836066683
p03835
u690781906
1570104831
Python
Python (3.4.3)
py
Runtime Error
17
2940
182
k, s = map(int, input().split()) count = 0 for a in range(k): for b in range(k): for c in range(k): if a + b + c == S: count += 1 print(count)
s809495942
p03835
u925336653
1569952588
Python
Python (3.4.3)
py
Runtime Error
18
3060
209
k = int(input()) s = int(input()) counter = 0 for x in range(k+1): for y in range(k+1): for z in range(k+1): if s == x+y+z: counter += 1 print(counter)
s515669182
p03835
u069129582
1569381211
Python
Python (3.4.3)
py
Runtime Error
18
2940
153
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)
s078360581
p03835
u069129582
1569381191
Python
PyPy3 (2.4.0)
py
Runtime Error
167
38384
153
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)
s528096275
p03835
u181195295
1569178993
Python
Python (3.4.3)
py
Runtime Error
18
2940
104
K,S = map(int,input().split()) ans=[1 for x in (K+1) for y in (K+1) if 0<=S-x-y <= K] print(len(ans))
s898335143
p03835
u181195295
1569178894
Python
Python (3.4.3)
py
Runtime Error
18
2940
100
K,S = map(int,input().split()) ans=[1 for x in (K+1) for y in (K+1) if K-x-y <= K] print(len(ans))
s287106317
p03835
u880526732
1569177650
Python
Python (3.4.3)
py
Runtime Error
17
2940
220
data=int(input().split b=data[0] c=data[1] d=0 e=0 f=0 for i in range(b): for j in range(b): for k in range(b): d=i+j+k if d <=15: e=e+1 else: pass print(e)
s160960934
p03835
u880526732
1569175600
Python
Python (3.4.3)
py
Runtime Error
17
2940
287
import random data=int(input().split b=data[0] c=data[1] count_data=0 random_data=random.randint(0,b) random_data2=random.randint(0,b) random_data3=random.randint(0,b) resalt=random_data+random_data2+random_data3 if resart<= c: count_data=count_data+1 else: pass print(count_data)
s962089573
p03835
u156113867
1568694566
Python
Python (3.4.3)
py
Runtime Error
17
2940
165
K, S = map(int, input().split()) count = 0 for x in K+1: for y in K-x: z = K - x - y if (x>=0) and (y>=0) and (z>=0): count += 1 print(count)
s190950353
p03835
u666415539
1568672356
Python
Python (3.4.3)
py
Runtime Error
17
2940
138
k,s=map(int,input().split()) count=0 for i in range(k): for j in range(k): if s-i-j=k: count+=1 break print(count)
s620220995
p03835
u799751074
1568141975
Python
Python (3.4.3)
py
Runtime Error
17
3064
379
from sys import stdin k = int(stdin.readline().rstrip()) s = int(stdin.readline().rstrip()) count = 0 x = 0 y = 0 z = 0 for x in range(s+1): y = 0 for y in range(s+1): z = 0 z = s - x - y if s <= 3*k: break; if x <= k and y <= k and z<= k and 0 <= z: count +=1 print(x,y,z) print(count,flush=True)
s591363013
p03835
u799751074
1568140204
Python
Python (3.4.3)
py
Runtime Error
17
3060
340
from sys import stdin k = int(stdin.readline().rstrip()) s = int(stdin.readline().rstrip()) count = 0 x = 0 y = 0 z = 0 for x in range(s+1): y = 0 for y in range(s+1): z = 0 z = s - x - y if x <= k and y <= k and z<= k and 0 <= z: count +=1 #print(x,y,z) print(count,flush=True)
s199432245
p03835
u799751074
1568139913
Python
Python (3.4.3)
py
Runtime Error
17
3060
339
from sys import stdin k = int(stdin.readline().rstrip()) s = int(stdin.readline().rstrip()) count = 0 x = 0 y = 0 z = 0 for x in range(s+1): y = 0 for y in range(s+1): z = 0 z = s - x - y if x <= k and y <= k and z<= k and 0 <= z: count +=1 print(x,y,z) print(count,flush=True)
s351883234
p03835
u799751074
1568139573
Python
Python (3.4.3)
py
Runtime Error
17
3064
318
from sys import stdin k = int(stdin.readline().rstrip()) s = int(stdin.readline().rstrip()) count = 0 x = 0 y = 0 z = 0 for x in range(s+1): y = 0 for y in range(s+1): z = 0 if x + y + z <= k: z = s - x - y count +=1 #print(x,y,z) print(count,flush=True)
s494162197
p03835
u177411511
1567747281
Python
PyPy3 (2.4.0)
py
Runtime Error
181
38792
501
import sys import copy import string 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() k, s = na() ct = 0 for x in range(k+1): for y in range(k+1): z = s - x - y if 0 <= z <= k: ct += 1 print(ct)
s996181272
p03835
u572142121
1567734856
Python
Python (3.4.3)
py
Runtime Error
17
2940
151
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)
s113419595
p03835
u601321817
1567649644
Python
Python (3.4.3)
py
Runtime Error
18
3064
423
k, s = [int(x) for x in ks.split(" ")] comb = [] for x in range(min(k,s) + 1)[::-1]: print(x) for y in range(min(x + 1, s - x + 1))[::-1]: z = s - x - y if (x <= k and y <= k and z <= k and y <= x and z <= y): comb.append([x,y,z]) count = 0 for c in comb: l = len(set(c)) if l == 1: count += 1 elif l == 2: count += 3 else: count += 6 print(count)
s338687978
p03835
u601321817
1567649596
Python
Python (3.4.3)
py
Runtime Error
17
3064
423
k, s = [int(x) for x in ks.split(" ")] comb = [] for x in range(min(k,s) + 1)[::-1]: print(x) for y in range(min(x + 1, s - x + 1))[::-1]: z = s - x - y if (x <= k and y <= k and z <= k and y <= x and z <= y): comb.append([x,y,z]) count = 0 for c in comb: l = len(set(c)) if l == 1: count += 1 elif l == 2: count += 3 else: count += 6 print(count)
s176647245
p03835
u601321817
1567647239
Python
Python (3.4.3)
py
Runtime Error
18
3064
273
ks = input() count = 0 k, s = [int(x) for x in sk.split(" ")] count = 0 for i in range(min(k+1, s + 2)): for j in range(i + 1, s + 2): x = i y = j - i - 1 z = s - y - x if x <= k and y <= k and z <= k: count += 1 print(count)
s091290502
p03835
u601321817
1567647129
Python
Python (3.4.3)
py
Runtime Error
17
2940
198
count = 0 for i in range(min(k+1, s + 2)): for j in range(i + 1, s + 2): x = i y = j - i - 1 z = s - y - x if x <= k and y <= k and z <= k: count += 1
s215487046
p03835
u601321817
1567647108
Python
Python (3.4.3)
py
Runtime Error
17
3064
196
count = 0 for i in range(min(k, s + 2)): for j in range(i + 1, s + 2): x = i y = j - i - 1 z = s - y - x if x <= k and y <= k and z <= k: count += 1
s435697937
p03835
u601321817
1567646776
Python
Python (3.4.3)
py
Runtime Error
17
3060
214
sk = input() count = 0 for i in range(s + 2): for j in range(i + 1, s + 2): x = i y = j - i - 1 z = s - y - x if x <= k and y <= k and z <= k: count += 1 print(count)
s914016928
p03835
u946424121
1567614928
Python
Python (3.4.3)
py
Runtime Error
18
2940
152
k,s = map(int,input().split()) cnt = 0 for x in range(k+1): for y in range(k+1): if x + y <= s and x + y >= s - k cnt += 1 print(cnt)
s435035894
p03835
u946424121
1567614433
Python
Python (3.4.3)
py
Runtime Error
18
2940
147
k,s = map(int,input()) cnt = 0 for x in range(k): for y in range(k): for z in range(k): if x + y + z == s: cnt += 1 print(cnt)
s548430634
p03835
u020704785
1567380493
Python
PyPy3 (2.4.0)
py
Runtime Error
170
38256
311
k, s = map(int, raw_input().split()) xs = ys = zs = range(k + 1) cnt = 0 for x in xs: if s < x: continue for y in ys: if s < y: continue for z in zs: if s < z: continue if sum([x, y, z]) == s: cnt += 1 print cnt
s375305391
p03835
u045408189
1567026156
Python
Python (3.4.3)
py
Runtime Error
17
2940
120
k,s=map(int,input().split()) ans=0 for x in range(k+1): for y in range(k+1): if x+y+z<=s: ans+=1 print(ans)
s521105954
p03835
u045408189
1567026113
Python
Python (3.4.3)
py
Runtime Error
17
2940
120
k,s=map(int,input().split()) ans=0 for x in range(k+1): for y in range(k+1): if x+y+z<=s: ans+=1 print(ans)
s684496407
p03835
u589843455
1566960354
Python
Python (3.4.3)
py
Runtime Error
17
2940
189
k,s = map(int,input().split()) count = 0 for x in range(k+1): for y in range(k+1): if x + y > s: break a = s - x - y if a >= 0 && a <= k: count += 1 print(count)
s854988871
p03835
u589843455
1566960073
Python
Python (3.4.3)
py
Runtime Error
17
2940
265
k,s = map(int,input().split()) count = 0 for x in range(k+1): a=s-k-x a=0 if a < 0 for y in range(a,k+1): if x + y > s: break for z in range(k+1): if x + y + z == s: count += 1 elif x + y + z > s: break print(count)
s280228281
p03835
u589843455
1566960009
Python
Python (3.4.3)
py
Runtime Error
18
2940
262
k,s = map(int,input().split()) count = 0 for x in range(k+1): a = s-k-x a = 0 if a < 0 for y in range(a,k+1): if x + y > s: break for z in num: if x + y + z == s: count += 1 elif x + y + z > s: break print(count)
s050229310
p03835
u589843455
1566959970
Python
Python (3.4.3)
py
Runtime Error
19
3060
269
k,s = map(int,input().split()) count = 0 for x in range(k+1): a = s-k-x a = 0 if a < 0 else a for y in range(a,k+1): if x + y > s: break for z in num: if x + y + z == s: count += 1 elif x + y + z > s: break print(count)