s_id
stringlengths
10
10
p_id
stringlengths
6
6
u_id
stringlengths
10
10
date
stringlengths
10
10
language
stringclasses
1 value
original_language
stringclasses
11 values
filename_ext
stringclasses
1 value
status
stringclasses
1 value
cpu_time
int64
0
100
memory
stringlengths
4
6
code_size
int64
15
14.7k
code
stringlengths
15
14.7k
problem_id
stringlengths
6
6
problem_description
stringlengths
358
9.83k
input
stringlengths
2
4.87k
output
stringclasses
807 values
__index_level_0__
int64
1.1k
1.22M
s576468148
p00007
u490578380
1584691025
Python
Python3
py
Accepted
20
5664
126
import math PAR = 0.05 sum = 100000 for i in range(int(input())): sum += math.ceil(sum * PAR / 1000) * 1000 print(sum)
p00007
<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>
5
130000
4,902
s660438221
p00007
u123017074
1584579842
Python
Python3
py
Accepted
20
5688
256
import math debt = 100000 rate = 0.05 n = int(input()) def CalcDect(): global debt global n if n <= 0: return debt += (debt * rate) debt = int(math.ceil(debt / 1000)) * 1000 n -= 1 CalcDect() CalcDect() print(debt)
p00007
<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>
5
130000
4,903
s428866808
p00007
u808372529
1583748913
Python
Python3
py
Accepted
30
6416
203
from decimal import Decimal,ROUND_UP n = int(input()) a = 100000 for i in range(n): a = a * 1.05 y = Decimal(str(a)) a = y.quantize(Decimal('1E3'), rounding=ROUND_UP) a = int(a) print(a)
p00007
<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>
5
130000
4,904
s713434363
p00007
u630911389
1583116962
Python
Python3
py
Accepted
20
5608
275
while True: try: n = int(input()) dept = 100000 for i in range(0,n): dept += dept * 0.05 round = dept % 1000 if round > 0: dept += 1000 - round print(int(dept)) except: break
p00007
<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>
5
130000
4,905
s199630999
p00007
u813197825
1579655136
Python
Python3
py
Accepted
20
5596
286
N = int(input()) x = 100000 for i in range(N): if x % 20 == 0: x = x + (x // 20) if x % 1000 > 0: x = x - (x % 1000) + 1000 else: x = 1.05 * x x = int(x) + 1 if x % 1000 > 0: x = x - (x % 1000) + 1000 print(x)
p00007
<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>
5
130000
4,906
s779282390
p00007
u297517978
1573382060
Python
Python3
py
Accepted
20
5600
112
a=100000 n=int(input()) for i in range(n): a*=1.05 if a%1000: a=int(a//1000*1000+1000) print(a)
p00007
<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>
5
130000
4,907
s900753773
p00007
u933957884
1572690234
Python
Python3
py
Accepted
20
5684
146
import math;print([(x.append(y), x) for x in [[100000]] for _ in range(int(input())) for y in [math.ceil(x[-1] * 1.05 / 1000)*1000]][-1][-1][-1])
p00007
<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>
5
130000
4,908
s224657068
p00007
u803862921
1570542775
Python
Python3
py
Accepted
20
5580
103
n = int(input()) d = 100000 for i in range(n): d = d *105 //100 d = -(-d//1000)*1000 print(d)
p00007
<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>
5
130000
4,909
s319735409
p00007
u595265835
1570365554
Python
Python3
py
Accepted
20
5604
166
n = int(input()) w = 100000 for i in range(n): w *= 1.05 if (w % 1000): w = w // 1000 + 1 else: w = w // 1000 w *= 1000 print(int(w))
p00007
<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>
5
130000
4,910
s353151244
p00007
u629170852
1568302411
Python
Python3
py
Accepted
20
5608
144
import sys w=int(input()) base=100000 for i in range(w): base=base*1.05 if base%1000!=0: base=base-base%1000+1000 print(int(base))
p00007
<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>
5
130000
4,911
s015253207
p00007
u824708460
1566138516
Python
Python3
py
Accepted
20
5668
121
import math n = int(input()) d = 100000 for i in range(n): d = d * 1.05 d = math.ceil(d / 1000) * 1000 print(d)
p00007
<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>
5
130000
4,912
s074241066
p00007
u074302614
1565047522
Python
Python3
py
Accepted
20
5664
106
import math a = 100 b = int(input()) for _ in range(b): a = math.ceil(a * 1.05) a *= 1000 print(a)
p00007
<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>
5
130000
4,913
s918454266
p00007
u586792237
1564929468
Python
Python3
py
Accepted
20
5608
167
n = int(input()) def shakkin(n): x = 100000 for i in range(n): x = x * 1.05 if x % 1000: x = x - (x % 1000) + 1000 return int(x) print(shakkin(n))
p00007
<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>
5
130000
4,914
s959971313
p00007
u939401108
1564925384
Python
Python3
py
Accepted
20
5604
156
n = int(input()) money = 100000 for i in range(n): money *= 1.05 if money % 1000 != 0: money = int(money // 1000 * 1000 + 1000) print(money)
p00007
<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>
5
130000
4,915
s911677327
p00007
u654661069
1564924467
Python
Python3
py
Accepted
20
5608
145
a = int(input()) s = 100000 for i in range(a): s = s * 1.05 if s % 1000: s = s - (s % 1000) + 1000 print(int(s))
p00007
<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>
5
130000
4,916
s931284848
p00007
u003684951
1564922823
Python
Python3
py
Accepted
20
5608
145
a = int(input()) s = 100000 for i in range(a): s = s * 1.05 if s % 1000: s = s - (s % 1000) + 1000 print(int(s))
p00007
<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>
5
130000
4,917
s884339011
p00007
u821561321
1564922705
Python
Python3
py
Accepted
20
5584
95
a=100000; n=int(input()) while n>0: n-=1 a=a+(a*5)//100 a=((a-1)//1000+1)*1000 print(a)
p00007
<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>
5
130000
4,918
s740497992
p00007
u433250944
1564908317
Python
Python3
py
Accepted
20
5668
138
import math n = int(input()) money = 100000 for i in range(n): money = money*1.05 money = math.ceil(money/1000)*1000 print(money)
p00007
<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>
5
130000
4,919
s901959367
p00007
u607723579
1564814401
Python
Python3
py
Accepted
20
5588
156
a = 100000; n = int(input()) while n > 0: n -= 1 a = a + (a * 5) // 100 a = ((a - 1) // 1000 + 1) * 1000 # 1000未満の切り上げ print(a)
p00007
<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>
5
130000
4,920
s676869385
p00007
u108130680
1564764173
Python
Python3
py
Accepted
20
5588
120
a = 100000 n = int(input()) while n > 0: n -= 1 a = a+(a*5)//100 a = ((a - 1) // 1000 + 1) * 1000 print(a)
p00007
<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>
5
130000
4,921
s046620455
p00007
u312033355
1564727140
Python
Python3
py
Accepted
20
5588
156
a = 100000; n = int(input()) while n > 0: n -= 1 a = a + (a * 5) // 100 a = ((a - 1) // 1000 + 1) * 1000 # 1000未満の切り上げ print(a)
p00007
<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>
5
130000
4,922
s312923397
p00007
u529337794
1564698135
Python
Python3
py
Accepted
20
5660
82
import math a=100 for _ in range(int(input())):a=math.ceil(a*1.05) print(a*1000)
p00007
<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>
5
130000
4,923
s346986732
p00007
u212392281
1564582913
Python
Python3
py
Accepted
20
5668
96
import math n = int(input()) a = 100 for i in range(n): a = math.ceil(a*1.05) print(a*1000)
p00007
<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>
5
130000
4,924
s424726130
p00007
u678843586
1563941726
Python
Python3
py
Accepted
30
5596
69
a=100 for _ in[0]*int(input()):a=int(a*1.05)+(a%20>0) print(a*1000)
p00007
<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>
5
130000
4,925
s309119280
p00007
u427219397
1563771879
Python
Python3
py
Accepted
20
5668
81
import math a=100 for _ in range(int(input())):a=math.ceil(a*1.05) print(a*1000)
p00007
<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>
5
130000
4,926
s120369673
p00007
u013648252
1563675531
Python
Python3
py
Accepted
20
5592
156
a = 100000; n = int(input()) while n > 0: n -= 1 a = a + (a * 5) // 100 a = ((a - 1) // 1000 + 1) * 1000 # 1000未満の切り上げ print(a)
p00007
<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>
5
130000
4,927
s942244771
p00007
u001166815
1563510083
Python
Python3
py
Accepted
20
5616
166
# coding: utf-8 m = 100000 n = int(input()) for i in range(n): m = m*1.05 h = 0; if m % 1000: h = 1000 m = int(m // 1000 * 1000 + h) print(m)
p00007
<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>
5
130000
4,928
s990494019
p00007
u997476941
1563170280
Python
Python3
py
Accepted
20
5608
145
a = int(input()) s = 100000 for i in range(a): s = s * 1.05 if s % 1000: s = s - (s % 1000) + 1000 print(int(s))
p00007
<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>
5
130000
4,929
s790974275
p00007
u313600138
1562563965
Python
Python3
py
Accepted
20
5668
148
import math n= int(input()) def money(x): A =100 for i in range(x): A=math.ceil(A*1.05) # print(A) return A*1000 print(money(n))
p00007
<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>
5
130000
4,930
s788448242
p00007
u051789695
1562042969
Python
Python3
py
Accepted
20
5608
152
n=int(input()) ans=100000 for i in range(n): ans+=ans*0.05 if ans%1000!=0: ans-=ans%1000 ans+=1000 ans=int(ans) print(ans)
p00007
<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>
5
130000
4,931
s879448867
p00007
u614095715
1560531004
Python
Python3
py
Accepted
30
5668
116
import math debt = 100000 for n in range(int(input())): debt = math.ceil(debt*1.05/1000)*1000 print(str(debt))
p00007
<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>
5
130000
4,932
s891398957
p00007
u548252256
1560105150
Python
Python3
py
Accepted
20
5604
248
if __name__ == '__main__': n = int(input()) s = 100000 for i in range(n): s += int(s*(0.05)) tmp0 = str(s) tmp1 = len(tmp0) tmp2 = tmp0[0:tmp1-3] num = tmp2 + "000" if int(s) - int(num) != 0: s = int(num) + 1000 print(s)
p00007
<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>
5
130000
4,933
s245592635
p00007
u506537276
1560089734
Python
Python3
py
Accepted
20
5604
150
n = int(input()) x = 100000 for i in range(n): x = x * 1.05 if x % 1000 != 0: y = x % 1000 x += (1000 - y) else: pass print(int(x))
p00007
<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>
5
130000
4,934
s536811949
p00007
u923573620
1559891928
Python
Python3
py
Accepted
20
5664
127
import math n = int(input()) debt = 100000 for i in range(n): debt = 1000 * math.ceil(debt * 1.05 / 1000.0) print(debt)
p00007
<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>
5
130000
4,935
s481040830
p00007
u264450287
1558571221
Python
Python3
py
Accepted
20
5660
153
import math sum = 100000 n=int(input()) for i in range(n): sum=sum*1.05 if sum % 1000 != 0: a=sum//1000 a=a+1 sum=a*1000 print(int(sum))
p00007
<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>
5
130000
4,936
s395204214
p00007
u314166831
1557331994
Python
Python3
py
Accepted
20
5620
1,184
### ### atcorder test program ### import sys ### math class class math: ### pi pi = 3.14159265358979323846264338 ### GCD def gcd(self, a, b): if b == 0: return a return self.gcd(b, a%b) ### LCM def lcm(self, a, b): return (a*b)//self.gcd(a,b) math = math() ### output class class output: ### list def list(self, l): l = list(l) print(" ", end="") for i, num in enumerate(l): print(num, end="") if i != len(l)-1: print(" ", end="") print() output = output() ### input sample #i = input() #A, B, C = [x for x in input().split()] #inlist = [int(w) for w in input().split()] #R = float(input()) #A = [int(x) for x in input().split()] #for line in sys.stdin.readlines(): # x, y = [int(temp) for temp in line.split()] ### output sample #print("{0} {1} {2:.5f}".format(A//B, A%B, A/B)) #print("{0:.6f} {1:.6f}".format(R*R*math.pi,R*2*math.pi)) #print(" {}".format(i), end="") m = 100000 for i in range(int(input())): m *= 1.05 if m%1000 != 0: m = (m//1000+1) * 1000 else: m = (m//1000) * 1000 print(int(m))
p00007
<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>
5
130000
4,937
s014646393
p00007
u904226154
1557215149
Python
Python3
py
Accepted
20
5604
166
weeks = int(input()) debt = 100000 for i in range(weeks): debt = debt * 1.05 if debt % 1000 != 0: debt = debt - (debt % 1000) + 1000 print(int(debt))
p00007
<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>
5
130000
4,938
s893408590
p00007
u406093358
1555462986
Python
Python
py
Accepted
10
4624
145
n = int(raw_input()) debt = 100000 for i in range(0, n): debt = 105*debt/100 if debt % 1000 != 0: debt = (debt / 1000 + 1) * 1000 print debt
p00007
<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>
5
130000
4,939
s057576511
p00007
u647694976
1554695168
Python
Python3
py
Accepted
20
5608
186
N=int(input()) def syakkin(N): pri=100000 for i in range(N): pri=pri*1.05 if pri%1000: pri=pri-(pri%1000)+1000 return int(pri) print(syakkin(N))
p00007
<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>
5
130000
4,940
s717603877
p00007
u888548672
1554522585
Python
Python3
py
Accepted
20
5660
94
import math r = 100000 for i in range(int(input())): r = math.ceil(r*1.05/1000)*1000 print(r)
p00007
<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>
5
130000
4,941
s131747569
p00007
u617401892
1554089696
Python
Python3
py
Accepted
30
5668
184
#!/usr/bin/env python3 from math import ceil n = int(input()) debt = 100000 for i in range(0, n): debt = debt * 1.05 debt = int(ceil(debt / 1000.0) * 1000.0) print(debt)
p00007
<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>
5
130000
4,942
s963422246
p00007
u625806423
1552922942
Python
Python3
py
Accepted
30
5612
146
debt = 100000 n = int(input()) for i in range(n): debt *= 1.05 if debt % 1000 != 0: debt = int(((debt // 1000) + 1) * 1000) print(debt)
p00007
<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>
5
130000
4,943
s855153147
p00007
u990228206
1551163894
Python
Python3
py
Accepted
20
5664
110
import math n=int(input()) debt=100000 for i in range(n): debt=math.ceil(debt*1.05/1000)*1000 print(debt)
p00007
<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>
5
130000
4,944
s717222977
p00007
u195186080
1550731657
Python
Python3
py
Accepted
20
5604
174
debt = 100000 weeks = int(input()) for i in range(weeks): debt = int(debt * 1.05) frac = debt % 1000 if frac != 0: debt = debt - frac + 1000 print(debt)
p00007
<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>
5
130000
4,945
s977824119
p00007
u733798831
1550493893
Python
Python3
py
Accepted
20
5604
174
n=int(input()) dept=100000 for i in range(n): A=dept*0.05/1000 if(A!=int(A)): dept=dept+int(A)*1000+1000 else: dept=dept+int(A)*1000 print(dept)
p00007
<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>
5
130000
4,946
s928159992
p00007
u011621222
1548077984
Python
Python3
py
Accepted
20
5608
145
a = int(input()) s = 100000 for i in range(a): s = s * 1.05 if s % 1000: s = s - (s % 1000) + 1000 print(int(s))
p00007
<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>
5
130000
4,947
s442585947
p00007
u689047545
1547907591
Python
Python3
py
Accepted
20
5672
110
import math n = int(input()) x = 100000 for i in range(n): x = math.ceil(x * 1.05 / 1000) * 1000 print(x)
p00007
<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>
5
130000
4,948
s986565149
p00007
u350155409
1547292966
Python
Python3
py
Accepted
20
5608
161
n = int(input()) debt = 100000 for i in range(n): x = debt*1.05 if x%1000==0: debt = x else: debt = (x//1000)*1000+1000 print(int(debt))
p00007
<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>
5
130000
4,949
s924968472
p00007
u537067968
1547106092
Python
Python3
py
Accepted
20
5616
217
#import math def up(a): m = a//1000*1000 if a%1000 > 0: return int(m + 1000) else: return int(a) n = int(input()) m = 100000 for i in range(n): m = m * 1.05 m = up(m) print(m)
p00007
<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>
5
130000
4,950
s012955650
p00007
u158979022
1544455688
Python
Python3
py
Accepted
20
5588
117
m = 100000 n = int(input()) while n > 0: n -= 1 m = m + (m * 5 // 100) m = ((m-1) // 1000 + 1) * 1000 print(m)
p00007
<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>
5
130000
4,951
s162083803
p00007
u080014366
1544329593
Python
Python3
py
Accepted
20
5668
302
import math n=int(input()) a=100 for i in range (n): a=math.ceil(a*1.05) #四捨五入 #d_new=int(round(d+1,-4)) #from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN #d_new=Decimal(int(d)).quantize(Decimal('1E4'), rounding=ROUND_HALF_UP) #切り捨て #math.floor(11/3) d=a*1000 print(int(d))
p00007
<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>
5
130000
4,952
s489836011
p00007
u498511622
1544315059
Python
Python3
py
Accepted
20
5668
105
from math import ceil as c a=int(input()) b = 100 for i in range(a): b = c(b*1.05) print(b*1000)
p00007
<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>
5
130000
4,953
s099960955
p00007
u291570764
1543849349
Python
Python3
py
Accepted
20
5616
144
while True: try: n = int(input()) except EOFError: break ret=100000.0 for i in range(n): ret=round(ret*1.05+499, -3) print(int(ret))
p00007
<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>
5
130000
4,954
s369787356
p00007
u573115711
1543670171
Python
Python3
py
Accepted
20
5672
116
import math n = int(input()) result = 100 for i in range(n): result = math.ceil(result*1.05) print(result*1000)
p00007
<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>
5
130000
4,955
s080506699
p00007
u606639970
1543055323
Python
Python3
py
Accepted
20
5608
172
week = int(input() ) debt = 100000 for i in range(week): debt = debt * 1.05 if debt % 1000 != 0: debt -= debt % 1000 debt += 1000 print(int(debt) )
p00007
<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>
5
130000
4,956
s895291063
p00007
u563075864
1542099347
Python
Python3
py
Accepted
20
5684
156
import math n = int(input()) def debt(i): if i == 0: return 100000 else: return math.ceil(debt(i-1)*1.05/1000)*1000 print(debt(n))
p00007
<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>
5
130000
4,957
s961760828
p00007
u067299340
1542078827
Python
Python3
py
Accepted
20
5596
117
n = int(input()) amount = 100000 for i in range(n): amount = int(-(-amount * 1.05 // 1000) * 1000) print(amount)
p00007
<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>
5
130000
4,958
s233711974
p00007
u221424603
1542040947
Python
Python3
py
Accepted
20
5608
164
n=int(input()) zandaka=100000 for i in range(n): zandaka=zandaka*1.05 if zandaka%1000!=0: zandaka=zandaka+1000-zandaka%1000 print(int(zandaka))
p00007
<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>
5
130000
4,959
s504707784
p00007
u717526540
1541579788
Python
Python3
py
Accepted
20
5608
161
n = int(input()) money = 100000 for i in range(n): money *= 1.05 if money % 1000 != 0: money = int(money // 1000 * 1000 + 1000) print(money)
p00007
<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>
5
130000
4,960
s658027671
p00007
u317583692
1539618628
Python
Python3
py
Accepted
20
5604
152
N = int(input()) debt = 100000 for i in range(N): debt *= 1.05 if debt % 1000 > 0: debt = debt + 1000 - debt % 1000 print(round(debt))
p00007
<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>
5
130000
4,961
s098070240
p00007
u219940997
1537192100
Python
Python3
py
Accepted
20
5672
139
import math n = int(input()) debt = 100000 for _ in range(n): debt = debt * 1.05 debt = math.ceil(debt / 1000) * 1000 print(debt)
p00007
<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>
5
130000
4,962
s129105992
p00007
u319725914
1533911130
Python
Python3
py
Accepted
20
5604
128
N = int(input()) a = 100000 for _ in range(N): a *= 1.05 if a%1000: a -= a%1000 a += 1000 print(int(a))
p00007
<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>
5
130000
4,963
s588569239
p00007
u938878704
1533105164
Python
Python3
py
Accepted
20
5616
234
N = int(input()) def doround(n) : if n % 1000 > 0 : return (n // 1000) * 1000 + 1000 else : return n base = 100000 for i in range(N) : base *= 1.05 base = doround(base) print(int(base))
p00007
<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>
5
130000
4,964
s381220112
p00007
u841567836
1532779883
Python
Python3
py
Accepted
20
5672
182
import math def run(): m = 100 r = 1.05 n = int(input()) for _ in range(n): m = math.ceil(m * r) print(m * 1000) if __name__ == '__main__': run()
p00007
<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>
5
130000
4,965
s911477409
p00007
u252700163
1532674049
Python
Python3
py
Accepted
20
5664
149
import math n = int(input()) base = 100000 for i in range(n): base *= 1.05 base /= 1000 base = math.ceil(base) base *= 1000 print(base)
p00007
<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>
5
130000
4,966
s629694913
p00007
u454636644
1525945150
Python
Python3
py
Accepted
20
5608
133
n = int(input()) m = 100000 for i in range(n): m = m * 1.05 if m % 1000 > 0: m = m - (m%1000) + 1000 print(int(m))
p00007
<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>
5
130000
4,967
s398956915
p00007
u853158149
1521964435
Python
Python3
py
Accepted
20
5656
131
import math n = int(input()) debt = 100000 for i in range(n): debt += debt/20 debt = math.ceil(debt/1000)*1000 print(debt)
p00007
<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>
5
130000
4,968
s551425459
p00007
u079141094
1467250853
Python
Python3
py
Accepted
30
7636
131
debt = 100000 n = int(input()) for _ in range(n): debt *= 1.05 if debt % 1000 > 0: debt += 1000 - debt % 1000 print(int(debt))
p00007
<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>
5
130000
4,969
s413856050
p00007
u822200871
1447520960
Python
Python3
py
Accepted
20
7504
190
num = int(input()) debt = 100000 for x in range(num): debt = debt * 105 / 100 if debt % 1000 != 0: debt = ((debt // 1000) + 1) * 1000 else: pass print(int(debt))
p00007
<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>
5
130000
4,970
s231642009
p00007
u197615660
1372870773
Python
Python
py
Accepted
10
4212
152
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
p00007
<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>
5
130000
4,971
s900517607
p00008
u179046735
1559294303
Python
Python3
py
Accepted
50
5592
278
while True: try: n=int(input()) ans=0 for a in range(0,10): for b in range(0,10): for c in range(0,10): if 0<=(n-(a+b+c))<=9: ans+=1 print(ans) except: break
p00008
<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>
35 1
4 4
4,972
s972309686
p00008
u450407555
1409274137
Python
Python
py
Accepted
10
4208
187
import sys 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 for i in sys.stdin: print x[int(i)]
p00008
<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>
35 1
4 4
4,973
s524392141
p00008
u703446356
1411047872
Python
Python
py
Accepted
20
4220
345
while True: ans = 0 try: n = input() except (EOFError): break for a in range(10): atmp = n - a if(-1 < atmp and atmp<28): for b in range(10): btmp = atmp - b if(-1 < btmp and btmp<19): for c in range(10): d = btmp - c if(-1 < d and d<10): ans += 1 #print (a, b, c, d) print ans
p00008
<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>
35 1
4 4
4,974
s333289850
p00008
u855866586
1412157192
Python
Python
py
Accepted
100
4200
360
while True: try: #(a,b,c,d)=map(int,raw_input().split()) n=input() cnt=0 for a in xrange(10): for b in xrange(10): for c in xrange(10): for d in xrange(10): if a+b+c+d==n: cnt+=1 print(cnt) except EOFError: break
p00008
<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>
35 1
4 4
4,975
s341035600
p00008
u607831289
1416133971
Python
Python
py
Accepted
30
4336
334
import math def sum_of(v_cnt, n): if v_cnt == 1: if 0 <= n <= 9: return 1 else: return 0 else: result = 0 for v in range(10): result += sum_of(v_cnt - 1, n - v) return result import sys for line in sys.stdin: n = int(line) print sum_of(4, n)
p00008
<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>
35 1
4 4
4,976
s745631936
p00008
u672822075
1418977127
Python
Python3
py
Accepted
30
6724
172
x=[0]*51 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
p00008
<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>
35 1
4 4
4,977
s919084019
p00008
u540744789
1425639581
Python
Python
py
Accepted
100
4196
250
import sys for n in sys.stdin: n=int(n) count=0 for i1 in xrange(10): for i2 in xrange(10): for i3 in xrange(10): for i4 in xrange(10): if(i1+i2+i3+i4 == n): count+=1 print count
p00008
<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>
35 1
4 4
4,978
s980069130
p00008
u009961299
1431012294
Python
Python3
py
Accepted
60
6724
252
# -*- coding: utf-8 -*- import itertools while True: try: n = int ( input ( ) ) except EOFError: break r = 0 for ( i, j, k ) in itertools.product ( range ( 10 ), range ( 10 ), range ( 10 ) ): r += ( 0 <= n - i - j - k < 10 ) print ( r )
p00008
<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>
35 1
4 4
4,979
s035046221
p00008
u885889402
1431592132
Python
Python3
py
Accepted
40
6720
790
while(True): a = 0 try: n = input() except EOFError: break n=int(n) if n > 36: print(0) continue elif n==36: print(1) continue b = n for i in range(10): if n-i==0: a=a+1 #print("(%d,0,0,0)"%(i)) break for j in range(10): if n-i-j==0: a=a+1 #print("(%d,%d,0,0)"%(i,j)) break for k in range(10): b = n-i-j-k if b>=0 and b<=9: a=a+1 #print("(%d,%d,%d,%d)"%(i,j,k,b)) continue elif b > 9: continue else: break print(a)
p00008
<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>
35 1
4 4
4,980
s020266694
p00008
u520870854
1431704514
Python
Python
py
Accepted
100
4204
366
# -*- 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 += 1 print sum except EOFError: break
p00008
<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>
35 1
4 4
4,981
s393160760
p00008
u358879127
1432034303
Python
Python
py
Accepted
20
4212
304
def get_input(): while True: try: yield ''.join(raw_input()) except EOFError: break ar = [0] * 51 for i in range(10): for j in range(10): for k in range(10): for l in range(10): ar[i + j + k + l] += 1 for a in list(get_input()): print ar[int(a)]
p00008
<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>
35 1
4 4
4,982
s662200702
p00008
u067299340
1432709351
Python
Python
py
Accepted
20
4192
140
import sys r=range(10) x=[0]*51 for a in r: for b in r: for c in r: for d in r: x[a+b+c+d]+=1 for l in sys.stdin: print x[int(l)]
p00008
<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>
35 1
4 4
4,983
s664207643
p00008
u067299340
1432709397
Python
Python
py
Accepted
20
4196
141
import sys r=xrange(10) x=[0]*51 for a in r: for b in r: for c in r: for d in r: x[a+b+c+d]+=1 for l in sys.stdin: print x[int(l)]
p00008
<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>
35 1
4 4
4,984
s409403407
p00008
u067299340
1432709421
Python
Python
py
Accepted
20
4200
164
import sys x=[0]*51 for a in xrange(10): for b in xrange(10): for c in xrange(10): for d in xrange(10): x[a+b+c+d]+=1 for l in sys.stdin: print x[int(l)]
p00008
<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>
35 1
4 4
4,985
s933674216
p00008
u067299340
1432709577
Python
Python
py
Accepted
20
4192
158
import sys s=[0]*51 for a in range(10): for b in range(10): for c in range(10): for d in range(10): s[a+b+c+d]+=1 for l in sys.stdin:print s[int(l)]
p00008
<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>
35 1
4 4
4,986
s163294984
p00008
u067299340
1432709825
Python
Python
py
Accepted
20
5248
143
import sys,itertools k=range(10) s=[0]*51 for n in [sum(x)for x in list(itertools.product(k,k,k,k))]:s[n]+=1 for l in sys.stdin:print s[int(l)]
p00008
<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>
35 1
4 4
4,987
s907178231
p00008
u067299340
1432709866
Python
Python
py
Accepted
20
5248
144
import sys,itertools k=xrange(10) s=[0]*51 for n in [sum(x)for x in list(itertools.product(k,k,k,k))]:s[n]+=1 for l in sys.stdin:print s[int(l)]
p00008
<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>
35 1
4 4
4,988
s810346539
p00008
u067299340
1432782845
Python
Python
py
Accepted
20
5248
144
import sys,itertools k=xrange(10) s=[0]*51 for n in [sum(x)for x in list(itertools.product(k,k,k,k))]:s[n]+=1 for l in sys.stdin:print s[int(l)]
p00008
<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>
35 1
4 4
4,989
s040811692
p00008
u067299340
1432782861
Python
Python
py
Accepted
10
4192
158
import sys s=[0]*51 for a in range(10): for b in range(10): for c in range(10): for d in range(10): s[a+b+c+d]+=1 for l in sys.stdin:print s[int(l)]
p00008
<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>
35 1
4 4
4,990
s899328169
p00008
u067299340
1432782877
Python
Python
py
Accepted
20
5252
144
import sys,itertools k=xrange(10) s=[0]*51 for n in [sum(x)for x in list(itertools.product(k,k,k,k))]:s[n]+=1 for l in sys.stdin:print s[int(l)]
p00008
<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>
35 1
4 4
4,991
s675124428
p00008
u722431421
1439532128
Python
Python
py
Accepted
10
4204
373
# coding: utf-8 #Problem Name: Sum of 4 Integers #ID: tabris #Mail: t123037@kaiyodai.ac.jp pairs = {i:0 for i in range(51)} for i in range(10): for j in range(10): for k in range(10): for l in range(10): pairs[i+j+k+l] += 1 while True: try: n = int(raw_input()) print pairs[n] except: break
p00008
<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>
35 1
4 4
4,992
s610385040
p00008
u529386725
1452183342
Python
Python
py
Accepted
100
6236
318
import sys for line in sys.stdin: n = int(line) cnt = 0 if n <= 36: for i in xrange(10): for j in xrange(10): for k in xrange(10): for l in xrange(10): if i + j + k + l == n: cnt += 1 print cnt
p00008
<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>
35 1
4 4
4,993
s960306763
p00008
u650459696
1455435560
Python
Python3
py
Accepted
40
7732
324
import sys ans=[] def sumint(lp,ttl): if (ttl > lp*9) | (ttl < 0): return 0 elif lp == 1: return 1 else: a = 0 for n in range(0,10) : a += sumint(lp - 1,ttl - n) return a for i in sys.stdin: ans.append(sumint(4,int(i))) print('\n'.join(map(str,ans)))
p00008
<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>
35 1
4 4
4,994
s985087631
p00008
u766477342
1457181597
Python
Python3
py
Accepted
20
7584
259
tbl = [0] * 51 for i in range(10): for j in range(10): tbl[i + j] += 1 try: while 1: n = int(input()) res = 0 for i in range(n + 1): res += tbl[i] * tbl[n - i] print(res) except Exception: pass
p00008
<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>
35 1
4 4
4,995
s493045045
p00008
u075836834
1458029492
Python
Python3
py
Accepted
50
7616
200
while True: try: n=int(input()) cnt=0 for a in range(10): for b in range(10): for c in range(10): d = n-(a+b+c) if 0<=d<=9: cnt+=1 print(cnt) except EOFError: break
p00008
<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>
35 1
4 4
4,996
s401126203
p00008
u075836834
1458029678
Python
Python3
py
Accepted
60
7628
323
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
p00008
<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>
35 1
4 4
4,997
s643507812
p00008
u148101999
1458270686
Python
Python
py
Accepted
90
6364
263
import sys def output(x): count = 0 for i in xrange(10): for j in xrange(10): for k in xrange(10): for l in xrange(10): if i+j+k+l == x: count += 1 print count if __name__ == "__main__": for i in sys.stdin: num = int(i) output(num)
p00008
<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>
35 1
4 4
4,998
s926364226
p00008
u130979865
1459857306
Python
Python
py
Accepted
20
6364
304
# -*- coding: utf-8 -*- import sys sum = [0]*37 for a in range(10): for b in range(10): for c in range(10): for d in range(10): sum[a+b+c+d] += 1 for line in sys.stdin: n = int(line) if n >= 0 and n <= 36: print sum[n] else: print "0"
p00008
<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>
35 1
4 4
4,999
s757721508
p00008
u572790226
1460089462
Python
Python3
py
Accepted
80
7720
161
import sys from itertools import product s = [sum(l) for l in product(range(10), repeat = 4)] ns = sys.stdin.readlines() for n in ns: print(s.count(int(n)))
p00008
<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>
35 1
4 4
5,000
s939825919
p00008
u894114233
1461763061
Python
Python
py
Accepted
30
6312
261
while 1: try: ct=0 n=input() for a in xrange(10): for b in xrange(10): for c in xrange(10): if 0<=n-(a+b+c)<=9: ct+=1 print(ct) except: break
p00008
<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>
35 1
4 4
5,001