Search is not available for this dataset
name
stringlengths 2
88
| description
stringlengths 31
8.62k
| public_tests
dict | private_tests
dict | solution_type
stringclasses 2
values | programming_language
stringclasses 5
values | solution
stringlengths 1
983k
|
---|---|---|---|---|---|---|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
void test();
int interest(int debt, float interest_rate, int n);
int main(void) {
test();
return 0;
}
void test() {
int debt, n, money;
float interest_rate;
debt = 100000;
interest_rate = 1.05;
cin >> n;
debt = interest(debt, interest_rate, n);
money = debt % 1000;
if (money > 0) {
debt = debt - money + 1000;
}
cout << debt << endl;
}
int interest(int debt, float interest_rate, int n) {
if (n == 1)
return debt * interest_rate;
else
return interest(debt, interest_rate, n - 1) * interest_rate;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java |
import java.util.Scanner;
public class Main {
// /**
// * ???????????????????????????
// * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0007&lang=jp
// *
// * @param args
// */
// public static void main(String args[]) {
// Scanner in = new Scanner(System.in);
//
// System.out.println("?????±???????????????????¢????????????\?????????????????????(0<=n<=100)");
// double inputNum = in.nextDouble();
//
// // ?????????????????????????????????????????????
// System.out.println("???????????????" + getNowShakkin((int) inputNum));
// }
//
// /**
// * 1000?????§?????????????????´??°????????????????????????
// *
// * @param inputNum
// */
// public static int getKiriage1000(int inputNum) {
// int result = inputNum;//?????????????????????????????£??\??????
//
// result = (int) (Math.ceil((double) result / 10000) * 10000);// ??????1500?????´??????1.5???2.0??????1000????????????2000?????????
//
// return result;//1000??\?????????????????????????????????
// }
//
// /**
// * ??????????????????????????¨??????????????????????????????
// *
// * @param inputNum
// * @return
// */
// public static int getNowShakkin(int weekInterval) {
// int result = 100000;//????????????100000?????§????????????
// double rishi = 0.05;// ?????????5%??§????????????
//
// //????????????????????????????????????????????????
// for (int i = 0; i < weekInterval; i++) {
// result = result + (int) (result * rishi);
// }
// System.out.println(result);
// result = getKiriage1000(result);// 1000???????????????????????????
//
// return result;//??????????????????????????????????????????
// }
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
while(true){
int inputNum = in.nextInt();
System.out.println(getNowShakkin(inputNum));
}
}
public static int getNowShakkin(int weekInterval) {
double result = 100;
for (int i = 0; i < weekInterval; i++) {
result = result*1.05;
result = (Math.ceil((double) result));
}
return (int)result * 1000;
}
} |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
int main() {
int n, i, a, b, okane = 100000;
std::cin >> n;
for (i = 0; i < n; i++) {
okane = okane * 1.05;
if (okane % 1000 != 0) {
a = okane % 1000;
b = 1000 - a;
okane = okane + b;
}
}
std::cout << okane;
system("pause");
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
long int kane(int k) {
long int shakkin = 100000;
for (int i = 0; i < k; i++) {
shakkin = shakkin * 1.05;
if (shakkin % 1000 != 0) shakkin += 1000 - (shakkin % 1000);
}
return shakkin;
}
int main() {
int n;
cin >> n;
cout << kane(n) << endl;
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
double money = 100000;
for (int i = 0; i < (int)n; i++) {
money += money * 5 / 100;
money = ceil(money / pow(10, 3)) * pow(10, 3);
}
cout << money;
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int calcDebt(int debt) {
double tmp = debt * 1.05;
int result = (int)ceil(tmp);
if (result % 1000 == 0) {
return result;
} else {
return (result / 1000 + 1) * 1000;
}
}
int main(int argc, char *argv[]) {
int result = 100000;
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
result = calcDebt(result);
}
printf("%d", result);
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int n, ans = 100000;
cin >> n;
for (int i = 0; i < n; i++) {
ans = ans * 1.05;
if (ans % 1000 != 0)
;
ans = ans - ans % 1000 + 10000;
}
cout << ans << endl;
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
static float debt = 100000;
public static void main(String[] args) throws IOException {
int n;
float hell = debt;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
n = Integer.parseInt(br.readLine());
for (int i = 0; i < n; i++) {
hell += hell * 0.05;
hell += hell % 100 > 0 ? 1000 : 0;
hell = (int) hell;
}
System.out.println((int) hell);
}
} |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | import std.stdio,std.string,std.conv;
void main(){
auto debt = 10_0000;
auto week = to!int( readln().chomp() ) ;
for( ; 0<week ; week-- ){
debt *= 1.05;
debt += 1000-(debt%1000);
}
writeln(debt);
} |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.math.BigDecimal;
import java.util.Scanner;
class Main {
public static final int DEPT = 100000;
public static final BigDecimal INTEREST = new BigDecimal(0.05);
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int week = Integer.parseInt(s.next());
BigDecimal repay = new BigDecimal(DEPT);
for (int i = 1; i < week; ++i) {
repay = repay.add(repay.multiply(INTEREST));
}
s.close();
System.out.println(repay.setScale(-4, BigDecimal.ROUND_CEILING)
.toPlainString());
}
} |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | m = 100_000
gets.to_i.times do
m = m * 1.05
end
t = (m / 1000).to_i
if (t % 10) != 0
t = ((t / 10) + 1) * 10
end
p t * 1000 |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int debt = 100000;
for (int i = 0; i < n; i++) {
debt = debt * 1.05;
}
if (debt % 10000 != 0) {
cout << (debt / 10000) + 1 << "0000" << endl;
} else {
cout << debt << endl;
}
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | class Main {
/**
* @param args
*/
public static void main(String[] args) {
// コマンドライン引数から整数nを取り出す
int deptWeek = Integer.parseInt(args[0]);
// 変数宣言
double dept = 100000; // 借金
int ceilLength = 1000; // 切り上げ時の数値
// n週分、借金に5%の利子を加算(1000円未満は切り上げとする)
for (int i = 0; i < deptWeek; i++) {
dept *= 1.05;
dept = Math.ceil(dept / ceilLength) * ceilLength;
}
// 借金の残高を出力
System.out.println(String.valueOf(dept));
}
} |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <iostream>
#include <string>
using namespace std;
int main(){
int a;
a=100000;
int b;
b=0;
while(b<n){
a=a/20*21/1000*1000;
b=b+1;}
cout << a<<endl;
} |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <iostream>
int main(){
int n;
int debt = 100000;
std::cin >> n;
for(int i=0; i<n; i++){
debt = round((double)debt * 1.05);
int under = debt % 1000;
if(under==0)
else{
debt = debt - under + 1000;
}
}
std::cout << debt << std::endl;
return 0;
} |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int n;
int debt = 100000;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
debt *= 1.05;
if ((debt % 1000) != 0) {
debt /= 1000;
debt++;
debt *= 1000;
}
}
printf("%d", debt);
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python3 | import sys
import math
def main():
n = int(input().rstrip())
r = 1.05
digit = 4
a = 100000
print(math.ceil(a*r**n/10**digit)*10**digit)
if __name__ == '__main__':
main() |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
//ranker
using namespace std;
using ll = long long;
using lli = ll int;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using pii = pair<int, int>;
using pis = pair<int, string>;
using psi = pair<string, int>;
using D = double;
int main()
{
int n, sum=100000;
int i, j, k;
int tot, ans, num;
cin >> n;
for(i=0; i<n; i++){
sum += sum*(i+1)*0.05;
sum = (sum/1000+1)*1000;
}
cout << sum << endl;
return 0;
} |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
int main() {
int n;
scanf("%d", &n);
int i;
long long int total = 100000;
for (i = 0; i < n; i++) {
total = total * 1.05;
total = total / 100.0;
if (total % 10 != 0) total = total + (10 - (total % 10));
total = total * 100;
}
printf("%d\n", total);
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include<stdio.h>
int main(){
int a,b,c,d,n,z;
z=0;
scanf("%d",&n);
switch(n){
case n<=50;
for(a=0;a<10;a++){
for(b=0;b<10;b++){
for(c=0;c<10;c++){
for(d=0;d<10;d++){
if(a+b+c+d==n){
z++;
}
}
}
}
}
break;
case n>50;
break;
}
printf("%d\n",z);
return 0;
} |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <stdio.h>
int main(void)
{
int n;
int sum;
scanf("%d", &n);
sum = 100000;
while (n--){
sum += (sum / 100 * 5);
}
if (sum % 10000 > 0){
sum /= 10000;
sum *= 10000;
sum += 10000;
}
printf("%d\n", sum);
return (0); |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python2 | print 1353e4 |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main() {
int n, i;
double a = 100000;
scanf("%d", &n);
for (i = 0; i < n; i++) {
a *= 1.05;
}
a -= 999.0;
a = ceil(a / 10000.0);
a *= 10000.0;
printf("%.0lf\n", a);
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int debt = 100000;
int week;
cin >> week;
for (int i = 0; i < week; ++i) {
debt = debt * 1.05;
}
if (debt % 10000 != 0) {
debt = (debt + 9999) / 10000;
debt = debt * 10000;
cout << debt << endl;
} else {
cout << debt << endl;
}
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int roundup(double x);
int main(void) {
double debt;
int debt2;
double rishi;
int n;
int i;
debt = 100000;
rishi = 1.05;
scanf("%d", &n);
for (i = 0; i < n; i++) {
debt = debt * rishi;
}
debt2 = roundup(debt / 1000);
debt2 *= 1000;
printf("%d\n", debt2);
return 0;
}
int roundup(double x) {
int y;
x += 0.9;
y = (int)x;
return y;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | /* Volume0-0007(借金地獄) */
import java.io.*;
import java.util.*;
public class Main {
public static void main (String[] args) throws java.lang.Exception {
// 入力された値をゲット
Scanner sc = new Scanner(System.in);
double n = sc.nextInt(); // 1個目をxにセット
double kane = 100000; // 借金を開始
for(int i=0; i<n; i++) {
// n週間後の利息
kane = kane + (kane * 0.05);
}
int total = (int)kane;
// 1000円未満を切り上げて出力
System.out.println(Math.round((double)total / 10000) * 10000);
}
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
double d = 100000;
cin >> n;
for (int i = 0; i < n; i++) {
d *= 1.05 / 1000;
if (d - floor(d) > 0.0001) {
d = ceil(d) * 1000;
} else
d *= 1000;
}
cout << d << endl;
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
double debt = 100000;
cin >> n;
for (int i = 0; i < n; i++) {
debt = ceil(debt * 1.05 / 1000) * 1000;
}
cout << debt << endl;
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int input;
int i;
int kingaku = 100000;
float input_5;
scanf("%d", &input);
input_5 = 5000;
for (i = 0; i <= input; i++) {
kingaku += input_5;
}
printf("%d\n", kingaku);
return (0);
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
int main() {
int nWeeksLater;
std::cin >> nWeeksLater;
const int first = 100000;
int interest = first * 0.05;
int loan;
for (int i = 0; i < nWeeksLater; i++) loan = first + interest * nWeeksLater;
int a = loan / 10000;
loan = loan % 10000 >= 5000 ? (a + 1) * 10000 : a * 10000;
std::cout << loan << std::endl;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
int main(int argc, char const *argv[]) {
int n;
scanf("%d", &n);
double x = 10;
for (int i = 0; i < n; i++) x = x + x * 0.05;
int ans = x + 0.5;
printf("%d\n", ans * 10000);
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
int main() {
int n, i;
double debt = 10000;
scanf("%d", &n);
while (n--) {
debt += debt * 0.05;
for (i = 10; i < 1000; i *= 10) {
if (n % i != 0) {
debt += 1000;
break;
}
}
}
printf("%lf\n", debt);
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python2 | import math
base = 100000
r = base * 0.05
n = int(raw_input())
if n <= 100:
q = int(math.ceil((r * n) / 1000))
print "{}".format(base + (q * 1000)) |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int week, a, b, ans, aans;
cin >> week;
a = 100000 * 0.05;
b = week + 1;
a *= b;
ans = 100000 + a;
aans = ans / 1000;
aans = ans * 1000;
if (aans != ans) aans + 100;
cout << aans << endl;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | main(i){i=puts("13530000")&1;} |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include<iostream>
//#include<algorithm>
//#include<cmath>
//#include<string>
//#include<cctype>
//#include <vector>
using namespace std;
int main(){
int a=100,n;
cin >> n;
while (n--) a = ceil(a*1.05);
cout << a * 1000 << endl;
return 0;
} |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int n;
cin >> n;
int total = 100000;
for (int i = 0; i < n; i++) {
total = total * 5 / 100 + total;
}
if (total % 10000 > 0) {
total = total / 10000 * 10000 + 10000;
}
cout << total << endl;
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python2 | # -*-coding:utf-8
#???????¨????
import math
def main():
debtTime = int(input())
ans = int(culcDebt(debtTime))
print(ans)
def culcDebt(t):
debt = 100000
for i in range(t):
print('debt = {0}'.format(debt))
debt = debt * 1.05
debt = 1000 * math.ceil(debt/1000)
return debt
if __name__ == '__main__':
main() |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
double roundup(double x);
int main(void) {
double debt;
int debt2;
double rishi;
int n;
int i;
debt = 100000;
rishi = 1.05;
scanf("%d", &n);
for (i = 0; i < n; i++) {
debt = debt * rishi;
printf("case%d : debt=%f ", i, debt);
debt = roundup(debt / 1000);
debt *= 1000;
printf(": debt=%f\n", debt);
}
debt2 = (int)debt;
printf("%d\n", debt2);
return 0;
}
double roundup(double x) {
double y;
x += 0.9;
y = (int)x;
return y;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
bool bo = false;
int n, a = 100000;
cin >> n;
for (int i = 0; i < n; i++) {
a += a * 0.05;
}
if (a % 10000 == 0 && a % 1000 == 0 && a % 100 == 0 && a % 10 == 0) {
bo = true;
}
a /= 10000;
if (bo == false) {
a = a + 1;
}
cout << a * 10000 << endl;
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | public class Main {
public static void main(String[] args) {
}
/**
* index番目のグループの到着時刻を返却する(正午からの経過時間)
* 単位:分
* @param index
* @return 到着時刻
*/
private static int getArriveTime(int index) {
return index * 5;
}
/**
* index番目のグループの人数を返却する
* 単位:人
* @param index
* @return 人数
*/
private static int getNums(int index) {
return((index % 5 == 1) ? 5 : 2);
}
/**
* index番目のグループの所要時間を返却する
* 単位:分
* @param index
* @return 所要時間
*/
private static int getEatingTime(int index) {
return 17 * (index % 2) + 3 * (index % 3) + 19;
}
private static boolean checkSheet(int[] sheets, int index, int custmors) {
boolean canSit = true;
for (int i = 0; i < sheets.length; i++) {
for (int j = i; j < custmors; j++) {
if (j + custmors <= sheets.length) {
if (sheets[j] != 100) {
canSit = false;
}
}
}
if (canSit) {
for (int j = i; j < custmors; j++) {
sheets[j] = index;
}
}
}
return canSit;
}
} |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
double debt = 100000.0;
int N;
cin >> N;
for (; N > 0; N--) {
debt *= 1.05;
debt /= 1000;
debt = ceill(debt);
debt *= 1000;
}
cout << debt << endl;
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int debt = 100000;
int week;
cin >> week;
for (int i = 0; i < week; ++i) {
debt *= 1.05;
}
if (debt % 10000 != 0) {
debt = (debt + 9999) / 10000;
debt = debt * 10000;
}
cout << debt << endl;
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main() {
double n, money = 100000, i, j;
scanf("%lf", &n);
for (i = 0; i < n; i++) {
money = (money * 1.05);
if (fmod(money, 1000) != 0) {
money = money - fmod(money, 1000) + 1000;
}
}
printf("%f\n", money);
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int a = 100000;
int x, y, i;
scanf("%d", &x);
for (i = 0; i < x; i++) {
a = a * 1.05;
if (a % 100 != 0) {
a = a / 1000;
a = (a + 1) * 1000;
}
}
printf("%d\n", a);
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int n;
double debt = 100000.0;
scanf("%d", &n);
for (; n > 0; n--) debt += debt * 0.05;
printf("%.0f", ceil(debt / 1000) * 1000);
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python3 | print(int(round(100000 * (1.05 ** int(input())), -4)), end='\n')
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
int main() {
int money = 100000;
int remain;
int weeks;
int i;
scanf("%d", &weeks);
for (i = 0; i < weeks; i++) {
money *= 1.05;
remain = money % 1000;
money += 1000 - remain;
}
printf("%d", money);
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int n, m, i;
scanf("%d", &n);
m = 100000;
for (i = 0; i < n; i++) {
m *= 1.05;
if (m % 1000 != 0) {
m = m - m % 1000 + 1000;
}
}
printf("%d\n", m);
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int n, debt, i, amari, real;
scanf("%d", &n);
debt = 100000;
for (i = 0; i < n; i++) {
debt = debt * 1.05;
}
amari = debt % 10000;
if (amari != 0) {
real = debt - amari + 10000;
printf("%d\n", real);
} else {
printf("%d\n", debt);
}
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main() {
int n, i, r = 100000;
scanf("%d", &n);
for (i = 0; i < n; i++) {
r = r * 1.05;
}
if (r % 1000 >= 1 && r % 1000 <= 999) {
r = r + 10000 - r % 10000;
}
printf("%d\n", r);
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <iostream>
using namespace std;
int main(){
int n;
cin>>n;
int temp = 0,k;
for(int i = 0; i < n; i++){
k = (int)(sum * 0.05) % 1000;
if(k != 0)
temp = 1000;
else
temp = 0;
sum += sum * 0.05 + temp - k;
}
cout<<sum<<endl;
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int n, i, a, temp;
a = 100000;
scanf("%d", &n);
for (i = 1; i <= n; ++i) {
a = a * 1.05;
temp = a % 1000;
a = a - temp + 1000;
}
printf("%d", a);
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int m;
cin >> m;
int n = 100000;
for (int i = 0; i < m; i++) {
n = n * 1.05;
if (n % 1000 > 0) n = n / 1000 * 1000 + 1000;
}
cout << n;
cin >> n;
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <stdio.h>
#include <math.h>
int main(void)
{
int n;
double y;
???scanf(%f,&n);
printf(pow(100000??? y));
}
return 0;
} |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python2 | print 1353000 |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | i,a=1e5;main(N){scanf("%d",&N);for(;i<N;i++)a*=1.05,a+=(a%1000)?1e3-a%1000:0;N=!printf("%d\n",a);} |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, debt = 100000;
cin >> n;
for (int i = 0; i < n; i++) {
debt *= 1.05;
if (debt % 1000 != 0) debt = (debt / 1000 + 1) * 1000;
}
cout << debt;
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python2 | import math
base = 100000
r = 0.05
try:
while True:
n = int(raw_input())
except EOFError:
pass
if n <= 100:
for i in range(1, n+1):
base = base + (base * r)
now = int(math.ceil(base / 1000))
print "{}".format(now * 1000) |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int size(string x) {
string::size_type size = x.size();
return size;
}
double pi() { return M_PI; }
int main() {
int n;
double ss = 100000;
cin >> n;
for (int i = 0; i < n; i++) {
ss = ss * 1.05;
if ((int)ss % 1000 != 0) ss = (int)(ss / 1000) * 1000 + 1000;
}
cout << ss << endl;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int loan = 100000;
int week;
cin >> week;
for (int i = 0; i < week; i++) {
loan *= 1.05;
}
double tmp = (double)loan / 10000;
tmp += 0.5;
loan = (int)tmp;
loan *= 10000;
cout << loan << endl;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main() {
int skin = 100000;
int skin2;
int shu;
int i;
scanf("%d", &shu);
for (i = 0; shu > i; i++) {
skin = skin * 1.05;
}
if (skin % 1000 != 0) {
skin2 = skin % 1000;
skin = skin - skin2 + 1000;
}
printf("%d\n", skin);
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int i, n;
double r = 0, m = 100000;
scanf("%d", &n);
for (i = 0; i != n; i++) {
m += m * 0.05;
r = floor(m * 0.001) * 1000;
if (m != r) {
m = r;
m += 1000;
}
}
printf("%.0f\n", m);
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
template <class T>
inline void chmax(T& a, T b) {
if (b > a) a = b;
}
template <class T>
inline void chmin(T& a, T b) {
if (b < a) a = b;
}
int main() {
int N;
float money = 100000;
cin >> N;
for (int i = 0; i < (int)(N); i++) {
money = (money + money * 0.05);
}
float m = money / 10000;
cout << (int)ceil(m) * 10000 << endl;
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int i,j,n;
__int64 ans=100000;
int main(){
scanf("%d",&n);
for(i=0;i<n;i++){
ans*=1.05;
if(ans%1000!=0)ans=(ans/1000+1)*1000;
}
printf("%lld\n",ans);
return 0;
} |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include<stdio.h>
main(void){
int money = 100000, num;
double moneyDouble;
scanf("%d", &num);
for( ; num >= 0; num--){
money = money + 100000 * 0.05;
}
moneyDouble = money / 10000;
money = (moneyDouble + 0.9);
money = money * 10000;
printf("%d", money);
return 0;
} |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
double money = 100000;
int i;
int main() {
cin >> i;
for (i; i > 0; --i) {
money *= 1.05;
money = (long)(money / 100 + 0.9) * 100;
}
printf("%.0lf\n", money);
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main() {
int n, i, x = 100000;
double y;
scanf("%d", &n);
for (i = 0; i < n; i++) {
x = x * 1.05;
y = x;
y = y / 1000;
y = y + 0.9;
x = y;
x = x * 1000;
}
printf("%d\n", x);
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
double d = 100000;
cin >> n;
for (int i = 0; i < n; i++) {
d *= 1.05 / 1000;
if (d - floor(d) > 0.00001) {
d = ceil(d) * 1000;
} else
d *= 1000;
}
cout << d << endl;
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main() {
int i, n;
double x = 100000;
scanf("%d", &n);
for (i = 1; i <= n; i++) {
x = x * 1.05;
if ((int)x % 1000 != 0) {
x = 1000 * floor(x / 1000 + 1);
}
}
i = (int)x;
printf("%d\n", i);
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
stack<int> st;
bool bo = false;
int n, a = 10000;
cin >> n;
for (int i = 0; i < n; i++) {
a += a * 0.05;
}
if (a % 100 == 0 && a % 10 == 0 && a % 10 == 0) {
bo = true;
}
cout << a << endl;
a /= 1000;
if (bo == true) {
} else if (bo == false) {
a = a + 1;
}
cout << a * 1000 << endl;
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <iostream>
using namespace std;
int main() {
// your code goes here
int n,ans;
ans = 100000;
cin >> n;
for (int i=0;i<n;i++) {
ans = ans * 1.05;
if (ans%1000!=0)ans=ans + ans%1000
}
cout << ans;
return 0;
} |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python3 | import sys
for line in sys.stdin:
N = int(line.rstrip())
print(len([[i0,i1,i2,i3] for i0 in range(10) for i1 in range(10) for i2 in range(10) for i3 in range(10) if sum([i0,i1,i2,i3]) == N])) |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main() {
unsigned int s = 100000, temp;
int n, i;
scanf("%d", &n);
for (i = 0; i < n; i++) {
s = s * 105 / 100;
if (s % 1000 != 0) {
temp = s / 1000;
s = (temp + 1) * 1000;
}
}
printf("%d", s);
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int m = 100000, i, w;
scanf("%d", &w);
for (i = 0; i < w; i++) {
m *= 21;
m /= 20;
if ((m % 1000) != 0) {
m / 1000;
m *= 1000;
m += 1000;
}
}
printf("%d\n", m);
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[]args)throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String str=br.readLine();
int weeks=Integer.parseInt(str);
long debt=(long) (100000*Math.pow(1.05, weeks));
long debtRound=(debt/100)*100;
System.out.println(debtRound);
}
} |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
int main() {
int loan = 100000;
int hoge = loan * 0.05;
int n;
std::cin >> n;
for (int i = 0; i < n; i++) loan += hoge;
if (loan % 10000 < 5000)
loan = loan / 10000 * 10000;
else
loan = loan / 10000 * 10000 + 10000;
std::cout << loan << std::endl;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
int main() {
int weeks, debt = 100000;
std::cin >> weeks;
for (int i = 0; i < weeks; i++) {
debt *= 1.05;
debt = ceil(debt / 1000.0) * 1000;
std::cout << debt << std::endl;
}
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
int age(int t) { return ceil((double)t / 10000) * 10000; }
int main() {
int n;
std::cin >> n;
int loan = 100000;
loan += loan * 0.05 * n;
std::cout << age(loan);
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
static float debt = 100000;
public static void main(String[] args) throws IOException {
int n;
float hell = debt;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
n = Integer.parseInt(br.readLine());
for (int i = 1; i <= n; i++) {
hell += debt * 0.05F;
}
System.out.println((int) hell + (hell % 100 > 0 ? 1000 : 0));
}
} |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | /* Volume0-0007(借金地獄) */
import java.io.*;
import java.util.*;
public class Main {
public static void main (String[] args) throws java.lang.Exception {
// 入力された値をゲット
Scanner sc = new Scanner(System.in);
double n = sc.nextInt(); // 1個目をxにセット
double kane = 100000; // 借金を開始
for(int i=0; i<n; i++) {
// n週間後の利息
kane = kane + (kane * 0.05);
// 1000円未満を切り上げて出力
kane = (Math.round((double)kane / 1000)) * 1000;
}
int total = (int)kane;
System.out.println(total);
}
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int advance_n(int ans, int n) {
cout << "ans % int(pow(10,n+2)))10=" << ans % int(pow(10, n)) << endl;
cout << "pow(10,n+2)=" << pow(10, n + 2) << endl;
cout << "(ans - ans % int(pow(10,n+2)))=" << (ans - ans % int(pow(10, n + 2)))
<< endl;
return (ans - ans % int(pow(10, n)) +
(ans % int(pow(10, n + 2)) != 0) * int(pow(10, n)));
}
int how_much_debt(int n) {
if (n == 0)
return 100000;
else
return 1.05 * how_much_debt(n - 1);
}
int main() {
int a;
cin >> a;
cout << advance_n(how_much_debt(a), 3) << endl;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python3 | def next_week(x):
return ((x * 1.05) // 1000 + 1) * 1000
def week_after(x, n):
for _ in range(n):
x = next_week(x)
return x
if __name__ == '__main__':
n = int(input())
print(week_after(100000, n))
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
int main() {
int n, debt;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
debt = debt + debt * 0.05;
}
printf("%d\n", debt);
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
double debt = 100.000;
cin >> n;
for (int i = 0; i < n; i++) {
debt *= 1.05;
debt = (int)debt + 0.999;
}
debt *= 1000;
cout << debt << endl;
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
int main() {
int loan = 100000;
int hoge = loan * 0.05;
int n;
std::cin >> n;
for (int i = 0; i < n; i++) loan += hoge;
if (loan % 10000 < 5000)
loan = loan / 10000 * 1000;
else
loan = loan / 10000 * 10000 + 10000;
std::cout << loan << std::endl;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include<stdio.h>
main(void){
int money = 100000, num;
scanf("%d", &num);
for( ; num >= 0; num--){
money += money * 0.05;
}
printf("%d\n", (money/10000)*10000);
return 0;
} |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | main(n,d){for(d=scanf("%d",&n)+99;n-=1;d=ceil(d*1.05));printf("%d\n",d*1000);} |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int a, b = 100000, i;
scanf("%d", &a);
for (i = 1; i <= a; i++) {
b = b * 1.05;
}
if (b % 10000 != 0) {
b = b / 10000;
b = b + 1;
b = b * 10000;
}
printf("%d", b);
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
int main() {
int n;
std::cin >> n;
double result = 100;
for (int i = n; i; i--) {
result *= 1.05;
result = (int)(result + 0.9);
}
result *= 1000;
std::cout << (int)result << std::endl;
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
long debt = 100000;
double interest = 0.05;
int n, i;
scanf("%d", &n);
for (i = 1; i <= n; i++) {
debt = debt * (1 + 0.05);
if (debt % 1000 > 0) {
debt = (debt - (debt % 1000)) + 1000;
}
}
printf("%ld\n", debt);
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int week;
cin >> week;
double money = 10;
for (int i = 0; i < week; i++) {
money = money * 1.05;
}
printf("%d\n", int(money + 0.999) * 10000);
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int input;
int i;
int kingaku = 100000;
scanf("%d", &input);
for (i = 0; i <= input; i++) {
kingaku += 5000;
}
printf("%d\n", kingaku);
return (0);
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int n, i, m = 100000;
scanf("%d", &n);
for (i = 1; i <= n; i++) {
m = m * 1.05;
m = (m / 1000 + 1) * 1000;
}
printf("%d", m);
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <stdio.h>
int main() {
long long weeks = 0;
double money = 100.0d;
scanf("%d", &weeks);
for (long long i = 0; i < weeks; ++i) {
money *= 1.05d;
}
long long result = (int) money;
if (result < money) {
result += 1;
}
result *= 1000;
printf("%d", result);
return 0;
} |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main() {
int i;
int n;
int kei;
scanf("%d", &n);
if (n > 100 && n < 0) {
return 0;
}
kei = 100000;
for (i = 0; i < n; i++) {
kei = 1.05 * kei;
}
printf("%d\n", kei - kei % 10000 + 10000);
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <stdio.h>
int main( void ) {
int n, debt = 100000;
for ( scanf( "%d", &n ); n--; debt = ( (int)( debt * 1.05 - 1 ) / 1000 + 1 ) * 1000; ) ;
printf( "%d\n", debt );
return 0;
} |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, b;
int money = 100000;
cin >> n;
for (int i = 0; i < n; i++) {
money *= 1.05;
if (b % 1000 != 0) b = (b / 1000 + 1) * 1000;
}
cout << money << endl;
return 0;
}
|
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python3 | #! /usr/bin/python3
m=100
for _ in range(int(input())):
m = int(m*1.05+0.9)
print(m*1000) |
p00007 Debt Hell | 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.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python2 | n = input();
ans = 100000;
for i in range(n):
ans *= 1.05
ans += 999;
ans /= 1000;
ans *= 1000;
print ans |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.