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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s503934468 | p02412 | u902639104 | 1551391062 | Python | Python3 | py | Runtime Error | 0 | 0 | 212 | while True:
n,x=map(int,input().split())
if n==0 and x==0:break
for i in range(1,n+1):
for j in range(1,i):
for k in range(1,j):
if i+j+k==x:ans+=1
print(ans)
|
s581603107 | p02412 | u902639104 | 1551391181 | Python | Python3 | py | Runtime Error | 0 | 0 | 209 | while True:
n,x=map(int,input().split())
if n==0 and x==0:break
for i in range(1,n+1):
for j in range(1,i):
for k in range(1,j):
if i+j+k==x :a=a+1
print(a)
|
s576537977 | p02412 | u083560765 | 1555832606 | Python | Python3 | py | Runtime Error | 0 | 0 | 255 | while True:
a=0
num=list(map(int,input().split()))
if num[0]==0 and n[1]==0:
break
else:
for i in range(1,num[0]+1):
for j in range(i+1,num[0]+1):
for k in range(j+1,num[0]+1):
if i+j+k==num[1]:
a+=1
print(i,j,k)
|
s898591051 | p02412 | u610816226 | 1556877025 | Python | Python3 | py | Runtime Error | 0 | 0 | 301 | n = 0
while 1:
a, b = map(int, input().split())
if a == 0 and b == 0:
break
else:
for i in range(1, a+1):
for j in range(1, i):
for k in range(1, j):
if i + j + k = b:
n += 1
print(n)
|
s529811414 | p02412 | u218784088 | 1558935653 | Python | Python3 | py | Runtime Error | 0 | 0 | 839 |
BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001
while True:
N,X = map(int,input().split())
if N == 0 and X == 0:
break
ans = 0
for a in range(1,N+1):
for b in range(1,N+1):
if b <= a:
continue
c = X-(a+b)
if c > b and c ... |
s755647016 | p02412 | u742371605 | 1559022998 | Python | Python3 | py | Runtime Error | 0 | 0 | 475 | count_a = []
pos = 0
while True:
n, x = list(map(int, input().split()))
count = 0
if n == x == 0:
break
else:
for i in range(1, (n+1)):
for j in range(i+1, (n+1)):
for k in range(j+s1, (n+1)):
if (i != j) and (j != k) and (i != k):
... |
s961344719 | p02412 | u629874472 | 1559055436 | Python | Python3 | py | Runtime Error | 0 | 0 | 238 | e,a = map(int,input().split())
cnt =0
if e==0 and a==0:
break
else:
for i in range(1,e+1):
for j in range(i+1,e+1):
for k in range(j+1,e+1):
if i+j+k ==9:
cnt +=1
print(cnt)
|
s630616590 | p02412 | u344890307 | 1559358889 | Python | Python3 | py | Runtime Error | 0 | 0 | 302 | while True:
n,x=map(int,input().split())
if n==0 and x == 0:
break
else:0
if n+1 + n + n-1 <= x:
print(0)
else:
cnt=0
for i in range(1,n+1):
for j in range(i+1,n+1):
for k in range(j+1,n+1):
if i+j+k==x:
cnt+=1
print(cnt)
|
s634072989 | p02412 | u344890307 | 1559358898 | Python | Python3 | py | Runtime Error | 0 | 0 | 302 | while True:
n,x=map(int,input().split())
if n==0 and x == 0:
break
else:0
if n+1 + n + n-1 <= x:
print(0)
else:
cnt=0
for i in range(1,n+1):
for j in range(i+1,n+1):
for k in range(j+1,n+1):
if i+j+k==x:
cnt+=1
print(cnt)
|
s562827576 | p02412 | u250040203 | 1559538767 | Python | Python3 | py | Runtime Error | 0 | 0 | 255 | #ITP1_7_B
a=int(0)
m=int(0)
while True:
n,x=map(int,input().split())
if n ==0 and x==0:
break
for i in range(n):
j=i+1
for j in range(n):
h=i+2
for h in range(n):
if i+k+h==x:
k=k+1
print(k)
|
s862796117 | p02412 | u131984977 | 1423015674 | Python | Python3 | py | Runtime Error | 0 | 0 | 307 | while True:
(n, x) = [int(i) for i in input().split()]
if n == x == 0:
break
dataset = []
for a in range(1, n + 1):
for b in range(a + 1, n + 1):
for c in range(b + 1, n + 1):
if sum([a,b,c]) == x:
count += 1
print(count) |
s409429218 | p02412 | u131984977 | 1423016123 | Python | Python3 | py | Runtime Error | 0 | 0 | 597 | while True:
(n, x) = [int(i) for i in input().split()]
if n == x == 0:
break
count = 0
for a in range(x, 0, step=-1):
for b in range(a - 1, 0, step=-1):
if sum(a,b) > x:
break
for c in range(b - 1, 0, step=-1):
if sum(a,b,c) == x:
... |
s777943116 | p02412 | u823030818 | 1423017575 | Python | Python3 | py | Runtime Error | 0 | 0 | 348 | while True:
(n, x) = [int(i) for i in input().split()]
if n == x == 0:
break
cnt = 0
for i in range(1, n+1):
for j in range(i+1, n+1):
for k in range(j+1, n+1):
if (i + j + k) == x:
cnt += 1
elif (i + j + K) > x:
... |
s152688843 | p02412 | u971748390 | 1423232093 | Python | Python3 | py | Runtime Error | 0 | 0 | 235 | while True:
n,x=map(int,input().split())
count=0
if n==x==0 : break
else:
for i in range(1,n-1) :
for j in range(i+1,n):
for k in range(j+1,n+1):
if i+j+k==x :
count = count +1
print('count') |
s900583217 | p02412 | u527848444 | 1424657938 | Python | Python3 | py | Runtime Error | 0 | 0 | 261 | while True:
(n,x) = [int(i) for i in input().split()]
for a in range(1, n + 1 - 2):
for b in range(a + 1, n + 1 - 1):
for c in range(b + 1,n + 1):
if (a + b + c) == x:
count += 1
print(count) |
s102348898 | p02412 | u442346200 | 1424657978 | Python | Python3 | py | Runtime Error | 0 | 0 | 313 | while True:
(n , x) = [int (i) for i in input().split()]
if n == x == 0:
break
count = 0
for a in range(1, n + 1 = 2):
for b in range(a + 1, n + 1 - 1):
for c in range(b + 1, n + 1 ):
if (a + b + c) == x:
count += 1
print(count) |
s666579607 | p02412 | u745846646 | 1424658048 | Python | Python3 | py | Runtime Error | 0 | 0 | 312 | while True:
(n, x) = [int(i) for i in input().split()]
if n == x == 0:
break
count = 0
for a int range(1, n + 1 - 2):
for b in range(a + 1, n + 1 - 1 ):
for c in range(b + 1, n + 1):
if (a + b + c) == x:
count += 1
print(count) |
s998134395 | p02412 | u745846646 | 1424658066 | Python | Python3 | py | Runtime Error | 0 | 0 | 312 | while True:
(n, x) = [int(i) for i in input().split()]
if n == x == 0:
break
count = 0
for a int range(1, n + 1 - 2):
for b in range(a + 1, n + 1 - 1 ):
for c in range(b + 1, n + 1):
if (a + b + c) == x:
count += 1
print(count) |
s826773674 | p02412 | u745846646 | 1424658086 | Python | Python3 | py | Runtime Error | 0 | 0 | 312 | while True:
(n, x) = [int(i) for i in input().split()]
if n == x == 0:
break
count = 0
for a int range(1, n + 1 - 2):
for b in range(a + 1, n + 1 - 1 ):
for c in range(b + 1, n + 1):
if (a + b + c) == x:
count += 1
print(count) |
s391250001 | p02412 | u745846646 | 1424658112 | Python | Python3 | py | Runtime Error | 0 | 0 | 312 | while True:
(n, x) = [int(i) for i in input().split()]
if n == x == 0:
break
count = 0
for a int range(1, n + 1 - 2):
for b in range(a + 1, n + 1 - 1 ):
for c in range(b + 1, n + 1):
if (a + b + c) == x:
count += 1
print(count) |
s038188755 | p02412 | u745846646 | 1424659097 | Python | Python3 | py | Runtime Error | 0 | 0 | 312 | while True:
(n, x) = [int(i) for i in input().split()]
if n == x == 0:
break
count = 0
for a int range(1, n + 1 - 2):
for b in range(a + 1, n + 1 - 1 ):
for c in range(b + 1, n + 1):
if (a + b + c) == x:
count += 1
print(count) |
s788767904 | p02412 | u745846646 | 1424659418 | Python | Python3 | py | Runtime Error | 0 | 0 | 312 | while True:
(n, x) = [int(i) for i in input().split()]
if n == x == 0:
break
count = 0
for a int range(1, n + 1 - 2):
for b in range(a + 1, n + 1 - 1 ):
for c in range(b + 1, n + 1):
if (a + b + c) == x:
count += 1
print(count) |
s498985276 | p02412 | u745846646 | 1424660755 | Python | Python3 | py | Runtime Error | 0 | 0 | 315 | while True:
(n, x) = [int(i) for i in input().split()]
if n == x == 0:
break
count = 0
for a int range(1, n + 1 - 2):
for b in range(a + 1, n + 1 - 1 ):
for c in range(b + 1, n + 1):
if (a + b + c) == x:
count += 1
print(count) |
s507346630 | p02412 | u745846646 | 1424660796 | Python | Python3 | py | Runtime Error | 0 | 0 | 315 | while True:
(n, x) = [int(i) for i in input().split()]
if n == x == 0:
break
count = 0
for a int range(1, n + 1 - 2):
for b in range(a + 1, n + 1 - 1 ):
for c in range(b + 1, n + 1):
if (a + b + c) == x:
count += 1
print(count) |
s862993768 | p02412 | u604774382 | 1431246380 | Python | Python3 | py | Runtime Error | 0 | 0 | 371 | import sys
while True:
n, x = [ int( val ) for val in sys.stdin.readline().split( " " ) ]
if 0 == n and 0 == x:
break
cnt = 0
ave = x / 3
for i in range( 1, ave ):
for j in range( i+1, n ):
if x <= ( i+j ):
break
for k in range( j+1, n+1 ):
s = ( i + j + k )
if x == s:
cnt += 1
... |
s165255262 | p02412 | u604774382 | 1431246417 | Python | Python3 | py | Runtime Error | 0 | 0 | 371 | import sys
while True:
n, x = [ int( val ) for val in sys.stdin.readline().split( " " ) ]
if 0 == n and 0 == x:
break
cnt = 0
ave = x / 3
for i in range( 1, ave ):
for j in range( i+1, n ):
if x <= ( i+j ):
break
for k in range( j+1, n+1 ):
s = ( i + j + k )
if x == s:
cnt += 1
... |
s560074258 | p02412 | u622543677 | 1434750295 | Python | Python | py | Runtime Error | 0 | 0 | 269 | while True:
n,x = map(int,raw_input().split())
if n==0 and x==0:
break
ct = 0
for i in range(1, n+1):
for j in range(i+1, n+1):
for k in range(j+1, n+1):
if (i+j+k) == x:
ct += 1
print ct
~ |
s514117536 | p02412 | u067975558 | 1439173103 | Python | Python3 | py | Runtime Error | 0 | 0 | 156 |
n = int(input())
count = 0
for i in range(n-1):
for j in range(n):
for k in range(n+1):
if i + j + k == x: count+= 1
print(count) |
s411439065 | p02412 | u067975558 | 1439173199 | Python | Python3 | py | Runtime Error | 0 | 0 | 155 |
n = input()
count = 0
x = input()
for i in range(n - 1):
for j in range(n):
for k in range(n + 1):
if i + j + k == x: count += 1
print(count) |
s193441591 | p02412 | u255164080 | 1439174441 | Python | Python3 | py | Runtime Error | 0 | 0 | 90 | while True:
(n, x) = [int(i) for i in input().split()]
if n == x ==0
break |
s950589010 | p02412 | u255164080 | 1439174447 | Python | Python3 | py | Runtime Error | 0 | 0 | 90 | while True:
(n, x) = [int(i) for i in input().split()]
if n == x ==0
break |
s587723533 | p02412 | u713218261 | 1439174681 | Python | Python3 | py | Runtime Error | 0 | 0 | 388 | while True:
(n, x) = [int(i) for i in input().split()]
if n == x == 0:
break
for a in range(1, n+1):
for b in range(a+1, n+1):
for c in range(b+1, n+1):
count = 0
if (a + b + c) == x:
count += 1
elif (a + b + c... |
s138693973 | p02412 | u713218261 | 1439174698 | Python | Python3 | py | Runtime Error | 0 | 0 | 388 | while True:
(n, x) = [int(i) for i in input().split()]
if n == x == 0:
break
for a in range(1, n+1):
for b in range(a+1, n+1):
for c in range(b+1, n+1):
count = 0
if (a + b + c) == x:
count += 1
elif (a + b + c... |
s857500787 | p02412 | u152353734 | 1439175717 | Python | Python3 | py | Runtime Error | 0 | 0 | 123 | for i in range(1,n-1):
for j in range(i+1,n):
for k in range(j+1,n+1):
if i+j+k==x:ans+=1
print ans |
s347208208 | p02412 | u152353734 | 1439175868 | Python | Python3 | py | Runtime Error | 0 | 0 | 166 | (n, m) = [int(i) for i in input().split()]
for i in range(1,n-1):
for j in range(i+1,n):
for k in range(j+1,n+1):
if i+j+k==x:ans+=1
print ans |
s612340968 | p02412 | u442346200 | 1439176110 | Python | Python3 | py | Runtime Error | 0 | 0 | 337 | while True:
(n, x) = [int(i) for i in input().split()]
count = 0
for i in range(1, n + 1):
for j in range(i + 1, n + 1):
for k in range(j + 1, n + 1):
if x - (i + j + k) == 0:
count += 1
if x - (i + j + k) < 0:
break... |
s429206761 | p02412 | u501414488 | 1439776839 | Python | Python3 | py | Runtime Error | 0 | 0 | 210 | while True:
n = [int(i) for i in input().split()]
count = 0
for a in range(1,4):
for b in range(a+1,5):
for c in range(b+1, 6):
if a + b + c == 9:
count += 1
print(count) |
s910842922 | p02412 | u713218261 | 1439776857 | Python | Python3 | py | Runtime Error | 0 | 0 | 363 | (n, x) = [int(i) for i in input().split()]
if n == x == 0:
break
count = 0
for a in range(1, n+1):
for b in range(a+1, n+1):
for c in range(b+1, n+1):
if (a + b + c) == x:
count += 1
elif (a + b + c) > x:
... |
s780802409 | p02412 | u713218261 | 1439776952 | Python | Python3 | py | Runtime Error | 0 | 0 | 298 | (n, x) = [int(i) for i in input().split()]
if n == x == 0:
break
count = 0
for a in range(1, n+1):
for b in range(a+1, n+1):
for c in range(b+1, n+1):
if (a + b + c) == x:
count += 1
elif (a + b + c) > x:
break
print(count) |
s148860912 | p02412 | u501414488 | 1439857931 | Python | Python3 | py | Runtime Error | 0 | 0 | 204 | n = [int(i) for i in input().split()]
count = 0
for a in range(1,n+1):
for b in range(a+1,n+1):
for c in range(b+1, n+1):
if a + b + c == 9:
count += 1
print(count) |
s210262129 | p02412 | u501414488 | 1439858181 | Python | Python3 | py | Runtime Error | 0 | 0 | 259 | (n, x) = [int(i) for i in input().split()]
count = 0
for a in range(1,n+1):
for b in range(a+1,n+1):
for c in range(b+1, n+1):
if n = x = 0:
break
elif a + b + c == 9:
count += 1
print(count) |
s157683713 | p02412 | u451187291 | 1451667518 | Python | Python3 | py | Runtime Error | 0 | 0 | 160 | n, x = [int(i) for i in input().split]
if n!=0 and x!=0:
s = [(i,j,k) for i in range(n) for j in range(n) for k in range(n) if i!=j and j!=k]
print (len(s)) |
s682924715 | p02412 | u100813820 | 1463621416 | Python | Python3 | py | Runtime Error | 0 | 0 | 1388 | # 12-Structured_Program_II-How_many_ways.py
# ????????????????????°
# 1 ?????? n ?????§?????°?????????????????????????????§???????????°?????????????????????????¨???? x ??¨??????
# ????????????????????°????±???????????????°?????????????????????????????????
# ????????°???1 ?????? 5 ?????§?????°???????????????????????§??... |
s304616622 | p02412 | u100813820 | 1463621476 | Python | Python3 | py | Runtime Error | 0 | 0 | 1375 | # 12-Structured_Program_II-How_many_ways.py
# ????????????????????°
# 1 ?????? n ?????§?????°?????????????????????????????§???????????°?????????????????????????¨???? x ??¨??????
# ????????????????????°????±???????????????°?????????????????????????????????
# ????????°???1 ?????? 5 ?????§?????°???????????????????????§??... |
s252837315 | p02412 | u100813820 | 1463621792 | Python | Python3 | py | Runtime Error | 0 | 0 | 1375 | # 12-Structured_Program_II-How_many_ways.py
# ????????????????????°
# 1 ?????? n ?????§?????°?????????????????????????????§???????????°?????????????????????????¨???? x ??¨??????
# ????????????????????°????±???????????????°?????????????????????????????????
# ????????°???1 ?????? 5 ?????§?????°???????????????????????§??... |
s867022302 | p02412 | u100813820 | 1463622343 | Python | Python3 | py | Runtime Error | 0 | 0 | 1551 | # 12-Structured_Program_II-How_many_ways.py
# ????????????????????°
# 1 ?????? n ?????§?????°?????????????????????????????§???????????°?????????????????????????¨???? x ??¨??????
# ????????????????????°????±???????????????°?????????????????????????????????
# ????????°???1 ?????? 5 ?????§?????°???????????????????????§??... |
s079254639 | p02412 | u100813820 | 1463622488 | Python | Python3 | py | Runtime Error | 0 | 0 | 1375 | # 12-Structured_Program_II-How_many_ways.py
# ????????????????????°
# 1 ?????? n ?????§?????°?????????????????????????????§???????????°?????????????????????????¨???? x ??¨??????
# ????????????????????°????±???????????????°?????????????????????????????????
# ????????°???1 ?????? 5 ?????§?????°???????????????????????§??... |
s466027809 | p02412 | u100813820 | 1463625002 | Python | Python3 | py | Runtime Error | 0 | 0 | 1492 | # 13-Structured_Program_II-Spreadsheet.py
# ??¨?¨????
# ??¨?¨??????????????°???????????????°???????????????????????????
# ??¨????????°r??¨?????°c???r ?? c ???????´????????????¨?????????????????§???
# ????????¨??????????¨?????????\????????°????????¨???????????????????????°?????????????????????????????????
# Input
# ??... |
s632792979 | p02412 | u100813820 | 1463626350 | Python | Python3 | py | Runtime Error | 0 | 0 | 2004 | # 13-Structured_Program_II-Spreadsheet.py
# ??¨?¨????
# ??¨?¨??????????????°???????????????°???????????????????????????
# ??¨????????°r??¨?????°c???r ?? c ???????´????????????¨?????????????????§???
# ????????¨??????????¨?????????\????????°????????¨???????????????????????°?????????????????????????????????
# Input
# ??... |
s475805388 | p02412 | u100813820 | 1463626378 | Python | Python3 | py | Runtime Error | 0 | 0 | 2018 | # 13-Structured_Program_II-Spreadsheet.py
# ??¨?¨????
# ??¨?¨??????????????°???????????????°???????????????????????????
# ??¨????????°r??¨?????°c???r ?? c ???????´????????????¨?????????????????§???
# ????????¨??????????¨?????????\????????°????????¨???????????????????????°?????????????????????????????????
# Input
# ??... |
s593672439 | p02412 | u100813820 | 1463626404 | Python | Python3 | py | Runtime Error | 0 | 0 | 2018 | # 13-Structured_Program_II-Spreadsheet.py
# ??¨?¨????
# ??¨?¨??????????????°???????????????°???????????????????????????
# ??¨????????°r??¨?????°c???r ?? c ???????´????????????¨?????????????????§???
# ????????¨??????????¨?????????\????????°????????¨???????????????????????°?????????????????????????????????
# Input
# ??... |
s829451482 | p02412 | u226888928 | 1463703541 | Python | Python3 | py | Runtime Error | 0 | 0 | 181 | while 1:
n,x=map(int,input().split())
if n == 0 and x == 0: break
print(len([1 for a in range(1,n+1), for b in range(a+1,n+1), for c in range(b+1,n+1), a + b + c == x])) |
s495253981 | p02412 | u617990214 | 1465912898 | Python | Python | py | Runtime Error | 0 | 0 | 236 | while True:
k=map(int,raw_input().split(" "))
ct=0
a=0
b=0
c=0
max=k[0]
sum=k[1]
a=max+1
while True:
a-=1
b=a-1
c=sum-a-b
if not a>b>c:
print ct
break
while a>b>c:
if a>b>c>0:
ct+=1
b-=1
c+=1
|
s359519633 | p02412 | u340901659 | 1468215490 | Python | Python3 | py | Runtime Error | 0 | 0 | 299 | def solve(n,x):
count = 0
for i in range(1,n+1):
for j in range(i+1,n+1):
k = x - i -j
if j < b and b <= n:
count += 1
return count//6
while True:
n,x = map(int,input().split())
if n == x == 0:
break;
print(solve(n,x)) |
s167522748 | p02412 | u600195957 | 1470117824 | Python | Python3 | py | Runtime Error | 0 | 0 | 196 | n, x = [int(i) i in input().split()]
3 <= n <= 100
if n == x == 0:
break
for a in range(n):
for b in range(a):
for c in range(b):
a + b + c == x
return |
s113751426 | p02412 | u204883389 | 1470117902 | Python | Python3 | py | Runtime Error | 0 | 0 | 177 | while True:
(n, x) = [int(i) for i in input().split()]
if n == x == 0:
break
print([1 if sum(i) == x else 0 for i in input.combinations(range(1, n + 1), 3)]) |
s114090768 | p02412 | u600195957 | 1470117917 | Python | Python3 | py | Runtime Error | 0 | 0 | 204 | n, x = [int(i) i in input().split()]
3 <= n <= 100
if n == x == 0:
break
for a in range(n):
for b in range(a):
for c in range(b):
a + b + c == x
return
print() |
s768853214 | p02412 | u600195957 | 1470117962 | Python | Python3 | py | Runtime Error | 0 | 0 | 206 | n, x = [int(i) i in input().split()]
3 <= n <= 100
if n == x == 0:
break
for a in range(n+1):
for b in range(a):
for c in range(b):
a + b + c == x
return
print() |
s019046432 | p02412 | u204883389 | 1470117999 | Python | Python3 | py | Runtime Error | 0 | 0 | 177 | while True:
(n, x) = [int(i) for i in input().split()]
if n == x == 0:
break
print([1 if sum(i) == x else 0 for i in input.combinations(range(1, n + 1), 3)]) |
s530036366 | p02412 | u600195957 | 1470118081 | Python | Python3 | py | Runtime Error | 0 | 0 | 210 | n, x = [int(i) i in input().split()]
3 <= n <= 100
if n == x == 0:
break
for a in range(n+1):
for b in range(a+1):
for c in range(b+1):
a + b + c == x
return
print() |
s509385524 | p02412 | u204883389 | 1470118167 | Python | Python3 | py | Runtime Error | 0 | 0 | 180 | while True:
(n, x) = [int(i) for i in input().split()]
if n == x == 0:
break
print([1 if sum(n, x) == x else 0 for i in input.combinations(range(1, n + 1), 3)]) |
s553659594 | p02412 | u204883389 | 1470118326 | Python | Python3 | py | Runtime Error | 0 | 0 | 202 | while True:
(n, x) = [int(i) for i in input().split()]
if n == x == 0:
break
else:3 <= n < 100
print([1 if sum(n, x) == x else 0 for i in input.combinations(range(1, n + 1), 3)]) |
s118615037 | p02412 | u600195957 | 1470118331 | Python | Python3 | py | Runtime Error | 0 | 0 | 330 | n, x = [int(i) i in input().split()]
3 <= n <= 100
if n == x == 0:
break
for a in range(n+1):
for b in range(a+1):
for c in range(b+1):
if a == b == c or a == b or a == c or b == c:
None
elif a + b + c == x:
return
else:
No... |
s506575740 | p02412 | u600195957 | 1470118365 | Python | Python3 | py | Runtime Error | 0 | 0 | 328 | n, x = [int(i) i in input().split()]
3 <= n <= 100
if n == x == 0:
break
for a in range(n+1):
for b in range(a+1):
for c in range(b+1):
if a == b == c or a == b or a == c or b == c:
None
if a + b + c == x:
return
else:
None... |
s120992240 | p02412 | u600195957 | 1470118389 | Python | Python3 | py | Runtime Error | 0 | 0 | 332 | n, x = [int(i) for i in input().split()]
3 <= n <= 100
if n == x == 0:
break
for a in range(n+1):
for b in range(a+1):
for c in range(b+1):
if a == b == c or a == b or a == c or b == c:
None
if a + b + c == x:
return
else:
... |
s209300951 | p02412 | u204883389 | 1470118429 | Python | Python3 | py | Runtime Error | 0 | 0 | 196 | while True:
(n, x) = [int(i) for i in input().split()]
n = 3 < 100
if n == x == 0:
break
print([1 if sum(n, x) == x else 0 for i in input.combinations(range(1, n + 1), 3)]) |
s506846594 | p02412 | u600195957 | 1470118816 | Python | Python3 | py | Runtime Error | 0 | 0 | 341 | n, x = [int(i) for i in input().split()]
3 <= n <= 100
if n == x == 0:
break
for a in range(1, n+1):
for b in range(1, a+1):
for c in range(1, b+1):
if a == b == c or a == b or a == c or b == c:
None
if a + b + c == x:
return
else:
... |
s572903527 | p02412 | u600195957 | 1470118898 | Python | Python3 | py | Runtime Error | 0 | 0 | 341 | n, x = [int(i) for i in input().split()]
3 <= n <= 100
if n == x == 0:
break
for a in range(1, n+1):
for b in range(1, a+1):
for c in range(1, b+1):
if a == b == c or a == b or a == c or b == c:
None
if a + b + c == x:
return
else:
... |
s423669382 | p02412 | u600195957 | 1470119012 | Python | Python3 | py | Runtime Error | 0 | 0 | 341 | n, x = [int(i) for i in input().split()]
3 <= n <= 100
if n == x == 0:
break
for a in range(1, n+1):
for b in range(1, a+1):
for c in range(1, b+1):
if a == b == c or a == b or a == c or b == c:
None
if a + b + c == x:
return
else:
... |
s844320556 | p02412 | u204883389 | 1470119214 | Python | Python3 | py | Runtime Error | 0 | 0 | 205 | while True:
import itertools
(n, x) = [int(i) for i in input().split()]
if n == x == 0:
break
print([1 if sum(n, x) == x else 0 for i in itertools.combinations(range(1, n + 1), 3)]) |
s662725835 | p02412 | u671553883 | 1470119327 | Python | Python3 | py | Runtime Error | 0 | 0 | 320 | while True:
n = [int(i) for i in input().split()]
if n == x == 0:
break
3 <= n <= 100
total = n < n
total2 = total < n
total3 = total2 < n
for i in range(total):
for a in range(total2):
for c in range(total3):
if i + a + c:
return 'x'
else:
print('None')
print() |
s040718671 | p02412 | u600195957 | 1470119343 | Python | Python3 | py | Runtime Error | 0 | 0 | 339 | n, x = [int(i) for i in input().split()]
3 <= n <= 100
if n == x == 0:
break
for a in range(1, n+1):
for b in range(1, a):
for c in range(1, b-1):
if a == b == c or a == b or a == c or b == c:
None
if a + b + c == x:
return
else:
... |
s690370260 | p02412 | u204883389 | 1470119400 | Python | Python3 | py | Runtime Error | 0 | 0 | 197 | import itertools
while True:
(n, x) = [int(i) for i in input().split()]
if n == x == 0:
break
print([1 if sum() == x else 0 for i in itertools.combinations(range(1, n + 1), 3)]) |
s193591921 | p02412 | u671553883 | 1470119402 | Python | Python3 | py | Runtime Error | 0 | 0 | 330 | while True:
n = [int(i) for i in input().split()]
if n == x == 0:
break
3 <= n <= 100
total = n < n
total2 = 'total' < n
total3 = 'total2' < n
for i in range('total'):
for a in range('total2'):
for c in range('total3'):
if i + a + c:
return 'x'
else:
print('None'... |
s160572522 | p02412 | u600195957 | 1470119402 | Python | Python3 | py | Runtime Error | 0 | 0 | 345 | n, x = [int(i) for i in input().split()]
3 <= n <= 100
if n == x == 0:
break
for a in range(1, n+1):
for b in range(1, a):
for c in range(1, b-1):
if a == b == c or a == b or a == c or b == c:
None
if a + b + c == x:
return
else:
... |
s322484396 | p02412 | u644636020 | 1470120233 | Python | Python3 | py | Runtime Error | 0 | 0 | 279 | n, x = [int(i) for i in input().split()]
if n == x == 0:
break
count = 0
for s in range(1, n // 2 + 1):
for e in range(n, n // 2 +1, - 1):
m = x - s - e
if m != s and m != e and m <= n and m > s:
count += 1
print(count) |
s139627561 | p02412 | u644636020 | 1470120351 | Python | Python3 | py | Runtime Error | 0 | 0 | 289 | n, x = [int(i) for i in input().split()]
if n == x == 0:
break
count = 0
for s in range(1, n // 2 + 1):
for e in range(n, n // 2 +1, - 1):
m = x - s - e
if m != s and m != e and m <= n and m > s and m < e:
count += 1
print(count) |
s263953336 | p02412 | u628732336 | 1470120843 | Python | Python3 | py | Runtime Error | 0 | 0 | 333 | while True:
n, x = [int(i) for i in input().split()]
if n == x == 0:
break
count = 0:
for s in range(1, n // 2 + 1):
for e in range(n, n // 2, -1):
m = x - s - e
if m != s and m != e and m > s and m < e and m <= n:
count += 1
... |
s969203987 | p02412 | u131984977 | 1470121003 | Python | Python3 | py | Runtime Error | 0 | 0 | 299 | while True:
n, x = [int(i) for i in input().split()]
if n == x == 0:
break
count = 0
for s in range(1, n - 1):
for m in range(s + 1, n):
for e in range(m + 1, n + 1):
if x == sum(s, m, e):
count += 1
print(count) |
s769031491 | p02412 | u131984977 | 1470121022 | Python | Python3 | py | Runtime Error | 0 | 0 | 299 | while True:
n, x = [int(i) for i in input().split()]
if n == x == 0:
break
count = 0
for s in range(1, n - 1):
for m in range(s + 1, n):
for e in range(m + 1, n + 1):
if x == sum(s, m, e):
count += 1
print(count) |
s913186637 | p02412 | u671553883 | 1470121026 | Python | Python3 | py | Runtime Error | 0 | 0 | 292 | while True:
n, x = [int(i) for i in input().split()]
if n == x == 0:
break
count = 0
for s in range(1, n + 1):
for m in range(s+1, n):
for e in range(m+1, n+1):
if x == sum(s, m, e):
count += 1
print(count) |
s282713201 | p02412 | u628732336 | 1470121032 | Python | Python3 | py | Runtime Error | 0 | 0 | 299 | while True:
n, x = [int(i) for i in input().split()]
if n == x == 0:
break
count = 0
for s in range(1, n - 1):
for m in range(s + 1, n):
for e in range(m + 1, n + 1):
if x == sum(s, m, e):
count += 1
print(count) |
s925337563 | p02412 | u085472528 | 1470121052 | Python | Python3 | py | Runtime Error | 0 | 0 | 299 | while True:
n, x = [int(i) for i in input().split()]
if n == x == 0:
break
count = 0
for s in range(1, n - 1):
for m in range(s + 1, n):
for e in range(m + 1, n + 1):
if x == sum(s, m, e):
count += 1
print(count) |
s830672777 | p02412 | u600195957 | 1470121139 | Python | Python3 | py | Runtime Error | 0 | 0 | 294 | while True:
n, x = [int(i) for i in input().split()]
if n == x == 0:
break
count = 0
for s in range(1, n???- 1):
for m in range(s+1, n):
for e in range(m + 1, n + 1):
if x == sum([s, m, e]):
count += 1
print(count) |
s374395323 | p02412 | u600195957 | 1470121194 | Python | Python3 | py | Runtime Error | 0 | 0 | 296 | while True:
n, x = [int(i) for i in input().split()]
if n == x == 0:
break
count = 0
for s in range(1, n???+ 1):
for m in range(s + 1, n):
for e in range(m + 1, n + 1):
if x == sum([s, m, e]):
count += 1
print(count) |
s102372302 | p02412 | u600195957 | 1470121314 | Python | Python3 | py | Runtime Error | 0 | 0 | 303 | while True:
n, x = [int(i) for i in input().split()]
if n == x == 0:
break
count = 0
for s in range(1, n???+ 1):
for m in range(s + 1, n):
for e in range(m + 1, n + 1):
if x == sum([s, m, e]):
count += 1
print(count) |
s505437119 | p02412 | u204883389 | 1470203624 | Python | Python3 | py | Runtime Error | 0 | 0 | 355 | n, m, l = [int(i) for i in input().split()]
A = [input(range(n))]
B = [input(range(m))]
C = [[0] * 1 for n in range(n)]
for ni in range(n):
A.append([int(i) for i in input().split()])
C[n][m] = sum([A[n][l] * B[l][m] for m in range(l)])
for mi in range(m):
B.append([int(i) for i in input().split()])
p... |
s263333822 | p02412 | u197204103 | 1472723471 | Python | Python3 | py | Runtime Error | 0 | 0 | 370 | while True:
a = input().split(' ')
b = 0
s = []
c = [number+1 for number in range(int(a[0]))]
for i in c:
for e in c:
for f in c:
if i + e + f == int(a[1]) and not (i*e*f in s):
if not (i==e or e==f or f==i):
print(i,e,f... |
s520845769 | p02412 | u197204103 | 1472723628 | Python | Python3 | py | Runtime Error | 0 | 0 | 368 | while True:
a = input().split(' ')
b = 0
s = []
c = [number+1 for number in range(int(a[0]))]
for i in c:
for e in c:
for f in c:
if i + e + f == int(a[1]) and not (i*e*f in s):
if not (i==e or e==f or f==i):
s.append(i*... |
s888552908 | p02412 | u998435601 | 1473074591 | Python | Python | py | Runtime Error | 0 | 0 | 217 | # -*- coding: utf-8 -*-
import itertools:
while True:
n, x = map(int, input().split())
if n==0 and x==0: break
count = 0
for a, b, c in itertools.permutations(range(n), 3):
if a+b+c==x: count += 1
print count |
s933818538 | p02412 | u801346721 | 1476835837 | Python | Python3 | py | Runtime Error | 0 | 0 | 233 | while 1:
n, x = map(int, input().split())
if n == 0 and x == 0:
break
counter = 0
for a in range(3, n+1):
for b in range(2, n-1):
for c in range(1, n-2):
if a > b > c and a+b+c == x
counter += 1
print(counter)
|
s547974400 | p02412 | u801346721 | 1476835946 | Python | Python3 | py | Runtime Error | 0 | 0 | 267 | while 1:
n, x = map(int, input().split())
if n == 0 and x == 0:
break
counter = 0
for a in range(3, n+1):
for b in range(2, n-1):
if b > a:
break
for c in range(1, n-2):
if c > b:
break
if a+b+c == x
counter += 1
print(counter)
|
s330889668 | p02412 | u801346721 | 1476839216 | Python | Python3 | py | Runtime Error | 0 | 0 | 246 | while 1:
n, x = map(int, input().split())
counter = 0
if n == 0 and x == 0:
break
# y + (y-1) + (y-2) = x
y = (x+3) // 3
for a in range(y, n+1):
for b in range(2, a):
if (x-a-b) > 0 and (x-a-b) < b:
counter += 1
print(counter)
|
s039331940 | p02412 | u831244171 | 1477550328 | Python | Python | py | Runtime Error | 0 | 0 | 267 | r,c = map(int,raw_input().split())
matrix = [0 for i in range(r)]
for i in range(r):
matrix[i] = map(int,raw_input().split())
a = 0
for j in range(c):
a += matrix[i][j]
matrix[i].append(a)
for j in range(c+ 1):
print matrix[i][j], |
s473771311 | p02412 | u494314211 | 1481441500 | Python | Python3 | py | Runtime Error | 0 | 0 | 254 | r,c=list(map(int,input().split()))
l=[]
for i in range(r):
a=list(map(int,input().split()))
a.append(sum(a))
l.append(a)
b=[]
for i in range(c+1):
c=0
for j in range(r):
c+=l[j][i]
b.append(c)
l.append(b)
for i in l:
print(" ".join(map(str,i))) |
s076353179 | p02412 | u494314211 | 1481441528 | Python | Python3 | py | Runtime Error | 0 | 0 | 260 | r,c=list(map(int,input().split()))
l=[]
for i in range(r):
a=list(map(int,input().split()))
a.append(sum(a))
l.append(a)
b=[]
for i in range(c+1):
c=0
for j in range(r):
c+=l[j][i]
b.append(c)
l.append(b)
for i in l:
print(" ".join(list(map(str,i)))) |
s903522895 | p02412 | u918276501 | 1484224718 | Python | Python3 | py | Runtime Error | 0 | 0 | 209 | s = []
while True:
n, x = map(int, input().strip().split())
if n == x == 0:
break
c = 0
for i in range(1,x/3):
c += max(0, (i+1-x)//2+n)
s.append(str(c))
print('\n'.join(s)) |
s537620210 | p02412 | u148628801 | 1486099567 | Python | Python3 | py | Runtime Error | 0 | 0 | 410 | import sys
#fin = open("test.txt", "r")
fin = sys.stdin
while True:
[m, f, r] = list(map(int, fin.readline().split()))
if m == -1 and f == -1 and r == -1:
break
sum_mf = m + f
if m == -1 or f == -1:
print("F")
elif sum_mf >= 80:
print("A")
elif sum_mf >= 65:
print("B")
elif sum_mf >= 50:
print("C")... |
s907189140 | p02412 | u144068724 | 1486234313 | Python | Python3 | py | Runtime Error | 0 | 0 | 279 | while 1:
n,x = map(int,input().split())
count == 0
if n == 0 and x == 0:
break
for i in range(1,n+1):
for j in range(i+1,n+1):
for k in range(j+1,n+1):
if i + j + k == x:
count += 1
print(count) |
s595795761 | p02412 | u130834228 | 1489044814 | Python | Python3 | py | Runtime Error | 0 | 0 | 258 | while(1):
n, x = map(int, input().split())
t = 0
if n == x == 0:
break
for i in range(1, n+1):
for j in range(i+1, n+1):
for k in range(k+1, n+1):
if i+j+k == x:
if i != j and j != k and k != i:
t += 1
print(i, j, k)
print(t) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.