submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s231642009
p00007
Accepted
n = input() money = 100000 i = 0 while i<n: money = money * 105 / 100 if money % 1000 != 0: money = (money / 1000 + 1) * 1000 i += 1 print money
5
130000
<H1>Debt Hell</H1> <p> Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week. </p> <p> Write a program which computes the amount of the debt in <var>n</var> weeks. </p> <H2>Input</H2> <p> An integer <var>n</var> (0 &le; <var>n</var> &le; 100) is given in a line. </p> <H2>Output</H2> <p> Print the amout of the debt in a line. </p> <H2>Sample Input</H2> <pre> 5 </pre> <H2>Output for the Sample Input</H2> <pre> 130000 </pre>
s429887150
p00007
Runtime Error
import math price = 100000.0 n = int(raw_input()) for i in range(n): price = ceil((price * 1.05) / 1000) * 1000
5
130000
<H1>Debt Hell</H1> <p> Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week. </p> <p> Write a program which computes the amount of the debt in <var>n</var> weeks. </p> <H2>Input</H2> <p> An integer <var>n</var> (0 &le; <var>n</var> &le; 100) is given in a line. </p> <H2>Output</H2> <p> Print the amout of the debt in a line. </p> <H2>Sample Input</H2> <pre> 5 </pre> <H2>Output for the Sample Input</H2> <pre> 130000 </pre>
s561527283
p00007
Runtime Error
import math for i in range(int(input(n))): n = math.ceil((n*1.05)/1000)*1000
5
130000
<H1>Debt Hell</H1> <p> Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week. </p> <p> Write a program which computes the amount of the debt in <var>n</var> weeks. </p> <H2>Input</H2> <p> An integer <var>n</var> (0 &le; <var>n</var> &le; 100) is given in a line. </p> <H2>Output</H2> <p> Print the amout of the debt in a line. </p> <H2>Sample Input</H2> <pre> 5 </pre> <H2>Output for the Sample Input</H2> <pre> 130000 </pre>
s666300073
p00007
Runtime Error
import math s=int(imput()) m=100000 for i in range(1:s): m=m.ceil((m*1.05)/1000)*1000 print(m)
5
130000
<H1>Debt Hell</H1> <p> Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week. </p> <p> Write a program which computes the amount of the debt in <var>n</var> weeks. </p> <H2>Input</H2> <p> An integer <var>n</var> (0 &le; <var>n</var> &le; 100) is given in a line. </p> <H2>Output</H2> <p> Print the amout of the debt in a line. </p> <H2>Sample Input</H2> <pre> 5 </pre> <H2>Output for the Sample Input</H2> <pre> 130000 </pre>
s532723299
p00007
Runtime Error
n=input() loan=10**5 for i in xrange(n): loan+=loan*0.05 if loan%1000!=0: loan-=loan%1000 loan+=10**3 else: loan-=loan%1000 print(int(loan)
5
130000
<H1>Debt Hell</H1> <p> Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week. </p> <p> Write a program which computes the amount of the debt in <var>n</var> weeks. </p> <H2>Input</H2> <p> An integer <var>n</var> (0 &le; <var>n</var> &le; 100) is given in a line. </p> <H2>Output</H2> <p> Print the amout of the debt in a line. </p> <H2>Sample Input</H2> <pre> 5 </pre> <H2>Output for the Sample Input</H2> <pre> 130000 </pre>
s090982013
p00007
Runtime Error
debt=10**5 interest=5/100 n=int(input()) for week in range(n): debt=debt(1+interest)- if debt%1000>0: debt=debt+1000-(debt%1000) print(debt)
5
130000
<H1>Debt Hell</H1> <p> Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week. </p> <p> Write a program which computes the amount of the debt in <var>n</var> weeks. </p> <H2>Input</H2> <p> An integer <var>n</var> (0 &le; <var>n</var> &le; 100) is given in a line. </p> <H2>Output</H2> <p> Print the amout of the debt in a line. </p> <H2>Sample Input</H2> <pre> 5 </pre> <H2>Output for the Sample Input</H2> <pre> 130000 </pre>
s625889382
p00007
Runtime Error
debt=10**5 interest=5/100 n=int(input()) for week in range(n): debt=debt(1+interest) if debt%1000>0: debt=debt+1000-(debt%1000) print(debt)
5
130000
<H1>Debt Hell</H1> <p> Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week. </p> <p> Write a program which computes the amount of the debt in <var>n</var> weeks. </p> <H2>Input</H2> <p> An integer <var>n</var> (0 &le; <var>n</var> &le; 100) is given in a line. </p> <H2>Output</H2> <p> Print the amout of the debt in a line. </p> <H2>Sample Input</H2> <pre> 5 </pre> <H2>Output for the Sample Input</H2> <pre> 130000 </pre>
s102114356
p00007
Runtime Error
x = input() n = 100000 while x > 0: n *= 1.05 mod = n % 1000 if mod != 0: n = n + 1000 - mod x -= 1 print(int(n))
5
130000
<H1>Debt Hell</H1> <p> Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week. </p> <p> Write a program which computes the amount of the debt in <var>n</var> weeks. </p> <H2>Input</H2> <p> An integer <var>n</var> (0 &le; <var>n</var> &le; 100) is given in a line. </p> <H2>Output</H2> <p> Print the amout of the debt in a line. </p> <H2>Sample Input</H2> <pre> 5 </pre> <H2>Output for the Sample Input</H2> <pre> 130000 </pre>
s538690624
p00007
Runtime Error
x = raw_input() n = 100000 while x > 0: n *= 1.05 mod = n % 1000 if mod != 0: n = n + 1000 - mod x -= 1 print(int(n))
5
130000
<H1>Debt Hell</H1> <p> Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week. </p> <p> Write a program which computes the amount of the debt in <var>n</var> weeks. </p> <H2>Input</H2> <p> An integer <var>n</var> (0 &le; <var>n</var> &le; 100) is given in a line. </p> <H2>Output</H2> <p> Print the amout of the debt in a line. </p> <H2>Sample Input</H2> <pre> 5 </pre> <H2>Output for the Sample Input</H2> <pre> 130000 </pre>
s235141673
p00007
Runtime Error
from math import ceil n=int(input()) print((int(ceil(10*(1.05)**n))*10000)
5
130000
<H1>Debt Hell</H1> <p> Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week. </p> <p> Write a program which computes the amount of the debt in <var>n</var> weeks. </p> <H2>Input</H2> <p> An integer <var>n</var> (0 &le; <var>n</var> &le; 100) is given in a line. </p> <H2>Output</H2> <p> Print the amout of the debt in a line. </p> <H2>Sample Input</H2> <pre> 5 </pre> <H2>Output for the Sample Input</H2> <pre> 130000 </pre>
s901044840
p00007
Runtime Error
n = int(input()) DEBT = 100000 for interest in range(n): DEBT = DEBT * 1.05 ROUND = DEBT % 1000 if ROUND != 0: DEBT = (DEBT // 1000 + 1) * 1000 print(int(DEBT)
5
130000
<H1>Debt Hell</H1> <p> Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week. </p> <p> Write a program which computes the amount of the debt in <var>n</var> weeks. </p> <H2>Input</H2> <p> An integer <var>n</var> (0 &le; <var>n</var> &le; 100) is given in a line. </p> <H2>Output</H2> <p> Print the amout of the debt in a line. </p> <H2>Sample Input</H2> <pre> 5 </pre> <H2>Output for the Sample Input</H2> <pre> 130000 </pre>
s557645404
p00007
Runtime Error
n = int(input()) debt = 100000 for i in range(n): debt = debt * 1.05 round = debt % 1000 if round != 0: debt = (debt // 1000 + 1) * 1000 print(int(debt)
5
130000
<H1>Debt Hell</H1> <p> Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week. </p> <p> Write a program which computes the amount of the debt in <var>n</var> weeks. </p> <H2>Input</H2> <p> An integer <var>n</var> (0 &le; <var>n</var> &le; 100) is given in a line. </p> <H2>Output</H2> <p> Print the amout of the debt in a line. </p> <H2>Sample Input</H2> <pre> 5 </pre> <H2>Output for the Sample Input</H2> <pre> 130000 </pre>
s323750497
p00007
Runtime Error
n = int(input()) result = 100000 for i in range(0,n): result = result * 1.05 if result % 1000 == 0: pass else: result = result-(result % 1000)+ 1000 result = result(int) print(result)
5
130000
<H1>Debt Hell</H1> <p> Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week. </p> <p> Write a program which computes the amount of the debt in <var>n</var> weeks. </p> <H2>Input</H2> <p> An integer <var>n</var> (0 &le; <var>n</var> &le; 100) is given in a line. </p> <H2>Output</H2> <p> Print the amout of the debt in a line. </p> <H2>Sample Input</H2> <pre> 5 </pre> <H2>Output for the Sample Input</H2> <pre> 130000 </pre>
s959959395
p00007
Runtime Error
import math debt = 100000 for x in range (0, int(input())): debt = math.ceil(debt * 1.05, -3) print(int(debt))
5
130000
<H1>Debt Hell</H1> <p> Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week. </p> <p> Write a program which computes the amount of the debt in <var>n</var> weeks. </p> <H2>Input</H2> <p> An integer <var>n</var> (0 &le; <var>n</var> &le; 100) is given in a line. </p> <H2>Output</H2> <p> Print the amout of the debt in a line. </p> <H2>Sample Input</H2> <pre> 5 </pre> <H2>Output for the Sample Input</H2> <pre> 130000 </pre>
s506402109
p00007
Runtime Error
ef Round(ip, dg): # ip???dg?????§?????¨?????\????????¢??° ip = ip / 10**dg if(ip-int(ip) != 0): return (int(ip) + 1)*10**dg else: return int(ip)*10**dg n=int(input()) sum=100000 for i in range(0, n): sum=Round(sum*1.05) print(sum)
5
130000
<H1>Debt Hell</H1> <p> Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week. </p> <p> Write a program which computes the amount of the debt in <var>n</var> weeks. </p> <H2>Input</H2> <p> An integer <var>n</var> (0 &le; <var>n</var> &le; 100) is given in a line. </p> <H2>Output</H2> <p> Print the amout of the debt in a line. </p> <H2>Sample Input</H2> <pre> 5 </pre> <H2>Output for the Sample Input</H2> <pre> 130000 </pre>
s092972717
p00007
Runtime Error
import math def int_ceil(src, range): return int(math.ceil(src/float(range)) * range) def main(): week = int(input()) debt = 100000 for _ in range(week): risi = debt * 0.05 debt = int_ceil(debt + risi, 1000) print(debt) if __name__ == "__main__": main()
5
130000
<H1>Debt Hell</H1> <p> Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week. </p> <p> Write a program which computes the amount of the debt in <var>n</var> weeks. </p> <H2>Input</H2> <p> An integer <var>n</var> (0 &le; <var>n</var> &le; 100) is given in a line. </p> <H2>Output</H2> <p> Print the amout of the debt in a line. </p> <H2>Sample Input</H2> <pre> 5 </pre> <H2>Output for the Sample Input</H2> <pre> 130000 </pre>
s183798433
p00007
Runtime Error
import math r = 100 n = input() for i in range(n): r = math.ceil(r * 1.05) print(r * 1000)
5
130000
<H1>Debt Hell</H1> <p> Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week. </p> <p> Write a program which computes the amount of the debt in <var>n</var> weeks. </p> <H2>Input</H2> <p> An integer <var>n</var> (0 &le; <var>n</var> &le; 100) is given in a line. </p> <H2>Output</H2> <p> Print the amout of the debt in a line. </p> <H2>Sample Input</H2> <pre> 5 </pre> <H2>Output for the Sample Input</H2> <pre> 130000 </pre>
s722482387
p00007
Runtime Error
n = input() a = 100000 while x <= n: a * 1.05 a/1000*1000 print a
5
130000
<H1>Debt Hell</H1> <p> Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week. </p> <p> Write a program which computes the amount of the debt in <var>n</var> weeks. </p> <H2>Input</H2> <p> An integer <var>n</var> (0 &le; <var>n</var> &le; 100) is given in a line. </p> <H2>Output</H2> <p> Print the amout of the debt in a line. </p> <H2>Sample Input</H2> <pre> 5 </pre> <H2>Output for the Sample Input</H2> <pre> 130000 </pre>
s554084584
p00007
Runtime Error
n = input() a = 100000 while x in xrange(1,n+1): a * 1.05 a/1000*1000 print a
5
130000
<H1>Debt Hell</H1> <p> Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week. </p> <p> Write a program which computes the amount of the debt in <var>n</var> weeks. </p> <H2>Input</H2> <p> An integer <var>n</var> (0 &le; <var>n</var> &le; 100) is given in a line. </p> <H2>Output</H2> <p> Print the amout of the debt in a line. </p> <H2>Sample Input</H2> <pre> 5 </pre> <H2>Output for the Sample Input</H2> <pre> 130000 </pre>
s609483291
p00007
Runtime Error
import math debt = 100000 n = int(raw_inpu()) for i in range(n): debt = math.ceil(debt*1.05,3) print debt
5
130000
<H1>Debt Hell</H1> <p> Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week. </p> <p> Write a program which computes the amount of the debt in <var>n</var> weeks. </p> <H2>Input</H2> <p> An integer <var>n</var> (0 &le; <var>n</var> &le; 100) is given in a line. </p> <H2>Output</H2> <p> Print the amout of the debt in a line. </p> <H2>Sample Input</H2> <pre> 5 </pre> <H2>Output for the Sample Input</H2> <pre> 130000 </pre>
s161170066
p00007
Runtime Error
import math debt = 100000 for i in range(n): debt = math.ceil(debt*1.05/1000)*1000 print int(debt)
5
130000
<H1>Debt Hell</H1> <p> Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week. </p> <p> Write a program which computes the amount of the debt in <var>n</var> weeks. </p> <H2>Input</H2> <p> An integer <var>n</var> (0 &le; <var>n</var> &le; 100) is given in a line. </p> <H2>Output</H2> <p> Print the amout of the debt in a line. </p> <H2>Sample Input</H2> <pre> 5 </pre> <H2>Output for the Sample Input</H2> <pre> 130000 </pre>
s426076137
p00007
Runtime Error
n = input() ans = 100000 for i in range(n): ans *= 1.05 if(ans % 1000) != 0:
5
130000
<H1>Debt Hell</H1> <p> Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week. </p> <p> Write a program which computes the amount of the debt in <var>n</var> weeks. </p> <H2>Input</H2> <p> An integer <var>n</var> (0 &le; <var>n</var> &le; 100) is given in a line. </p> <H2>Output</H2> <p> Print the amout of the debt in a line. </p> <H2>Sample Input</H2> <pre> 5 </pre> <H2>Output for the Sample Input</H2> <pre> 130000 </pre>
s486835537
p00008
Wrong Answer
x=[0]*37 for a in range(10): for b in range(10): for c in range(10): for d in range(10): x[a+b+c+d]+=1 while True: try: print(x[int(input())]) except: break
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s046833071
p00008
Wrong Answer
cnt=0 n=int(input()) s=range(10) for i in s: for j in s: for k in s: for l in s: if i+j+k+l==n: cnt+=1 print(cnt)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s280521487
p00008
Wrong Answer
n = int(raw_input()) ans = 0 for a in range(min(n+1,10)): for b in range(min(n+1,10)): for c in range(min(n+1,10)): for d in range(min(n+1,10)): if a + b + c + d ==n: ans += 1 print ans
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s902304524
p00008
Wrong Answer
n = int(raw_input()) ans = 0 for a in range(min(n+1,10)): for b in range(min(n+1,10)): for c in range(min(n+1,10)): for d in range(min(n+1,10)): if a + b + c + d ==n: ans += 1 print a,b,c,d print ans
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s843095661
p00008
Wrong Answer
n = int(raw_input()) ans = 0 for a in range(min(n+1,10)): for b in range(min(n+1,10)): for c in range(min(n+1,10)): for d in range(min(n+1,10)): if a + b + c + d ==n: ans += 1 print int(ans)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s163569893
p00008
Wrong Answer
n = int(raw_input()) ans = 0 for a in range(1,10): for b in range(1,10): for c in range(1,10): for d in range(1,10): if a + b + c + d ==n: ans += 1 print ans
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s881220423
p00008
Wrong Answer
n = int(raw_input()) x = [0]*51 for a in xrange(0,10): for b in xrange(0,10): for c in xrange(0,10): for d in xrange(0,10): x[a+b+c+d] +=1 print x[n]
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s524507073
p00008
Wrong Answer
#! /usr/bin/python3 s=int(input()) n=0 for i in range(10): for j in range(10): for k in range(10): for l in range(10): if s == i+j+k+l: n+=1 print(n)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s894098612
p00008
Wrong Answer
import itertools N = int(raw_input()) res = 0 l = [1,2,3,4,5,6,7,8,9] for element in itertools.combinations_with_replacement(l,5): if sum(element) == N: res += 1 print res
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s956219727
p00008
Wrong Answer
import itertools l = [1,2,3,4,5,6,7,8,9] while True: try: N = int(raw_input()) res = 0 for element in itertools.combinations_with_replacement(l,4): if sum(element) == N: print element res += 4 print res except EOFError: break
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s165933811
p00008
Wrong Answer
import itertools l = [0,1,2,3,4,5,6,7,8,9] while True: try: N = int(raw_input()) res = 0 for element in itertools.combinations_with_replacement(l,4): if sum(element) == N: print element res += 4 print res except EOFError: break
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s543992983
p00008
Wrong Answer
# -*- coding: utf-8 -*- while(True): try: n = int(raw_input()) sum = 0 for a in range(10): for b in range(10): for c in range(10): for d in range(10): if (a + b + c + d == n): sum += 0 print sum except EOFError: break
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s776370087
p00008
Wrong Answer
import sys r=range(10) x=[0]*50 for a in r: for b in r: for c in r: for d in r: x[a+b+c+d-1]+=1 for l in sys.stdin: print x[int(l)-1]
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s913126202
p00008
Wrong Answer
# coding: utf-8 #Problem Name: Debt Hell #ID: tabris #Mail: t123037@kaiyodai.ac.jp n = float(raw_input()) dept = 100000 for i in range(int(n)): dept *= 1.05 if not (dept/1000).is_integer(): dept /= 1000 dept = __import__('math',fromlist=['floor']).floor(dept)*1000+1000 print int(dept)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s408493868
p00008
Wrong Answer
# coding: utf-8 #Problem Name: Sum of 4 Integers #ID: tabris #Mail: t123037@kaiyodai.ac.jp while True: try: n = int(raw_input()) List = [] for i in range(10): for j in range(10): for k in range(10): for l in range(10): if i+j+k+l == n: List.append( (i,j,k,l) ) print len(set(List)) except: break
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s388994561
p00008
Wrong Answer
from itertools import product while True: try: n = int(input) except: break count = sum(a + b + c + d == n for a, b, c, d in product(range(10), repeat=4)) print(count)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s840041501
p00008
Wrong Answer
#! /usr/bin/env python n = int(raw_input()) x = 0 i = range(10) for a in i: for b in i: for c in i: for d in i: if a + b + c + d == n: x = x + 1 print x
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s169522162
p00008
Wrong Answer
import itertools import sys c = list(itertools.product(range(10), repeat=4)) if __name__ == '__main__': for n in sys.stdin.readlines(): print n
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s369574153
p00008
Wrong Answer
n = input() ans = 0 a=b=c=d=0 while True: if d==10: c+=1 d=0 if c==10: b+=1 c=0 if b==10: a+=1 b=0 if a == 10: break #print "%d+%d+%d+%d"%(a,b,c,d) s = a+b+c+d if s == n: ans+=1 d+=1 print ans
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s593904632
p00008
Wrong Answer
import math a=input() cnt=0 for i in xrange(0,10): for j in xrange(0,10): for k in xrange(0,10): for l in xrange(0,10): if i+j+k+l==a: cnt+=1 print cnt
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s601916341
p00008
Wrong Answer
import math a=input() if a<37: cnt=0 for i in xrange(0,10): for j in xrange(0,10): for k in xrange(0,10): for l in xrange(0,10): if i+j+k+l==a: cnt+=1 print cnt else:print 0
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s504641199
p00008
Wrong Answer
while True: try: n=int(input()) cnt=0 for a in range(10): if a<=n: for b in range(10): if b<=n: for c in range(10): if c<=n: d = n-(a+b+c) if 0<=d<=9: cnt+=1 else: break else: break else: break print(cnt) except EOFError: break
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s128594654
p00008
Wrong Answer
n = input() flag = 0 for a in range(10): for b in range(10): for c in range(10): for d in range(10): if a+b+c+d == n: flag += 1 print flag
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s233867392
p00008
Wrong Answer
n = int(input()) flag = 0 for a in range(10): for b in range(10): for c in range(10): for d in range(10): if a+b+c+d == n: flag += 1 print flag
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s551832163
p00008
Wrong Answer
#!/usr/bin/env python3 # -*- coding: utf-8 -*- def main(): num = int(input()) if num >= 19: num = 19 - num + 17 res = 1 gro1 = 3 for i in range(8): if i == num: return res if i == 0: gro2 = 3 else: gro2 += 1 res += gro1 gro1 += gro2 for i in range(8,19): if i == num: return res gro2 -= 3 res += gro1 gro1 += gro2 if __name__ == '__main__': print(main())
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s585967596
p00008
Wrong Answer
#!/usr/bin/env python3 # -*- coding: utf-8 -*- def kai(num): if num >= 19: num = 19 - num + 17 res = 1 gro1 = 3 for i in range(8): if i == num: return res if i == 0: gro2 = 3 else: gro2 += 1 res += gro1 gro1 += gro2 for i in range(8,19): if i == num: return res gro2 -= 3 res += gro1 gro1 += gro2 def main(): while True: try: num = int(input()) except: return else: print(kai(num)) if __name__ == '__main__': main()
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s338826522
p00008
Wrong Answer
n = input() flugs = [0]*51 for i in range(10): for j in range(10): for k in range(10): for l in range(10): flugs[i+j+k+l] += 1 print flugs[int(n)]
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s270729276
p00008
Wrong Answer
import sys sum = [0] * 51 for i in range(10): for j in range(10): for k in range(min(10,18-i-j)): for l in range(min(10,18-i-j-k)): sum[i+j+k+l] += 1 sum[36-i-j-k-l] += 1 for i in sys.stdin: print(sum[int(i)])
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s335579006
p00008
Wrong Answer
n = int(input()) cnt = 0 for i in range(10): for j in range(10): for k in range(10): for l in range(10): if i+j+k+l == n: cnt += 1 print(i,j,k,l) print(cnt)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s917925874
p00008
Wrong Answer
n = int(input()) cnt = 0 for i in range(10): for j in range(10): for k in range(10): for l in range(10): if i+j+k+l == n: cnt += 1 print(cnt)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s733969429
p00008
Wrong Answer
n=int(input()) cnt=0 for i in range(10): for j in range(10): for k in range(10): for l in range(10): if i+j+k+l==n: cnt=cnt+1 print(i,j,k,l) print(cnt)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s066605902
p00008
Wrong Answer
n=int(input()) cnt=0 for i in range(10): for j in range(10): for k in range(10): for l in range(10): if i+j+k+l==n: cnt=cnt+1 print(cnt)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s492358339
p00008
Wrong Answer
import itertools def combination(n): c=0 for i in itertools.product(range(10),repeat=4): (a,b,c,d)=i if a+b+c+d==n: c+=1 return c while True: try: n=int(input()) combination(n) except EOFError: break
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s160454617
p00008
Wrong Answer
import itertools def combination(n): m=0 for i in itertools.product(range(10),repeat=4): (a,b,c,d)=i if a+b+c+d==n: m+=1 return m while True: try: n=int(input()) combination(n) except EOFError: break
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s693440130
p00008
Wrong Answer
INF=-1 memo=[[INF]*51 for i in range(5)] def rec(i,n): if memo[i][n]!=INF: return memo[i][n] if i==4: return 1 if n==0 else 0 for m in range(10): memo[i][n]+=rec(i+1,n-m) return memo[i][n] while True: try: n=int(input()) print(rec(0,n)) except: break
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s404376716
p00008
Wrong Answer
memo=[[-1]*51 for i in range(5)] def rec(i,n): if memo[i][n]!=-1: return memo[i][n] memo[i][n]=0 if i==4: return 1 if n==0 else 0 for m in range(10): memo[i][n]+=rec(i+1,n-m) return memo[i][n] while True: try: n=int(input()) print(rec(0,n)) except: break
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s234214848
p00008
Wrong Answer
import sys p = [0] * 51 v = 0 for i in range(10): p[i] = p[36-i] = (i+3)*(i+2)*(i+1)//6 for i in range(10,19): p[i] = p[36-i] = (i+1)*(i+2)*(1-i)//2 for i in sys.stdin: print(p[int(i)])
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s812895994
p00008
Wrong Answer
n=int(input()) cnt=0 for i in range(10): for j in range(10): for k in range(10): for l in range(10): if i+k+j+l==n: cnt+=1 print(cnt)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s139896119
p00008
Wrong Answer
n = int(input().rstrip()) cnt = 0 for a in range(10): for b in range(10): for c in range(10): for d in range(10): if a + b + c + d == n: cnt = cnt + 1 print(str(cnt))
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s846813305
p00008
Wrong Answer
import sys a=[] for num in sys.stdin: a.append(num) for n in a: time=0 if n<=18: for i in range(n+1): if i<=9: if n-i<=9: time+=(i+1)*(n-i+1) else: time+=(i+1)*(19-n+i) else: time+=(19-i)*(n-i+1) elif n>18 and n<=36: for i in range(37-n): pre=i+n-18 if pre<=9: time+=(pre+1)*(19-n+pre) else: if n-pre<=9: time+=(19-pre)*(n-pre+1) else: time+=(19-pre)*(19-n+pre) print time
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s919717519
p00008
Wrong Answer
n=input() c=0 for i in range(10000): if n==sum(map(int, list(str(i)))): c+=1 print c
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s686825149
p00008
Wrong Answer
#!/usr/bin/env python # -*- conding: utf-8 -*- import itertools import sys import math for line in sys.stdin.readlines(): n = int(line.strip()) if n == 36: print(1) continue if n > 36: print(0) continue cnt = 0 cmbs = itertools.combinations_with_replacement(range(0,10), 4) for cmb in cmbs: if sum(cmb) == n: if len(set(cmb)) == 1: cnt += 1 elif len(set(cmb)) == 2: cnt += math.factorial(2) * 2 elif len(set(cmb)) == 3: cnt += math.factorial(3) elif len(set(cmb)) == 4: cnt += math.factorial(4) print(cnt)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s545573461
p00008
Wrong Answer
num=int(input()) sum=0 Range=10 for a in range(Range): for b in range(Range): for c in range(Range): for d in range(Range): if num==a+b+c+d: sum+=1 print(sum)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s916157824
p00008
Wrong Answer
import sys import math as mas n=int(input()) out=0 for i in range(10): for j in range(10): for k in range(10): for l in range(10): if(i+j+k+l==n):out+=1 print(out) #for i in sys.stdin: # a,b=map(int,i.split()) # print(gcd(a,b),lcm(a,b))
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s683634989
p00008
Wrong Answer
import sys def count(number) : result = 0 for a in range(10) : for b in range(10) : for c in range(10) : for d in range(10) : if a + b + c + d == 35 : result += 1 return result for make in sys.stdin.readlines(): print(count(make))
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s008825939
p00008
Wrong Answer
import sys def count(number) : result = 0 for a in range(10) : for b in range(10) : for c in range(10) : for d in range(10) : if a + b + c + d == 35 : result += 1 return result for make in sys.stdin : print(count(make))
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s610605224
p00008
Wrong Answer
for _ in range(50): try: n = int(input()) # 1 <= n <= 50 ans =set() for a in range(10): if (n - a) >= 1: for b in range(10): if(n - a -b) >= 1: for c in range(10): if(n - a - b - c) >= 1: for d in range(10): if(n - a - b - c - d) == 0: ans.add("{},{},{},{}".format(a,b,c,d)) print(len(ans)) except EOFError: break
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s073478242
p00008
Wrong Answer
for _ in range(50): try: n = int(input()) # 1 <= n <= 50 ans =set() for a in range(10): if (n - a) >= 1: for b in range(10): if(n - a -b) >= 1: for c in range(10): if(n - a - b - c) >= 1: for d in range(10): if(n - a - b - c - d) == 0: ans.add("{},{},{},{}".format(a,b,c,d)) ans.add("{},{},{},{}".format(b,c,d,a)) ans.add("{},{},{},{}".format(c,d,a,b)) ans.add("{},{},{},{}".format(d,a,b,c)) print(ans) print(len(ans)) except EOFError: break
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s084162985
p00008
Wrong Answer
p = input() p = int(p) i = 0 for a in range(0, 10): for b in range(0, 10): for c in range(0, 10): for d in range(0, 10): sum = a + b + c + d if sum == p: i += 1 print(i)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s312403452
p00008
Wrong Answer
n=int(input()) print(len([[a,b,c,d]for a in range(10)for b in range(10)for c in range(10)for d in range(10)if a+b+c+d==n]))
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s282478815
p00008
Wrong Answer
n = int(input()) count = 0 for i in range(10): for j in range(10): for k in range(10): for l in range(10): if i + j + k + l == n: count += 1 print(count)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s111606333
p00008
Wrong Answer
user = input() n = int(user) num = 0 for a in range(10): for b in range(10): for c in range(10): for d in range(10): if(n == a + b + c + d): num += 1 print(num)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s667830939
p00008
Wrong Answer
n=int(input()) count=0 for a in range(1,10): for b in range(1,10): for c in range(1,10): if 50-a-b-c>=0 and 50-a-b-c<10: count+=1 print(count)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s921509608
p00008
Wrong Answer
n=int(input()) count=0 for a in range(0,10): for b in range(0,10): for c in range(0,10): if 50-a-b-c>=0 and 50-a-b-c<10: count+=1 print(count)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s585722932
p00008
Wrong Answer
import sys import math def case(a,b): return math.factorial(a+b)/(math.factorial(a)*math.factorial(b)) while True: try: n = int(input()) if n >= 37: print('0') elif n >= 10 and n <= 36: print(case(n,4)-case(n-10,3)) else: print(case(n,4)) except EOFError: break
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s556549991
p00008
Wrong Answer
import sys import math def case(a,b): return math.factorial(a+b)/(math.factorial(a)*math.factorial(b)) while True: try: n = int(input()) if n >= 37: print('0') elif n >= 10 and n <= 18: print(int(case(n,3)-3*case(n-9,2))) elif n >= 19 and n <= 27: print(int(case(n,3)-3*case(n-9,2)-3*case(n-18,1))) elif n >= 28 and n <= 36: print(int(case(36-n,3))) else: print(int(case(n,3))) except EOFError: break
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s575881867
p00008
Wrong Answer
import sys import math def case(a,b): return math.factorial(a+b)/(math.factorial(a)*math.factorial(b)) while True: try: n = int(input()) if n >= 37: print('0') elif n >= 10 and n <= 18: print(int(case(n,3)-3*case(n-9,3))) elif n >= 19 and n <= 27: print(int(case(36-n,3)-3*case(36-n-9,3))) elif n >= 28 and n <= 36: print(int(case(36-n,3))) else: print(int(case(n,3))) except EOFError: break
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s429411462
p00008
Wrong Answer
n = int(input()) def rec(j,s): if s > n: return 0 if s == n: return 1 if j == 0: return 0 v = 0 for i in range(10): v += rec(j-1, s + i) return v print(rec(4,0))
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s197851746
p00008
Wrong Answer
import itertools N = int(input()) count = 0 for i in list(itertools.combinations_with_replacement(range(10), 4)): if (sum(i) == N): count += 1 print(count)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s045636471
p00008
Wrong Answer
import sys inputs = sys.argv[1:] for i in inputs: if i=='\n': continue ans = 0 n = int(i) #logic for i in range(10): for j in range(10): for k in range(10): for l in range(10): if i + j + k + l == n: ans +=1 print "{}\n".format(ans)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s863434145
p00008
Wrong Answer
s = int(input()) results=set() for a in range(10): for b in range(10): for c in range(10): d = s-a-b-c if d<0:break if d<=9: results.add((a,b,c,d)) print(len(results))
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s842114392
p00008
Wrong Answer
n = int(raw_input()) sum = 0 for a in range(10): for b in range(10): for c in range(10): for d in range(10): #print a , b, c, d #print n if (a+b+c+d == n): sum += 1 print sum
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s727584984
p00008
Wrong Answer
import itertools, sys d = {i: 0 for i in range(51)} for i in itertools.combinations_with_replacement(range(0,10), 4): d[sum(i)] += 1 print(d) for i in map(int, sys.stdin): print(d[i]*4)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s004595974
p00008
Wrong Answer
import itertools, sys d = {i: 0 for i in range(51)} for i in itertools.combinations_with_replacement(range(0,10), 4): if i[0] == i[1] == i[2] == i[3]: continue d[sum(i)] += 1 for i in map(int, sys.stdin): if i / 4 == 0: print(d[i]*4+1) else: print(d[i]*4)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s945097922
p00008
Wrong Answer
num = int(input()) count = 0 for a in range(10): for b in range(10): for c in range(10): for d in range(10): if a+b+c+d==num: count+=1 print(int(count))
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s251979894
p00008
Wrong Answer
n = int(input()) ans = 0 table = [[a,b,c,d] for a in range(10) for b in range(10) for c in range(10) for d in range(10)] for abcd in table: ans += sum(abcd) == n print(ans)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s821714036
p00008
Wrong Answer
n=int(input()) a,b,c,d=0,0,0,0 ans=0 for i in range(10): c=0 for j in range(10): b=0 for f in range(10): a=0 for e in range(10): if a+b+c+d==n: ans+=1 a+=1 b+=1 c+=1 d+=1 print(ans)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s106996699
p00008
Wrong Answer
n=int(input()) d=0 ans=0 for i in range(10): c=0 for j in range(10): b=0 for f in range(10): a=0 for e in range(10): if a+b+c+d==n: ans+=1 a+=1 b+=1 c+=1 d+=1 print(ans)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s438851292
p00008
Wrong Answer
import sys a=[0]*51 for i in range(10): a[i]=a[36-i]=(i+3)*(i+2)*(i+1)//6 for i in range(10,19): a[i]=a[36-i]=(i+3)*(i+2)*(i+1)//6-a[i-10] for e in sys.stdin: print(a[int(e)])
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s529940217
p00008
Wrong Answer
n=int(input()) count=0 for a in range(10): for b in range(10): for c in range(10): for d in range(10): ans = a + b + c + d if(n == ans): count += 1 print(count)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s222276827
p00008
Wrong Answer
ans=[0]*51 for a in range(10): for b in range(10): for c in range(10): for d in range(10): ans[sum([a,b,c,d])] += 1 while True: try:print(sum[int(imput())]) except:break
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s666884871
p00008
Wrong Answer
n=int(input()) ans=0 for i in range(10): for j in range(10): for k in range(10): for l in range(10): if i+j+k+l==n: ans+=1 print(ans)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s614521082
p00008
Wrong Answer
lst=[0 for i in range(50)] for a in range(10): for b in range(10): for c in range(10): for d in range(10): lst[a+b+c+d] += 1 while 1: try: print(lst[int(input())]) except: break
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s465033772
p00008
Wrong Answer
a = int(input()) count = 0 for i in range(10): for j in range(10): for k in range(10): for l in range(10): if (i + j + k + l) is a: count += 1 print(count)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s980858109
p00008
Wrong Answer
import math n = int(input()) nn = n arr = [] for i in range (1,5): if(nn>10): arr.append(9) nn = nn-9 else: arr.append(nn) nn = nn-nn #print(arr) top = math.factorial(4) bottom = 1 for i in range(0,4): exist = False for j in range(0,i): if(arr[i]==arr[j]): exist = True count = 0 if(not(exist)): for j in arr: if(arr[i]==j): count += 1 bottom = bottom * math.factorial(count) print(str(int(top/bottom)))
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s612791877
p00008
Wrong Answer
import math n = int(input()) nn = n arr = [] for i in range (1,5): if(nn>10): arr.append(9) nn = nn-9 else: arr.append(nn) nn = nn-nn #print(arr) top = math.factorial(4) bottom = 1 for i in range(0,4): exist = False for j in range(0,i): if(arr[i]==arr[j]): exist = True count = 0 if(not(exist)): for j in arr: if(arr[i]==j): count += 1 bottom = bottom * math.factorial(count) print(str(int(top/bottom))) print()
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s575947711
p00008
Wrong Answer
import sys import math for n in sys.stdin: n = int(n) nn = n arr = [] for i in range (1,5): if(nn>10): arr.append(9) nn = nn-9 else: arr.append(nn) nn = nn-nn #print(arr) top = math.factorial(4) bottom = 1 for i in range(0,4): exist = False for j in range(0,i): if(arr[i]==arr[j]): exist = True count = 0 if(not(exist)): for j in arr: if(arr[i]==j): count += 1 bottom = bottom * math.factorial(count) print(str(int(top/bottom)))
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>
s289509423
p00008
Wrong Answer
# -*- coding: utf-8 -*- n = int(raw_input()) case = 0 for a in range(10): for b in range(10): for c in range(10): for d in range(10): if a + b + c + d == n: case += 1 print(case)
35 1
4 4
<H1>Sum of 4 Integers</H1> <p> Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 &le; <var>a, b, c, d</var> &le; 9) which meet the following equality:<br> <br> <var>a + b + c + d = n</var><br> <br> For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>). </p> <H2>Input</H2> <p> The input consists of several datasets. Each dataset consists of <var>n</var> (1 &le; <var>n</var> &le; 50) in a line. The number of datasets is less than or equal to 50. </p> <H2>Output</H2> <p> Print the number of combination in a line. </p> <H2>Sample Input</H2> <pre> 35 1 </pre> <H2>Output for the Sample Input</H2> <pre> 4 4 </pre>