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;
int main() {
double money = 100000;
int n;
cin >> n;
for (int i = 0; i < n; i++) {
money = (double)money * 1.05;
int up = money / 1000;
if ((int)(money - up) > 0) {
money = (up + 1) * 1000;
} else {
money = up * 1000;
}
}
int m = (int)money;
cout << m << 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, s = 100000;
cin >> n;
for (int i = 0; i < n; i++) {
s *= 0.05;
if (s % 1000 != 0) {
s /= 1000;
s *= 1000;
s += 1000;
}
}
cout << s << 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 | import math
a=100000
n=int(input())
for i in range(n):
a=(a+0.05*a)
print(math.ceil(a/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 | UNKNOWN | n = gets.to_i
money = 100000
n.times do |i|
money *= 1.05
money = money.to_i
end
money = money.to_s
money = money.split("")
if money[-1] != "0" or money[-2] != 0 or money[-3] != "0" or money[-4] != "0"
for i in 1..4 do
money[-i] = "0"
end
money[-5] = money[-5].to_i
money[-5] += 1
money[-5] = money[-5].to_s
end
money = money.join("")
money = money.to_i
puts 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 | cpp | #include <bits/stdc++.h>
int main() {
double m = 100;
int n;
std::cin >> n;
for (int i = 0; i < n; ++i) {
m *= 1.05;
m = std::ceil(m);
}
std::cout << m * 1000 << 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>
using namespace std;
inline int ceil(double x, double base) { return ceil(x / base) * base; }
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n;
cin >> n;
cout << ceil(100000.0 * pow(1.05, n), 1000.0) << "\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 | cpp | #include <bits/stdc++.h>
using namespace std;
double calcDebt(double debt) {
debt = debt * 1.05;
debt = ceil(debt / 1000) * 1000;
return debt;
}
int main() {
int n;
double debt = 100000;
cin >> n;
for (int c = 0; c < n; c++) debt = calcDebt(debt);
cout << debt << endl;
return EXIT_SUCCESS;
}
|
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.*;
public class Main{
private static final Scanner scan = new Scanner(System.in);
public static void main(String[] args){
int n = scan.nextInt();
long mon = 100_000;
for(int i = 0; i < n; i++){
mon = Math.ceil(mon * 1.05 / 1000) * 1000;
}
System.out.printf("%d\n", mon);
}
} |
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() {
long long int n, i, out;
long double price = 100000;
cin >> n;
for (i = 0; i < n; i++) {
price += price * 0.05;
}
price = ceil(price / 10000);
out = (int)price * 10000;
cout << out;
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;
import java.math.BigDecimal;
/**
* 借金を計算する機能
*
* @author kohei.nitta
*
*/
class Debt_hell {
/**
* 標準入力から値を受け取り、n週間後の借金の残高を出力する。
*
* @param args
* @return
* @throws IOException
*/
public static void main(String[] args) throws IOException {
BigDecimal debt = new BigDecimal("100000");
BigDecimal interest = new BigDecimal("1.05");
BigDecimal roundUp = new BigDecimal("1000");
BufferedReader input = new BufferedReader(new InputStreamReader(
System.in));
int inputNo = Integer.parseInt(input.readLine());
for (int i = 1; i <= inputNo; i++) {
debt = debt.multiply(interest)
.divide(roundUp, 0, BigDecimal.ROUND_UP).multiply(roundUp);
}
System.out.println(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 | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int n;
int a = 100000;
scanf("%d", &n);
for (; n > 1; n--) {
a *= 1.05;
}
printf("%d\n", ((a + 9999) / 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 <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", 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 | d=100;main(n){for(scanf("%d",&n);n--;d=-~d*1.05);d=!printf("%.f\n",d*1e3);} |
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 math
n = int(input())
print(n)
money = int(100)
for i in range(n):
money *= 1.05
money = math.ceil(money)
print(int(money) * 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 lend = 100000;
for (int i = 1; i <= n; i++) {
lend = (lend * 1.05 - 1) / 1000;
lend = (lend + 1) * 1000;
}
cout << lend;
}
|
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 | debt = 100
for i in range(int(input())):
debt *= 1.05
print(int(debt) * 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 | java | import java.util.Scanner;
import java.math.BigDecimal;
import java.math.RoundingMode;
class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int w=sc.nextInt();
int a=100000;
for(int i=0;i<w;i++){
a=a*1.05;
double b=a/1000;
BigDecimal x=new BigDecimal(b);
x=x.setScale(0,RoundingMode.CEILING);
a=x.intValue()*1000;
}
System.out.println(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 | python3 | import math
for i in range(int(input(n))):
n = math.ceil((n*1.05)/1000)*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() {
int n;
int i;
double money = 100000.0;
double a;
scanf("%d", &n);
for (i = 1; i <= n; i++) money = money * 1.05;
if ((int)money % 10000 != 0) {
a = (int)money % 10000;
money /= 10000;
money += 1;
money *= 10000;
money -= a;
}
printf("%d\n", (int)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 i, n, m = 100000;
scanf("%d", &n);
for (i = 0; i < n; i++) {
m *= 1.05;
}
printf("%d", m % 1000 ? m - m % 1000 + 10000 : m);
return EXIT_SUCCESS;
}
|
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;
const int64_t INF = INT64_MAX;
void init() {
cin.tie(0);
ios::sync_with_stdio(false);
}
int64_t solve(int n) {
int64_t dept = 100000;
for (int i = 0; i < n; i++) {
dept = (int)(dept * 1.07);
if (dept % 1000 != 0) {
dept += (1000 - dept % 1000);
}
}
return dept;
}
int main() {
init();
int64_t n;
cin >> n;
cout << solve(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 | 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);
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 / 1000) * 1000);
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);
}
result = getKiriage1000(result);// 1000?????\?????????????????????
return result;//??????????????????????????????????????????
}
} |
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 | #!/usr/local/bin/ruby
n=gets.to_i
x=100000
n.times{
x=x+x*0.05
if x%1000!=0
x=x+1000
end
}
puts"#{x}" |
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, i, w, h;
double x, y, z;
cin >> n;
x = 100000;
for (i = 1; i <= n; i++) {
x = x * 1.05;
w = x;
x = w / 100;
x = x / 10;
x = ceil(x);
x = x * 1000;
}
y = x;
cout << y << 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 | java | import java.io.BufferedReader;
import java.io.InputStreamReader
class Main{
public static void main(String[] a) {
String line = "";
try {
BufferedReader stdReader =
new BufferedReader(new InputStreamReader(System.in));
line = stdReader.readLine();
stdReader.close();
} catch (Exception e) {
e.getStackTrace();
System.exit(-1); // ????????°???????????????
}
// TODO ?????????????????????????????????????????????
int debt = 100000;
int n = 0;
n = Integer.parseInt(line);
for(int i=0;i<n;i++){
debt = interest(debt);
}
System.out.println(debt);
}
public static int interest(int n){
double added;
added = n * 1.05;
added = 1000*Math.ceil(added/1000);
return (int)added;
}
} |
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;
float b = 100000;
cin >> n;
for (int i = 0; i < n; i++) {
b *= 1.05;
b = (int)((b + 999) * 0.001);
b *= 1000;
}
cout << b << 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 | import java.util.Scanner;
public class Main
{
public static void main(String arg[])
{
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int de = 100000;
for(int i=0; i<n; i++)
{
de = de / 100;
de = de * 105;
if(de%1000 != 0)
de += 1000;
de = de/1000;
de = de*1000;
}
System.out.println(de);
}
} |
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 | File Edit Options Buffers Tools Ruby Help
n = gets.chomp.to_i
money = 100000
n.times do
money = money * 1.05
if money % 1000 > 0
money = money.ceil(-3)
end
end
puts 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 | cpp | #include <iostream>
#include <vector>
#include <math.h>
#include <string>
#include <windows.h>
int main(void);
int kiriage(int num);
int main(){
int n; //n週
int debut = 100000; //借金
std::cin >> n;
for (int i = 0; i < n; i++)
{
debut *= 1.05;
std::string str_debut = std::to_string(debut);
if ((str_debut[str_debut.length() - 1] == '0') &&
(str_debut[str_debut.length() - 2] == '0') &&
(str_debut[str_debut.length() - 3] == '0')
){
;
}
else{
debut = kiriage(debut);
}
}
std::cout << debut << std::endl;
//while (1);
return 0;
}
//1000円未満を切り上げる関数
int kiriage(int num){
num = num / 1000 * 1000 + 1000;
return num;
}
|
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() {
double num = 100000;
int i, n, sum = 0;
scanf("%d", &n);
for (i = 0; i < n; i++) {
num = (double)num * 1.05;
}
num = (double)num / 10000;
sum = num + 0.9999;
sum = 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 | java | 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 = 0; i < week; ++i) {
repay = repay.add(repay.multiply(INTEREST));
}
s.close();
System.out.println(repay.divide(new BigDecimal(10000), 0,
BigDecimal.ROUND_CEILING).multiply(new BigDecimal(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 | java | import java.util.*;
import java.util.stream.Collectors;
import static java.lang.System.*;
public class Main extends CodingSupport {
protected void solve() {
int input = scanInt();
double dept = 100000.0;
for( int i = 0; i < input ; i++ ) {
dept = dept * 1.05;
if(dept % 1000 != 0 ) {
dept -= dept % 1000;
dept += 1000;
}
}
print(dept);
}
}
abstract class CodingSupport {
protected Scanner sc;
protected CodingSupport() {
sc = new Scanner(in);
}
public static void main(String[] args) throws Exception {
new Main().solve();
}
protected abstract void solve();
protected void print(Object o) {
out.println(o);
}
protected Double[] scanDoubles() {
return
Arrays
.stream(scanInts())
.map(Integer::doubleValue)
.toArray(Double[]::new);
}
protected Integer[] scanInts() {
return strArrayToIntArray(sc.nextLine().split(" "));
}
protected String[] scanLineToTokens(String delimiter) {
return sc.nextLine().split(delimiter);
}
protected int scanInt() {
return sc.nextInt();
}
protected List<Integer> strArrayToIntList(String[] strArray) {
List<Integer> intList =
Arrays
.stream(strArray)
.map(Integer::valueOf)
.collect(Collectors.toList());
return intList;
}
protected Integer[] strArrayToIntArray(String[] strArray) {
Integer[] intArray =
Arrays
.stream(strArray)
.map(Integer::valueOf)
.toArray(Integer[]::new);
return intArray;
}
}
|
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 % 1000 < 500)
loan = loan / 1000 * 1000;
else
loan = loan / 1000 * 1000 + 1000;
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>
using namespace std;
int main() {
int n, debt = 100000;
cin >> n;
for (int i = 0; i < n; i++) {
debt *= 1.05;
}
if (debt % 10000 != 0) {
debt = (debt - (debt % 10000)) + 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 | java | import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int week = scan.nextInt();
double kinri = Math.pow(1.05, week);
double debt = 10000 * Math.ceil(10*kinri);
int ans = (int)debt;
System.out.println(ans);
}
} |
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 | #Write the program you'd like to run below.
import math
week = int(input())
debt = float(100000)
for i in range(week):
debt = debt * 1.05
maru = math.ceil(debt / 10000)
ans = int(maru * 10000)
print(ans) |
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 i, j;
double risi = 0;
double sum;
scanf("%d", &n);
for (i = 0; i < n; i++) {
risi = risi + 100000 * 0.05;
}
if (risi / 1000 < 1000) {
risi += 1000;
}
sum = 100000 + risi;
n = sum;
printf("%d\n", 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>
int main(void) {
int a,c,i;
int b;
scanf_s("%d", &a);
b = 100000;
for (i = 0; i < a; i++) {
b = b * 1.05;
}
c = b % 10000;
if (c!=0) {
b = b + 10000-c;
}
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 | UNKNOWN | package main
import "fmt"
var (
dept int = 100000
addDept int = dept / 100 * 5
)
func main() {
var week int
fmt.Scan(&week)
nWeekDept := dept + addDept*week
if nWeekDept/addDept%2 != 0 {
nWeekDept += addDept
}
fmt.Println(nWeekDept)
}
|
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, interest;
int debt = 100000;
double temp1;
int temp2;
scanf("%d", &n);
for (i = 1; i <= n; i++) {
temp1 = 0.05 * debt / 1000.0;
temp2 = 0.05 * debt / 1000.0;
if (temp1 > temp2) temp2 = temp2 + 1;
interest = temp2 * 1000;
debt = debt + interest;
}
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 | cpp | #include <bits/stdc++.h>
using namespace std;
int roundUp(int x, int index);
int main(void) {
int i;
int n;
double intrst;
int debt;
cin >> n;
debt = 100000;
intrst = 0.05;
for (i = 0; i < n; i++) {
debt *= 1.0 + intrst;
}
debt = roundUp(debt, 4);
cout << debt << endl;
return 0;
}
int roundUp(int x, int index) {
int exp10;
exp10 = pow(10, index - 1);
x += exp10 - exp10 / 10;
x /= exp10;
x *= exp10;
return x;
}
|
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 money = 100000;
void up() {
int judge = money % 10000;
if (judge >= 1) {
money -= judge;
money += 10000;
}
}
int main(void) {
int n;
cin >> n;
for (int r = 0; r < n; r++) {
money *= 1.05;
}
up();
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 | cpp | #include <bits/stdc++.h>
using namespace std;
inline int ceil(double x, double base) { return ceil(x / base) * base; }
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n;
cin >> n;
double ret = 100000;
while (n--) {
ret = ceil(ret * 1.05, 1000);
}
cout << ret << 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() {
double money = 100000;
int n;
cin >> n;
for (int i = 0; i < n; i++) {
money *= 1.05;
money /= 1000;
money = ceil(money);
money *= 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 | java | package volume0_0007;
import java.math.BigDecimal;
class Debt_hell {
public static void main(String[] args) {
BigDecimal debt = new BigDecimal("100000");
BigDecimal interest = new BigDecimal("1.05");
for (int i = 1; i <= Integer.parseInt(args[0]); i++) {
debt = calcDebt(debt, interest);
}
System.out.println(debt);
}
private static BigDecimal calcDebt(BigDecimal debt, BigDecimal interest) {
BigDecimal roundUp = new BigDecimal("1000");
return debt.multiply(interest).divide(roundUp, 0, BigDecimal.ROUND_UP)
.multiply(roundUp);
}
} |
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 | p=100000;main(a){for(scanf("%d",&a);a--;p=(p/1000+!!(p%1000))*1000)p+=p/20;return !printf("%d",p);} |
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 = 0, awia = 100;
scanf("%d", &n);
while (--n >= 0) {
awia += awia * 0.05 + 0.9;
}
printf("%d\n", awia * 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 | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int money = 100000;
int i, n;
scanf("%d", &n);
for (i = 0; i < n; i++) {
money += (money * 0.05);
}
money = (money + 5000) / 10000 * 10000;
printf("%d\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 | cpp | #include <bits/stdc++.h>
using namespace std;
const double interest = 0.05;
const double roundYen = 1000.0;
int weeklyAdd(double debt) {
debt = debt * (1 + interest);
debt = ceil(debt / roundYen) * roundYen;
return debt;
}
int main(int argc, char const *argv[]) {
int week;
std::cin >> week;
double debt = 100000;
for (size_t i = 0; i < week; i++) {
debt = weeklyAdd(debt);
}
std::cout << debt << '\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 <bits/stdc++.h>
int kiriage(double x) { return (int)(x < 0.0 ? x : x + 0.9); }
int main() {
int i, n;
double sum = 100;
scanf("%d", &n);
for (i = 0; i < n; i++) {
sum = kiriage(sum * 1.05);
}
printf("%d\n", ((int)sum) * 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 | cpp | #include <iostream>
using namespace std;
int main()
{
int n,a = 100000;
cin >> n;
for(int i=0;i<=n;i++)
{
a *= 1.05;
if(a%1000)
a += 1000-cur%1000;
}
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>
using namespace std;
int main(){
int n;
cin >> m;
n = 100000;
for(int i=0;i<m;i++){
n = n * 1.05;
}
if(n%1000 > 0)
{
n = n/1000*1000+1000;
}
cout << 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 <bits/stdc++.h>
int main(void) {
int n, i;
int money = 100000;
scanf("%d", &n);
for (i = 0; i < n; i++) {
money = money * 1.05;
}
{
money = money / 1000;
money = money + 1;
money = money * 1000;
printf("%d\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 i, n;
double debt = 100000;
scanf("%d", &n);
for (i = 0; i < n; i++) {
debt *= 1.05;
if (debt / 1000 > (int)debt / 1000) debt = ((int)debt / 1000 + 1) * 1000;
}
printf("%.0f", 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 | using System;
namespace _0007
{
class Program
{
static void Main(string[] args)
{
float A = 100000;
Int32 a = int.Parse(Console.ReadLine());
for (int i = 0; i < a; i++)
{
A = A * (float)1.05;
}
if (A % 1000 == 0) { Console.WriteLine(A); }
else
{
Console.WriteLine((((int)A / 1000)+1) * 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 | var input = require("fs").readFileSync("/dev/stdin","utf8");
var debt = 100000;
var interest = 5;
calculateDebt(debt, weeks, interest);
function calculateDebt(debt, interest, weeks){
for (i = 0; i < 5; i++) {
debt = debt * 1.05;
debt = Math.ceil(debt/1000)*1000;
}
console.log(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 n = 0;
int debt = 100000;
cin >> n;
for (int i = 0; i < n; i++) {
debt = debt * 105 / 100;
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 | cpp | #include <iostream>
int main(){
int n,debt=100000;
for(int i=0;i<(std::cin>>n);i++) debt*=1.05;
std::cout<<(debt%1000 ? debt/1000*1000+1000 : debt)<<'\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 <bits/stdc++.h>
int main(void) {
int n;
int re = 100000;
int i;
scanf("%d", &n);
for (i = 0; i < n; i++) {
re += 100000 * 0.05;
printf("%d\n", re);
}
if (re % 10000 != 0) re = (re + 10000) / 10000 * 10000;
printf("%d\n", re);
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, kei;
double kin = 100000, ri = 1.05;
scanf("%d", &n);
for (i = 0; i < n; i++) {
kin = kin * ri;
kei = (int)(kin / 1000 + 0.9);
kin = kei * 1000;
}
kei = kin;
printf("%d\n", kei);
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 / 10000);
debt2 *= 10000;
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 | UNKNOWN | #include <bits/stdc++.h>
int main() {
double i, n, answer, v;
int r;
while (scanf("%lf", &n) == 1) {
answer = 100000;
for (i = 0; i < n; ++i) {
answer += 100000 * 0.05;
}
v = answer / 10000;
answer = floor(v);
if (v - answer >= 0.1) {
++answer;
}
r = answer * 10000;
printf("%d", r);
}
exit(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, n;
cin >> n;
for (; n > 0; n--) {
debt = debt * 1.05;
}
if ((debt % 10000) > 0) {
debt = debt - (debt % 10000);
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 | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int Debt = 100000;
int n;
cin >> n;
for (int i = 0; i < n; i++) Debt = Debt * 1.05;
if (Debt % 10000 > 0) Debt = Debt + 10000;
cout << 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<iostream>
using namespace std;
int main(){
int n,ans=100000;
cin>>n;
while(int i=0;i<n;i++){
ans=ans*1.05;
if(ans%1000)ans=(ans\1000)*1000+1000;
}
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 | /* 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 / 10000)) * 10000;
}
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 week(int money) {
money = money + money * 0.05;
money = money + 1000 - (money % 1000);
return money;
}
int main(void) {
int n;
int money = 100000;
cin >> n;
for (int i = 0; i < n; i++) {
money = week(money);
}
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 | cpp | #include <bits/stdc++.h>
using namespace std;
unsigned debt(int n) {
if (n == 0)
return 100;
else if (n == 1)
return 105;
else
return (debt(n - 1) * 1.05 + 1);
}
int main(void) {
int n;
unsigned long d;
cin >> n;
d = debt(n) * 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 | java | import java.math.BigDecimal;
/**
* 0007:Debt Hell
*
* @author MS14A
* @version 2015/04/08
*/
public class Main {
/** 初期借金額:10万円 */
private static final BigDecimal INITIAL_DEBT = new BigDecimal("100000");
/** 利子:5% */
private static final BigDecimal INTEREST_RATE = BigDecimal.valueOf(0.05);
/** 繰り上げ計算用 */
private static final BigDecimal DIVISOR = BigDecimal.valueOf(1000);
/**
* 某国に住んでいる友達がお金に困って、あるヤミ金融業者から 10 万円の借金をしたまま、<br>
* 全く返済していないといいます。<br>
* この業者は、一週間ごとに 5% の利子を借金に加え、さらに借金の 1,000 円未満を切り上げます。<br>
* n を入力したとき、n 週間後の借金の残高を出力し終了するプログラムを作成して下さい。<br>
* n は 100 以下とします。
*
* @param args
* n
*/
public static void main(String[] args) {
int weeks = Integer.parseInt(args[0]);
BigDecimal finalDebt = INITIAL_DEBT;
for (int i = 0; i < weeks; i++) {
// 利子額計算。1000で割った小数部を繰り上げる。
BigDecimal interestAmount = finalDebt.multiply(INTEREST_RATE)
.divide(DIVISOR, 0, BigDecimal.ROUND_UP);
// 借金額 = 前週の借金額 + 利子額
finalDebt = finalDebt.add(interestAmount.multiply(DIVISOR));
}
System.out.println(finalDebt);
}
} |
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 debt = 100000;
int i = 0;
int n = 0, kiriage = 0;
scanf("%d", &n);
for (i = 0; i < n; i++) {
debt = debt * 1.05;
}
kiriage = debt / 10000;
kiriage = kiriage * 10000;
kiriage += 10000;
printf("%d\n", kiriage);
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){
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.nextLine());
double debt = 100000;
while(n > 0){
debt *= 1.05;
debt = 1000.0*Math.ceil(debt/1000.0);
n--;
}
System.out.println(String.format("%.0f",debt));
}//main
}//class |
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, j, n, k = 1;
i = 100000;
j = i * 0.05;
scanf("%d", &n);
if (n == 0) {
printf("%d\n", i);
return 0;
}
do {
i += j;
if (i % 1000 != 0) i + 1000;
k++;
} while (k <= n);
printf("%d\n", i);
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 = 100000, s, w, i;
scanf("%d", &w);
s = n * 0.05 * w;
n = n + s;
n = ((n + (10000 + 1)) / 10000 * 10000);
printf("%d\n", 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 | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
int all[101];
all[0] = 100000;
for (int i = 1; i <= 100; i++) {
all[i] = all[i - 1] * 1.05;
if (all[i] % 1000) {
all[i] -= (all[i] % 1000);
all[i] += 1000;
}
cout << all[i] << endl;
}
while (cin >> n) {
cout << all[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 <iostream>
using namespace std;
??
int main() {
????????????int n,x;
x = 100000;
????????????cin >> n;
????????????for (int i=0;i<n;i++) {
????????????????????????x = 1.05*x;
????????????????????????if (x%1000!=0) {
????????????????????????????????????x = x + (1000-x%1000);
????????????????????????}
????????????}
????????????cout << 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;
cin >> n;
int A = pow(10, 5);
for (int i = 0; i < n; i++) {
A *= (1.05);
}
printf("%d\n", (A + 9999) / 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 <bits/stdc++.h>
int main() {
double n;
while (scanf("%lf", &n) != EOF) {
double rmb = 100000;
rmb = rmb * pow(1.05, n);
rmb = rmb / 10000;
printf("%.0lf0000\n", rmb);
}
}
|
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;
class Main {
public void main(int week) {
BigDecimal shakkin = new BigDecimal(100000);
BigDecimal taxper = new BigDecimal(0.05);
BigDecimal rishi;
int a = 0;
for (int i = 0; i <= week; i++) {
// 5%の利子を計算する
rishi = shakkin.multiply(taxper);
// 5%の利子を元金に足す
shakkin = shakkin.add(rishi);
// 1000円未満を切り上げる
a = shakkin.setScale(-3, BigDecimal.ROUND_UP).intValue();
}
System.out.println(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 | UNKNOWN | n = gets.to_i
d = 100000
n.times{
d *= 1.05
l = d.floor % 1000
d += 1000 - l if l != 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, debt, i, amari, real;
scanf("%d", &n);
debt = 100000;
for (i = 0; i < n; i++) {
debt = debt * 1.05;
}
amari = debt % 10000;
real = debt - amari + 10000;
printf("%d\n", real);
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;
int money = 100000, copy;
int m = 0;
int M[1000];
cin >> n;
for (int i = 1; i <= n; i++) {
money += money * 0.05;
}
copy = money;
while (1) {
copy /= 10;
m++;
if (copy == 0) {
break;
}
}
for (int i = 0; i < m; i++) {
M[i] = money % 10;
money /= 10;
}
for (int i = 0; i < m; i++) {
if (i <= 3) {
M[i] = 0;
} else if (i == 4) {
M[i] += 1;
if (M[i] >= 10) {
M[i + 1] += 1;
M[i] = 0;
}
break;
}
}
money = 0;
for (int i = 1; i < m; i++) {
money += M[i] * 10;
}
for (int i = m - 1; i >= 0; i--) {
cout << M[i];
}
cout << 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 F_debt(int n) {
n *= 1.05;
if (n % 1000 != 0) {
n = n - (n % 1000) + 1000;
}
return n;
}
int main() {
int i, n, debt = 100000;
scanf("%d", &n);
for (i = 0; i < n; i++) {
debt = F_debt(debt);
}
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 | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int inNum, i;
int debt = 100000;
cin >> inNum;
cout << "amount of the debt" << endl;
for (i = 0; i <= inNum; i++) {
debt *= 1.05;
}
debt /= 10000;
debt *= 10000;
cout << debt << 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 n;
cin >> n;
long loan = 100000;
for (int i = n; i > 0; i--) {
loan = ceil((loan * 1.05) / 1000.0) * 1000;
}
cout << loan << '\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 | python2 | from math import ceil
a = input()
print int(10+ceil(sum([10*0.05 for x in xrange(a)])))*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 | python3 | x = input()
n = 100000
while x > 0:
n *= 1.05
mod = n % 1000
if mod != 0:
n = n + 1000 - mod
x -= 1
print(int(n)) |
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() {
long long int ans = 100000;
int n;
cin >> n;
for (int i = 0; i < n; i++) {
ans = ans * 105 / 100;
}
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 | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int p = 100000;
int ans = p;
for (int i = 0; i < n; i++) {
ans += p * 0.05;
}
int trunc = (ans / 10000) * 10000;
cout << (trunc == ans ? ans : trunc + 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 | using System;
class _0007
{
public static void Main()
{
double money = 100000;
int n = int.Parse(Console.ReadLine());
for (int i = 0; i < n; i++)
{
money += money * 0.05;
money = Math.Ceiling(money / 1000.0) * 1000.0;
}
Console.WriteLine();
}
} |
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, mny = 100000, intrst = 100000 * 0.05;
while (scanf("%d", &n) > 0) {
for (i = 0; i < n; i++) {
mny += intrst;
}
if (mny % 10000 > 0) {
mny = mny - (mny % 10000) + 10000;
}
printf("%d\n", mny);
}
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 | n =gets.to_f
a = (100000+(100000*0.05)*n)
a = a. /100
puts a.ceil *100
|
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;
long int debt = 100000;
scanf("%d", &n);
int i;
for (i = 0; i < n; i++) debt *= 1.05;
if (debt % 10000 >= 5000) debt += 10000;
debt -= debt % 10000;
printf("%ld\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 | import std.stdio,
std.range,
std.string,
std.conv,
std.math,
std.algorithm;
void main(){
long base = 100000;
real p = 1.05;
int n = readln.chomp.to!int;
n.iota.each!(e => base *= p);
base = cast(long)(ceil(cast(real)base / 10000) * 10000);
writeln(base);
} |
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;
double x;
scanf("%d", &n);
x = 100;
for (i = 0; i <= n; i++) {
x = ceil(x * 1.05);
}
printf("%f", x * 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 | cpp | a=100000;gets.to_i.times{a=a*105/100;a=(a/1000+1)*1000 if a%1000!=0;};puts 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 | UNKNOWN | #include <bits/stdc++.h>
int main() {
int w, n;
double v;
w = 100000;
scanf("%d", &n);
while (n--) {
w = w * 1.05;
}
v = w;
w = w / 10000;
if (v / 10000 - w >= 0.5) w++;
printf("%d0000\n", w);
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() {
unsigned long long MONAY = 100000;
int n;
cin >> n;
for (n = n; n > 0; n--) {
MONAY = MONAY * 1.05;
MONAY = MONAY + 999 / 1000;
}
cout << MONAY << 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(void) {
unsigned int start = 100000;
int i, j, k, n;
scanf("%d", &n);
for (i = 0; i < n; i++) {
start /= 100;
start *= 105;
start /= 1000;
start += 1;
start *= 1000;
}
printf("%d\n", start);
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 StartDebt = 100000;
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
StartDebt *= 1.05;
}
if (StartDebt % 10000 != 0) {
StartDebt = 10000 * (StartDebt / 10000 + 1);
}
cout << StartDebt << 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>
int main(void){
int n;
long debt;
scanf("%d", &n);
debt=100000;
for(i=1; i<=n; i++){
debt=debt+debt/20;
if(debt%1000!=0){
debt=debt+(1000-debt%1000);
}
i++;
}
return 0;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.