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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int a[10];
for (int i = 0; i < 10; i++) {
cin >> a[i];
for (int j = 0; j < 10; j++) {
if (a[0] < a[i]) swap(a[i], a[0]);
}
for (int j = 0; j < 10; j++) {
if (a[1] < a[i]) swap(a[i], a[1]);
}
for (int j = 0; j < 10; j++) {... |
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int n, debt = 100000;
double tem;
scanf("%d", &n);
for (; n > 0; n--) {
tem = debt * 1.05 / 1000;
debt = tem;
debt = debt * 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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.util.*;
public class Main {
public static void main(String[] args) {
new Main().run();
}
private void run() {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int debt = 100000;
for (int i = 0; i < n; i++) {
debt *= 1.05;
}
if (debt % 10000 != 0) {
debt = (int)(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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
double dbt;
dbt = 100000;
cin >> n;
for (; n >= 0; n--) {
dbt = dbt * 1.05;
dbt = dbt / 1000;
dbt = ceil(dbt);
dbt = dbt * 1000;
}
cout << dbt;
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 g... | {
"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 += 100000 * 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;
}
co... |
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | using System;
namespace _0007
{
class Program
{
static void Main(string[] args)
{
double debt = 100000;
var appointedWeek = int.Parse(Console.ReadLine());
for (int weekCount = 0; weekCount< appointedWeek; weekCount++)
{
debt = deb... |
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int i, j, n, k = 0;
i = 100000;
j = i * 0.05;
scanf("%d", &n);
if (n == 0) {
printf("%d週間後の返済額%d\n", n, i);
return 0;
}
do {
i += j;
k++;
} while (k <= n);
if (i % 1000 != 0) i + 1000;
printf("%d週間後の返済額%d\n", 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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include<stdio.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;... |
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include<stdio.h>
int main(){
int i,j;
int n;
int debt;
scanf("%d",&n);
for(i=0;i<=n;i++){
if(i==0) debt=100000;
else{
debt+=debt*0.05;
if(debt%1000!=0){
debt/=1000;
debt*=1000;
debt+=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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <iostream>
using namespace std;
int main()
{
int n;
while (cin >> n)
{
while (n--)
{
money *= 1.05;
}
if (money % 10000 != 0)
{
money -= (money % 10000);
money += 10000;
}
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int tax = 0.05 * 1000000;
int start = 1000000;
int num;
cin >> num;
for (int r = 0; r <= num; r++) {
start += tax;
}
cout << start << 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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecis... |
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.StringTokenizer;
public class Main {
static InputReader in;
static PrintWriter out;
static class Solution {
void ... |
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.math.BigDecimal;
import java.util.Scanner;
public class AOJ0007DebtHell {
public static void main(String[] args) {
exec();
}
private static void exec() {
Scanner sc = new Scanner(System.in);
Integer n = sc.nextInt();
// 借金
double debt = 100000;
... |
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int a = 100000, b = 0, t = 0;
cin >> t;
if (t == 0)
cout << a << endl;
else if (t <= 100) {
for (int k = 1; k <= t; k++) {
b = a * 1.05;
b = (b + 900) / 1000 * 1000;
a = b;
}
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 g... | {
"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/20;
double b=a/1000;
BigDecimal x=new BigDecimal(b);
x=x.setScale(0,RoundingMode.CEIL... |
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main() {
int n, i;
int tmp1;
scanf("%d", &n);
tmp1 = 100000;
for (i = 0; i < n; i++) {
tmp1 = tmp1 * 105 / 100;
if (tmp1 % 1000 > 0) {
tmp1 = tmp1 + 1000 - tmp1 % 1000;
}
}
printf("%d", tmp1);
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 g... | {
"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 % 10 != 0) {
a = (int)money % 10;
money /= 10;
money += 1;
money *= 10;
money -= a;
}
if ((int)money % 100 != 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 g... | {
"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 / 1000;
loan = loan % 1000 >= 500 ? (a + 1) * 1000 : a * 1000;
std:... |
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int n;
double sum;
int main() {
sum = 100000;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
sum += 0.05 * sum;
sum = ceil(sum / 1000) * 1000;
}
int ans = (int)sum;
printf("%d", 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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include<iostream>
using namedspace 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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python3 | debt=100000
n=int(input())
debt=debt+(debt*0.05+1000)*n
print(int(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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main() {
int n, i;
double result = 100000;
while (1) {
scanf("%d", &n);
if (0 < n && n <= 100) {
break;
}
}
for (i = 1; i <= n; i++) {
result += (result * 5 / 100);
result = floor((result + 999) / 1000) * 1000;
}
printf("%f\n", 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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int a, b = 100000, c, i;
scanf("%d", &a);
for (i = 1; i <= a; i++) {
b = b * 1.05;
}
if (b % 10000 != 0) {
c = b / 10000;
}
printf("%d", (c + 1) * 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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java |
import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner sc =new Scanner(System.in);
int n=sc.nextInt();
int money =100000;
for(int i=0; i<n; i++) money*=1.05;{
if(money/10000*10000<money){money+=10000-money%10000;}
}
System.out.println(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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | using System;
class main
{
static void Main(String[] args)
{
double n = double.Parse(Console.ReadLine());
double b = 100000;
b = Math.Ceiling((b * Math.Pow(1.05, n))/10000);
Console.WriteLine(b*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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n = 0;
double debt = 100000;
cin >> n;
for (int i = 0; i < n; i++) {
debt = debt * 1.05;
if ((int)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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
double a = 100;
cin >> n;
while (n--) {
a += a * 5 / 100;
a = ceil(a);
}
cout << a * 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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | solve :: Int -> Int -> Int
solve m 0 = m
solve m n = solve (((*10000) . ceiling . (/10000)) ((fromIntegral m) * 1.05)) (n-1)
main = readLn >>= print . (solve 100000) |
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
double n, money = 100000;
int r;
cin >> n;
for (; n; n--) money *= 1.05;
money = money / 10000 + 0.5;
r = (int)money * 10000;
cout << r << 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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int a, b, d, i;
a = 0;
b = 0;
d = 0;
i = 0;
scanf("%d", &a);
d = 100000;
for (i = 1; i <= a; i++) {
d = d * 1.05;
b = d % 1000;
if (b >= 1) {
d = d - b;
d = d + 1000;
}
}
printf("%d", d);
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, tmp;
double debt = 100;
cin >> n;
while (n) {
debt *= 1.05;
tmp = (int)debt;
if (debt > tmp) debt = tmp + 1;
n--;
}
cout << debt * 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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
int main(void) {
int week, ans = 100000;
scanf("%d", &week);
for (int f1 = 0; f1 < week; f1++) {
ans += ans * 0.05;
}
ans -= ans % 10000;
ans += 10000;
printf("%d\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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python3 | round=lambda x:(x*2+1)//2
n = int(input())
ans = 100000 + (100000 * (0.05 * n))
print(int(round(ans / 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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | int p=100000;main(a){for(scanf("%d",&a);a--;p=(p/1000+!!(p%1000))*1000)p+=p/20;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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | while True:
try:
n = int(raw_input())
l = 100000
for i in range(n):
l = int(l*1.05)
if l%1000 > 0:
l -= l%1000
l += 1000
print l
except EOFError:
break |
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, M, m;
M = 100;
cin >> n;
for (int i = 0; i < n; i++) {
m = (M + 9) / 20;
M += m;
}
cout << M * 1000;
cin >> 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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #coding: UTF-8
if __FILE__ == $0
while line = gets
initial_debt = 100000
weeks = line.split(" ")[0].to_i
total_debt = initial_debt;
weeks.times{|week|
total_debt += total_debt * 0.05
}
puts (total_debt / 10000).ceil * 10000
end
end |
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
double debt = 100000;
int week = scan.nextInt();
double kinri = Math.pow(1.05, week);
debt = debt * kinri;
BigDecimal ... |
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
int main() {
long int money = 100000;
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
money = (float)money * 1.05;
if (money % 1000 != 0) money += 1000 - (money % 1000);
}
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int n;
int debt = 100000;
scanf("%d", &n);
while (n-- > 0) {
debt *= 1.05;
if (debt % 1000) {
debt /= 1000;
debt += 1;
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main() {
int n, i;
double a = 10000;
scanf("%d", &n);
for (i = 0; i < n; i++) {
a *= 1.05;
}
a /= 1000;
a = ceil(a);
a *= 1000;
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | 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... |
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 g... | {
"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 % 10000 ? m - m % 10000 + 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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main() {
int i, n, money;
int refund = 100000;
for (i = 0; i < n; i++) {
money = refund * 1.05;
if (money % 1000 == 0) {
refund = money;
} else {
refund = money - money % 1000 + 1000;
}
}
printf("%d", refund);
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | using System;
using System.Collections.Generic;
using System.Text;
namespace mondai0007
{
class Program
{
static double rishi = 0.05;
static int Main(string[] args)
{
double gankin = 100000;
double input = double.Parse(Console.ReadLine());
for (int ... |
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int week = 0;
cin >> week;
int a = 100000;
for (int i = week; i--;) {
a *= 1.05;
}
a = (int)(a * 0.0001 + 0.9) * 10000;
cout << a << 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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | import std.stdio;
import std.conv;
import std.algorithm;
import std.string;
import std.file;
import std.math;
int main() {
string l;
l = readln();
int c = to!int(l); // iteration
int d = 100000; // debt
for(int i=0; i<c; i++){
d *= 1.05;
if(d > d... |
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | d=1e5;gets.to_i.times{d=(d+d/20+999)/1000*1000;};p d |
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
double money(double x, int target, int depth = 0) {
if (x - (double)((int)x / 1000) * 1000 > 0) {
x = (double)((((int)x / 1000) + 1) * 1000);
}
if (target == depth) {
return x;
}
return money(x * 1.05, target, depth + 1);
}
int main() {
std::cin.tie(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 g... | {
"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;
}
if (debt % 10000 != 0) {
kiriage = debt / 10000;
kiriage = kiriage * 10000;
kiriage += 10000;
} else {
kiriage = 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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <iostream>
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;
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
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 result = 100000;
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | public class Main {
public static void main(String[] args) {
double totalDebt; // 借金合計
for (int i = 0; i < args.length; i++) {
int intInputWeek = Integer.parseInt(args[i]);
// 借金計算
totalDebt = calcDebt(100000, intInputWeek);
System.out.println((int)... |
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
double m = 100000;
for (int i = 0; i < n; i++) {
m *= 1.05;
if ((int)m % 1000 != 0) m = m - (int)m % 1000 + 1000;
}
cout << m << 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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <iostream>
using namespace std;
??
int main() {
????????????int n = 100000;
????????????cin >> n;
????????????for (int i=0;i<n;i++) {
????????????????????????n = 1.05*n;
????????????????????????if (n%1000!=0) {
????????????????????????????????????n = n + (1000-n%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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
class Debt_hell {
public static void main(String[] args) throws IOException {
double debt = 100000;
double interest = 1.05;
double roundUp = 1000;
BufferedReader input = new BufferedReader(new InputStreamReader(
... |
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include<iostream>
#include<string>
using namespace std;
int main(){
double a=100000;
int n;
cin>>n;
for(int i=0;i<n;i++){
a*=1.05;
if(a%1000==0)
a-=1000;
a/=1000;
a*=1000;
a+=1000;
}
cout<<a<<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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
double money = 100;
cin >> n;
for (size_t i = 0; i < n; i++) {
money = money * 1.05;
money = ceil(money);
}
cout << money * 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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python2 | a = raw_input()
print int(a)*5*100000/100+1000*int(a)+100000
|
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
int main() {
int n;
double debt = 100000;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
debt = debt + debt * 0.05;
debt = debt - (int)debt % 1000;
debt += 1000;
}
printf("%d\n", (int)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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.util.Scanner;
class Main {
public static void main(String[] args){
Scanner stdin = new Scanner(System.in);
double money = 100000;
int n = stdin.nextInt();
for(int i = 0; i < n; i++){
money *= 1.05;
}
double r = money % 10000;
int ans = (int)(money / 10000);
if(r >= 5000){
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | n = gets.to_i
x = 100000
i = 0
while i < n
x += x*5/100
y = x%1000
if y >= 100
x = x-y+1000
end
i += 1
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 g... | {
"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;
}
cout << x << 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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main() {
int n, c, D = 100000, flag = 0;
double d;
scanf("%d", &n);
for (c = 0; c < n; c++) {
flag = 0;
d = D * 1.05;
D = d;
printf("%d\n", D);
if (D % 1000 != 0) {
flag = 1;
}
D /= 1000;
printf("%d\n", D);
D *= 1000;
printf("%d\n", D);
... |
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int i, n;
double ans;
cin >> n;
ans = 100.000;
for (i = 0; i < n; i++) {
ans *= 1.05;
ans = int(ans + 0.999);
}
ans = int(ans);
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | int n = Integer.parseInt(args[0]);
// 1,000 ?????????????????????????????????????????????1,000??§?????£????????§?¨?????????????
int pay_i = 100000 / 1000;
for (int i = 0; i < n; i++) {
float pay_f = (float) (pay_i * 1.05);
pay_i = (int) (pay_i * 1.05);
// ??´??°????°???°??????????¨??????????????????... |
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python2 | import math
n=input()
money = 100000
for i in range(n):
money = math.ceil(money * 1.05/1000)*1000
print "%d" %(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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | i;main(){i=!puts("14207000");} |
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, debt = 100000;
cin >> n;
while (n--) {
debt = debt * 1.05;
debt += 999;
debt /= 1000;
debt *= 1000;
}
cout << debt << endl;
while (1)
;
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | n = gets.chomp.to_i
m = 100000
n.times do
if (m*1.05)%1000==0
m = m*1.05
else
m = (m*1.05-m*1.05%1000)+1000
end
end
puts 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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <iostream>
#include <math.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;
double money;
float interest_rate;
debt = 100000;
interest_rate = 1.05;
cin >> n;
debt = interest(debt, 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 g... | {
"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;
}
debt = debt - debt % 1000;
debt = debt + 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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int n;
int debt = 100000;
int r = 0;
int i;
scanf("%d", &n);
for (i = 0; i < n; i++) {
r += 5000;
}
debt += r;
if (debt % 10000 != 0) {
debt += 5000;
}
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | n =gets.to_i
a = (100000+(100000*0.05)*n)
a = a.to_f/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 g... | {
"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;
}
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
int main() {
int n, i, kane = 100000, a, b;
std::cin >> n;
for (i = 0; i < n; i++) {
kane = kane * 1.05;
if (kane % 1000 != 0) {
a = kane % 1000;
b = 1000 - a;
kane = kane + b;
}
}
std::cout << kane;
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* Debt Hell
* @author
*/
public class Main {
public static void main(String args[]) throws NumberFormatException, IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int shak... |
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 g... | {
"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);
while (n-- > 0) {
debt *= 1.05;
if ((int)debt % 1000) {
debt /= 1000;
debt = (int)debt;
debt += 1;
debt *= 1000;
}
}
printf("%d", (int)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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python3 | debt=10**5
interest=5/100
n=int(input())
for week in range(n):
debt=debt(1+interest)
if debt%1000>0:
debt=debt+1000-(debt%1000)
print(debt) |
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main() {
int a = 100000, b = 0;
int i, j;
scanf("%d", &i);
for (j = 0; j < i; j++) {
a = (a * 0.05) + a;
b = a;
a = a / 1000;
if (b % 100 != 0) {
a += 1;
}
a = a * 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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | n = gets.to_i
puts n
debt = (10**5)*(1.05**n)
puts "#{debt.round(-4)}" |
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int i, n;
double ans;
cin >> n;
ans = 100.000;
for (i = 0; i < n; i++) {
ans *= 1.05;
ans = (long long int)(ans + 0.999);
ans = (double)ans;
}
ans *= 1000;
ans = (long long int)ans;
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | package java_rensyu;
import java.math.BigDecimal;
import java.util.Scanner;
public class Chika {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int week = scanner.nextInt();
BigDecimal debt = new BigDecimal(100000);
BigDecimal rate = new BigDecimal(1.05);
for (int 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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
int main() {
int n = 0;
int m = 100000;
scanf("%d", &n);
for (; n != 0; n--) {
m = (int)(m * 0.00105) * 1000;
m += 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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int n = scn.nextInt();
int a = 100;
for (int i = 0; i < n; i++) {
a = Math.ceil(a * 1.05);
}
System.out.println(a * 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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
int d = 100000;
cin >> n;
for (int i = 0; i < n; i++) {
d = d * 1.05;
if (d % 1000 != 0) d += 1000 - d % 1000;
}
cout << d;
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main() {
double d = 100000.0;
int n, i;
scanf("%d", &n);
for (i = 0; i < n; i++) {
d *= 1.05;
}
if ((int)d % 10000 != 0) {
d = (int)d - (int)d % 10000 + 10000;
}
printf("%d\n", (int)d);
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include<iostream>
using namespace std;
int main() {
int d = 100000;
int n;
cin >> n;
while(n > 0; n--) {
d *= 1.05;
if(d % 1000) {
d = (d / 1000 + 1) * 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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | using System;
class Program
{
static void Main(string[] args)
{
int n = int.Parse(Console.ReadLine());
double money = 1000;
for (int i = 1; i < n + 1; i++)
{
money = Math.Floor(money*1.05);
}
Console.WriteLine(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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | public class Main {
public static void main(String[] args) {
int intInputWeek = Integer.parseInt(args[0]);
// 借金計算
double totalDebt = calcDebt(100000, intInputWeek);
System.out.println((int) totalDebt);
}
/**
* 借金計算メソッド(週利0.05%)
* @param debt 現在の借金
* @param... |
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python3 | x = raw_input()
n = 100000
while x > 0:
n *= 1.05
mod = n % 1000
if mod != 0:
n = n + 1000 - mod
x -= 1
print(int(n)) |
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.util.Scanner;
public class DebtHell {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner in = new Scanner(System.in);
int week = in.nextInt();
int dept = 100000;
for (int i = 0; i < week; i++) {
// 利子の計算
dept = (int)(dept * 1.05);
// 1,000円未満は切り上げ
if (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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int n, i, s;
s = 100000;
scanf("%d", &n);
for (i = 1; i <= n; i++) {
s *= 1.05;
}
if (s % 10000 != 0) {
s -= s % 10000;
s += 10000;
}
printf("%d\n", 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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int n, i, ans, debt;
scanf("%d", &n);
debt = 100000;
ans = 100000;
for (i = 0; i < n; i++) {
ans += (ans / 20);
}
ans = ans / 10000 * 10000 + 10000;
printf("%d", 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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
long long roundup(long long *x) {
(*x) += 900;
(*x) /= 1000;
(*x) *= 1000;
}
long long addinterest(long long *x) {
(*x) *= 1.05;
roundup(x);
}
int main() {
long long debt = 100000;
int n;
scanf("%d", &n);
while (n--) addinterest(&debt);
printf("%lld\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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | package main
import (
"fmt"
"math"
)
var interests [101]float64
func main() {
var m int
fmt.Scanf("%d", &m)
fmt.Printf("%d\n", int(math.Ceil(interest(m)*10))*10000)
}
func interest(m int) (i float64){
if interests[m] > 0 {
return interests[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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python3 | n = int(input())
dept = 100000
for i in range(n):
dept += dept*0.05
print(int(round(dept,-4))) |
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 g... | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include<iostream>
using namespace std;
int main(void){
int n, ans = 100000;
cin >> n;
for(i = 0; i < n; i++){
ans = ans * 1.05;
if(ans % 1000 != 0);
ans = ans - ans % 1000 + 10000;
}
cout << ans << endl;
return 0;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.