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 | 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().split[0];
int c = to!int(l); // iteration
int d = 100000; // debt
for(int i=0; i<c; i++){
d *= 1.05;
if(d > d / 1000 * 1000) d += 1000;
d = d / 1000 * 1000;
}
write(to!string(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 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 ans = 1000000;
cin >> n;
for (int i = 0; i < n; i++) {
ans *= 1.05;
if ((ans % 1000) != 0) ans - ans - ans % 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 | UNKNOWN | import std.stdio;
import std.string;
import std.conv;
import std.math;
void main ()
{
double a = 100000;
int n = to!int(chomp(readln()));
foreach (i; 0 .. n)
{
a = ceil(a / 1000 * 1.05 ) * 1000;
}
a = to!long(a);
writeln(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>
#pragma warning(disable : 4996)
int main() {
int Debt = 100000;
int Weeks = 0;
scanf("%d", &Weeks);
for (int nCnt = 0; nCnt < Weeks; nCnt++) {
Debt += Debt * 0.05f;
if (Debt % 1000 > 0) Debt += 1000 - (Debt % 1000);
}
printf("%d", Debt);
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | 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 << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
template<typename V> constexpr typename V::value_type sum(const V &v) { return accumulate(all(v), 0); }
void solve();
main { solve(); return 0; }
// clang-format on
void solve() {
int n;
cin >> n;
int x = 100000;
rep(i, n) x = x * 21 / 20;
cout << (x + 5000) / 10000 * 10000 << 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 | class Main {
public static void main(String[] args) {
int deptWeek = 0;
if (args.length != 0) {
// コマンドライン引数から整数nを取り出す
deptWeek = Integer.parseInt(args[0]);
}
// 変数宣言
double dept = 100000; // 借金
int ceilLength = 1000; // 切り上げ時の数値
// n週分、借金に5%の利子を加算(1000円未満は切り上げとする)
for (int i = 0; i < deptWeek; i++) {
dept *= 1.05;
}
dept = Math.ceil(dept / ceilLength) * ceilLength;
// 借金の残高を出力
System.out.println(String.valueOf((int) dept));
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int NumOfWeeks;
int CurrentDebt = 100000;
scanf("%d", &NumOfWeeks);
int i;
for (i = 0; i < NumOfWeeks; i++) {
CurrentDebt = CurrentDebt / 100 + CurrentDebt;
}
printf("%d", CurrentDebt);
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.*;
public class Main {
private static Scanner sc;
public static void main(String[] args) {
sc = new Scanner(System.in);
int n = sc.nextInt();
int debt = 100000;
for(int i = 0; i < n; i++){
debt *= 1.05;
}
if(debt % 1000 != 0){
debt = (debt / 1000 + 1) * 1000;
}
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() {
int n;
double sum = 100000.0, risi, kiriage;
int i;
scanf("%d", &n);
for (i = 0; i < n; i++) {
risi = sum * 0.05;
sum += risi;
sum = (double)((int)sum / 1000);
sum *= 1000.0;
kiriage = risi;
while (kiriage >= 1000) {
kiriage -= 1000.0;
}
if (kiriage > 0) {
sum += 1000;
}
}
printf("%d\n", (int)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 | UNKNOWN | #include <bits/stdc++.h>
int main() {
int n, x = 100000, y, i;
scanf("%d", &n);
for (i = 0; i < n; i++) {
x *= 1.05;
}
y = x / 1000;
if (x - y * 1000 == 0)
x = y * 1000;
else
x = y * 1000 + 1000;
printf("%d\n", x);
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | class Main{
private static final double TAX = 1.05;
public static void main(String[] args) throws IOException {
double totalAmount = 100000;
BigDecimal returnAmount=new BigDecimal(0);
int i = Integer.parseInt(args[0]);
//??\??????????????°???????????????????¢?????????????
for (int count = 0; count < i; count++) {
totalAmount = totalAmount * TAX;
returnAmount = new BigDecimal(totalAmount).setScale(-3, BigDecimal.ROUND_UP);
}
//???????????????????????????
System.out.println(returnAmount.intValue());
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above 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;
signed main() {
int n;
double ret = 100000;
scanf("%d", &n);
while (n > 0) {
ret *= 1.05;
ret = ceil(ret / 1000) * 1000;
n--;
}
printf("%.1f", ret);
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 | #codeing : utf-8
n = gets.to_i
b = (0.5*n).ceil
puts 100000 + ( 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 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"
func roundUp100(dept float64) float64 {
iDept := int(dept)
if iDept-(iDept/1000*1000) != 0 {
iDept = ((iDept / 1000) + 1) * 1000
}
return float64(iDept)
}
func main() {
var week int
fmt.Scan(&week)
dept := 100000.0
for i := 0; i < week; i++ {
dept *= 1.05
dept = roundUp100(dept)
}
fmt.Println(dept)
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String args[]) throws NumberFormatException, IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
double result = 100000;
double rishi = 0.05;
int n = Integer.parseInt(br.readLine());
for(int i = 0; i < n; i++){
result = result + (result*rishi);
}
System.out.println(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 | #include <bits/stdc++.h>
int main(void) {
int n, i, s;
scanf("%d", &n);
s = 100000;
for (i = 0; i < n; i++) {
s *= 1.05;
}
if (s % 1000 != 0) {
s = (s / 10000) + 1 * 1000;
}
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 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.conv,std.string,std.math;
void main(){
char[] buf;
stdin.readln(buf);
double x = buf.chomp().to!double();
double money = 100000;
for(int i = 0;i < x;i++){
money *= 1.05;
}
writeln(roundup(money));
}
int roundup(double x){
int result = 0;
result = ceil(x/10000).to!int();
return result * 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
puts (100000+(100000*0.05)*n).round(-3)
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.math.BigDecimal;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
exec();
}
private static void exec() {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
// 借金
double debt = 100000;
// n週間後の借金残高計算
for (int i = 0; i < n; i++) {
debt = debt * 1.05;
}
// 借金残高の1000円未満切り上げ
BigDecimal bd = new BigDecimal(debt / 1000);
BigDecimal bdr = bd.setScale(-1, BigDecimal.ROUND_UP);
int result = bdr.intValue() * 1000;
System.out.println(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 | java |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int money = 100000; //返す金額
int week = Integer.parseInt(reader.readLine());
int roundingDigit = 1000; //何円に丸めるか
for (int i = 0; i < week; i++) {
money *= 1.05;
money = ceil(money, roundingDigit);
}
System.out.println(money);
}
public static int ceil(int n, int digit) {
return n - (n % digit == 0 ? 0 : n % digit);
}
public static int floor(int n, int digit) {
return n + (n % digit == 0 ? 0 : digit - n % digit);
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above 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())
debt=0
for i in range(1,n+1):
debt+=i+0.05*100000
result=debt+100000
result=math.ceil(result/1000)*1000
print(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 | #include <bits/stdc++.h>
int main() {
int n, i, r = 100000;
scanf("%d", &n);
for (i = 0; i < n; i++) {
r = r * 1.05;
}
if (r % 10000 >= 1 && r % 10000 <= 9999) {
r = r + (10000 - r % 10000);
}
printf("%d\n", r);
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.math.BigDecimal;
/**
* ??????????¨????????????????
*
* @author kohei.nitta
*
*/
public class Debt_hell {
/**
* ?¨??????\??????????????????????????????n??±??????????????????????????????????????????
*
* @param args
*/
public static void main(String[] args) {
BigDecimal debt = new BigDecimal("100000");
BigDecimal interest = new BigDecimal("1.05");
// n??±???????????????????¨??????????
for (int i = 1; i <= Integer.parseInt(args[0]); i++) {
debt = calcDebt(debt, interest);
}
System.out.println(debt);
}
/**
* ??????????????????????????????????????????
*
* @param debt
* @param interest
* @return ?????????????????????????????????????????´??????
*/
private static BigDecimal calcDebt(BigDecimal debt, BigDecimal interest) {
BigDecimal roundUp = new BigDecimal("1000");
// ??????????????????1,000 ?????????????????????????????????
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 | java | import java.math.BigDecimal;
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 bd = new BigDecimal(debt);
bd = bd.setScale(-3, BigDecimal.ROUND_UP);
int ans = bd.intValue();
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 | java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
double n = sc.nextInt();
double rs = Math.ceil(100000 * n * 0.05 / 10000);
int a = 100000 + (int) (rs * 10000);
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 | java | import java.util.Scanner;
public class main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner scn = new Scanner(System.in);
int n = scn.nextInt();
int debt = 100;
for (int i = 0; i < n; i++) {
debt = (int)Math.ceil(debt * 1.05);
}
System.out.println(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 | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int money, i, n, k, num;
money = 100000;
scanf("%d", &n);
for (i = 0; i < n; i++) {
money *= 1.05;
num = money / 100;
k = money % 100;
if (k > 0) {
money = (num * 100) + 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() {
int i, n;
int lastmoney;
double money;
scanf("%d", &n);
money = 100000;
for (i = 0; i < n; i++) {
money += money * 0.05;
money /= 1000;
money = ceil(money);
money *= 1000;
}
lastmoney = (int)money;
printf("%d\n", lastmoney);
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.*;
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;
while(n != 0){
mon = Math.ceil(mon * 1.05);
n--;
}
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(void) {
int n;
double money = 100000;
int keta = 1;
int judge = 1;
double temp;
cin >> n;
for (int i = (1); i < (n + 1); i++) {
money += 0.05 * money;
temp = money;
while (judge) {
temp = (int)temp / 10;
if (temp) {
keta++;
} else
judge = 0;
}
for (int i = 0; i < (int)3; i++) money = money / 10;
money = ceil(money);
for (int i = 0; i < (int)3; i++) money = money * 10;
keta = 0;
judge = 1;
}
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 | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int i, n, debt = 100000;
float tmp;
scanf("%d", &n);
for (i = 0; i < n; i++) {
debt = debt * 1.05;
}
if ((debt % 1000) != 0) {
debt = (debt / 1000 + 1) * 1000;
}
printf("%d\n", debt);
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python2 |
while True:
try:
week = input()
amou = 100000
for x in range(week):
amou = amou*1.05
array = list(str(int(amou)))
array[-1],array[-2],array[-3]= '0', '0', '0'
amou = 0
for i in range(len(array)):
amou = amou + int(array[-(1+i)])*10**i
if int(array[-4]) == 0:
print amou
else:
amou = amou + 10000 - int(array[-4])*1000
print amou
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 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, res;
double m = 100000;
cin >> n;
if (!n) {
cout << m << endl;
return 0;
}
for (; n; n--) m *= 1.05;
m /= 10000;
m += 1;
res = (int)m * 10000;
cout << res << 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 | n =gets.to_i
a = (100000+(100000*0.05)*n)
puts a.ceil * 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 i, n;
int lastmoney;
double money;
while (scanf("%d", &n) != EOF) {
money = 100000;
for (i = 0; i < n; i++) {
money += money * 0.05;
}
money /= 10000;
money = ceil(money);
money *= 10000;
lastmoney = (int)money;
printf("%d\n", lastmoney);
}
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, b = 100000, c = 0, d, e, f, g, i = 1;
scanf("%d", &a);
for (i = 1; i <= a; i++) {
b = b * 1.05;
}
if (b % 10000 != 0) {
b = b / 10000;
b = b + 1;
b = b * 10000;
}
printf("%d", b);
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int a = 100000, b, n;
scanf("%d", &n);
a = a * 1.05 / 1000 + 1;
a *= 1000;
printf("%d", a);
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
double v = 100000;
double r;
int n;
cin >> n;
for (int i = 0; i < n; i++) {
v += v * 0.05;
r = fmod(v, 1000.0);
if (r != 0) {
v += (1000 - r);
}
}
cout << v << 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 "stdafx.h"
#include <iostream>
using namespace std;
int main(){
int i,n=100000,m;
cin >> i;
while(i--){
n+=n*0.05;
m=n%1000;
if(m){
n+=1000-m;
}
}
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 | UNKNOWN | #include <bits/stdc++.h>
int main() {
int week;
int i;
int debt = 100000;
int tmp;
scanf("%d", &week);
for (i = 0; i < week; i++) {
debt = debt + 100000 * 0.05;
}
tmp = debt / 1000;
tmp = tmp % 10;
if (tmp > 0) {
debt = debt - tmp * 1000 + 10000;
}
printf("%d\n", debt);
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN |
n = gets.chomp.to_i
money = 100000
for i in 0..n
money = money * 1.05
if money % 1000 > 0
money = money.ceil
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 <bits/stdc++.h>
using namespace std;
long long calcDebt(long long debt) {
debt = debt * 1.05;
debt = ceil(debt / 1000) * 1000;
return debt;
}
int main() {
int n;
long long 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 | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int inNum, i;
int debt = 100000;
cin >> inNum;
for (i = 0; i < inNum; i++) {
debt *= 1.05;
debt /= 10000;
debt += 1;
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 | java | import java.util.Scanner;
public class Debt_hell {
public static void main(String[] args) {
double debt = 100000;
double interest = 1.05;
double roundUp = 1000;
Scanner input = new Scanner(System.in);
int inputNo = input.nextInt();
for (int i = 1; i <= inputNo; i++) {
debt = Math.ceil((debt * interest) / roundUp) * roundUp;
}
System.out.println(String.format("%.0f", debt));
input.close();
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
static float debt = 100000;
public static void main(String[] args) throws IOException {
int n;
float hell = debt;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
n = Integer.parseInt(br.readLine());
for (int i = 0; i < n; i++) {
hell += hell * 1.05;
hell += hell % 100 > 0 ? 1000 : 0;
hell = (int) hell;
}
System.out.println((int) hell);
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include<stdio.h>
#include<string.h>
main(void){
int money = 100000, num;
scanf("%d", &num);
for( ; num >= 0; num--){
money += money * 0.05;
}
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 | <?php
$week = trim(fgets(STDIN));
$money = 100;
for($i = 0;$i < $week;$i++){
$money = ceil($money * 1.05);
}
echo $money * 1000."\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 | java | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
in.close();
System.out.println(debtHell(n));
}
static int debtHell(int n) {
double debt = 100000;
for (int i = 0; i < n; i++) {
debt *= 1.05;
System.out.print(debt);
debt = Math.ceil(debt / 1000.0) * 1000;
System.out.println("\t" + debt);
}
return (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 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;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above 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(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 | 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 solve() throws IOException {
int n = in.nextInt();
double debt = 100000;
for (int i = 0; i < n; i++) {
debt *= 1.05;
double remainder = debt % 1000;
if (remainder != 0) {
debt = debt - remainder + 1000;
}
}
out.println(debt);
// End solve()
}
// End Solution
}
public static void main(String[] args) throws IOException {
in = new InputReader(System.in);
out = new PrintWriter(System.out);
Solution solver = new Solution();
solver.solve();
out.close();
}
static class InputReader {
public BufferedReader br;
public StringTokenizer st;
public InputReader(InputStream stream) {
br = new BufferedReader(new InputStreamReader(stream));
}
public int nextInt() throws IOException {
while (st == null || !st.hasMoreTokens()) {
st = new StringTokenizer(br.readLine());
}
return Integer.parseInt(st.nextToken());
}
public long nextLong() throws IOException {
while (st == null || !st.hasMoreTokens()) {
st = new StringTokenizer(br.readLine());
}
return Long.parseLong(st.nextToken());
}
public String next() throws IOException {
while (st == null || !st.hasMoreTokens()) {
st = new StringTokenizer(br.readLine());
}
return st.nextToken();
}
public double nextDouble() throws IOException {
while (st == null || !st.hasMoreTokens()) {
st = new StringTokenizer(br.readLine());
}
return Double.parseDouble(st.nextToken());
}
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above 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 a, y, n, money = 10000;
scanf("%d", &n);
for (a = 0; a < n; a++) {
money = money + money / 100 * 5;
}
y = money % 1000;
money = money / 1000;
if (y >= 1) {
money = money + 1;
}
money = money * 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 | python3 | import math
def calc_debt(week=0):
return math.ceil(100000 * (1.05 ** (week))/10000)*10000
print(calc_debt(int(input()))) |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <stdio.h>
#include <math.h>
int main(void)
{
int n;
double y;
scanf("%f",&n);
printf(pow(100000,y));
}
return 0;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
int money = 100000;
cin >> n;
for (int i = 0; i < n; ++i) {
money = money + (money * 0.05);
if (money % 1000 != 0) {
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 | import java.util.Scanner;
public class DeptHell {
// ????????????10??????
public static int LOAN = 100000;
public static void main(String[] args) {
// ???????????????
@SuppressWarnings("resource")
Scanner sc = new Scanner(System.in);
int input = sc.nextInt();
// ??????????????????
double result = LOAN + (LOAN * 0.05) * input;
// ????????\?????????????????????
// ????????\???????°???°?????????
result = result / 10000;
// ?°???°???????????????
result = Math.ceil(result);
// ?????????????????????
result = result * 10000;
System.out.print((int) 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 | #include <bits/stdc++.h>
int main(void) {
int n;
int m = 100000;
int i;
scanf("%d", &n);
for (i = 0; i < n; i++) {
m *= 1.05;
}
m = (m % 1000 == 0 ? m : m - m % 10000 + 10000);
printf("%d\n", m);
return (0);
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int n, i, res, plus;
res = 100000;
scanf("%d", &n);
for (i = 0; i < n; i++) {
plus = res * 0.05;
res += plus;
}
res /= 10000;
res += 1;
res *= 10000;
printf("%d\n", res);
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, debt = 100000;
scanf("%d", &n);
for (i = 0; i < n; i++) {
debt = (int)(debt * 1.05 + 999) / 1000 * 1000;
}
printf("%d", debt);
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int week, a, b, ans, aans;
cin >> week;
a = 100000 * 0.05;
b = week + 1;
a *= b;
ans = 100000 + a;
aans = ans / 1000;
aans = ans * 1000;
if (aans != ans) ans + 100;
cout << ans << endl;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main() {
int n, i, kin2;
double kin = 100000, ri = 0.05;
scanf("%d", &n);
for (i = 0; i < n; i++) {
kin = kin + (kin * ri);
kin2 = (int)(kin / 1000 + 0.9);
kin = kin2 * 1000;
}
kin2 = kin;
printf("%d", kin2);
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, ten1 = 100000, ten2;
cin >> n;
for (int i = 0; i < n; i++) {
ten1 += ten1 / 20;
}
ten2 = ten1 / 10000 * 10000;
if (ten1 != ten2) ten2 += 10000;
cout << ten2 << 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;
static const int ROUND = 1000;
int weeks;
double loan = 100000;
int rishi = loan * 0.05;
int temp;
int main() {
scanf("%d", &weeks);
while (weeks != 0) {
loan = loan * 1.05;
loan = (int(loan / ROUND) + 1) * ROUND;
weeks--;
}
cout << loan << endl;
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
int main() {
int n;
std::cin >> n;
double result = 100;
for (int i = n; i; i--) {
result *= 1.05;
result = (int)(result + 0.9);
}
result *= 1000;
int i = result;
std::cout << 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, i, mul = 100000;
scanf("%d", &n);
for (i = 1; i <= n; i++) {
mul *= 1.05;
}
if (mul % 1000 != 0) {
mul = mul - mul % 1000 + 1000;
}
printf("%d\n", mul);
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) {
int n, i;
scanf("%d", &n);
n = n * 5;
n = 1000 * n;
n = 100000 + n;
printf("%d\n", n);
i = n % 10000;
printf("%d\n", i);
if (i != 0) {
n = n + i;
}
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 <bits/stdc++.h>
int main(void) {
int n, i, b, c, d, e, f;
b = 100;
d = 100000;
scanf("%d", &n);
if (n > 100) {
n = 100;
}
for (i = 0; i < n; i++) {
c = b * 1.05;
e = d * 1.05;
if (c * 1000 != e) {
c = c + 1;
}
b = c;
d = e;
}
printf("%d\n", c * 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 | java | class Main
{
public static void main( String[] args )
{
java.util.Scanner sc = new java.util.Scanner( System.in );
int n = sc.nextInt();
double money = (100000*(1+0.05*n)+500)/100*100;
System.out.printf( "%.0f" ,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>
using namespace std;
int main() {
int n, money = 100000;
cin >> n;
for (int i = 0; i < n; i++) money *= 1.05;
money = money / 10000 + 1;
money *= 10000;
if (!n) money = 100000;
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;
int main() {
int n;
cin >> n;
int money = 100000;
int total = money;
for (int i = 0; i < n; i++) {
total += money * 0.05;
money += money * 0.05;
total = total - total % 10000;
}
cout << total << endl;
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws Exception {
int debt = 100000;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
for (int w = 0; w < Integer.valueOf(br.readLine()); w++) {
debt *= 1.05;
if (debt % 1000 != 0) {
debt = ((debt / 1000) + 1) * 1000;
}
}
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() {
int n;
int i;
int ans;
int a = 100000;
scanf("%d", &n);
for (i = n; i >= 1; i--) {
a *= 1.05;
if (a % 1000 > 0) {
ans /= 1000;
ans++;
ans *= 1000;
} else {
ans = a;
}
}
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 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() {
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);
}
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.*;
import java.util.*;
public class Main {
public static void main(String[] args)
throws java.io.IOException{
Scanner scan = new Scanner(System.in);
int sum=100000;
for(int n=scan.nextInt();n>0;n--){
sum *=1.05;
int m= up3(sum);
sum+=(10-m)*100;
}
System.out.println(sum);
}
public static int up3(int n){
return ((n/100)%10);
}
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above 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 debt(int n);
int main(void) {
int n;
scanf("%d", &n);
printf("%d\n", debt(n));
return (0);
}
int debt(int n) {
int last;
int a;
last = 100000;
for (a = 0; a < n; a++) {
last += last * 5 / 100;
}
if (last % 1000 != 0) {
last /= 10000;
last++;
last *= 10000;
}
return (last);
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above 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 void main(String[] args) {
int deptWeek = 0;
if (args.length != 0) {
// コマンドライン引数から整数nを取り出す
deptWeek = Integer.parseInt(args[0]);
}
// 変数宣言
double dept = 100000; // 借金
int ceilLength = 1000; // 切り上げ時の数値
// n週分、借金に5%の利子を加算(1000円未満は切り上げとする)
for (int i = 0; i < deptWeek; i++) {
dept *= 1.05;
}
dept = Math.ceil(dept / ceilLength) * ceilLength;
// 借金の残高を出力
System.out.println(String.valueOf(dept));
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main() {
long debt = 100000;
char buf[4];
int week;
fgets(buf, 4, stdin);
week = strtol(buf, NULL, 10);
for (int i = 0; i < week; i++) {
debt *= 1.05;
debt += 1000 - (debt % 1000);
}
printf("%ld\n", 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 | cpp | #include <bits/stdc++.h>
int main(int argc, char** argv) {
int n;
std::cin >> n;
int x = 100000;
for (int i = 0; i < n; i++) x = round(x * 1.05 / 1000) * 1000;
std::cout << x << std::endl;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | 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 * (1 + (0.05 * (a + 1))));
// 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 | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a;
a = 100000;
int b;
b = 0;
while (b < n) {
a = a / 20 * 21 / 1000 * 1000;
b = b + 1;
}
cout << a << endl;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | 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) {
a = (int)money % 100;
money /= 100;
money += 1;
money *= 100;
money -= a;
}
if ((int)money % 1000 != 0) {
a = (int)money % 1000;
money /= 1000;
money += 1;
money *= 1000;
money -= a;
}
if ((int)money % 10000 != 0) {
a = (int)money % 10000;
money /= 10000;
money += 1;
money *= 10000;
money -= a;
}
printf("%.0f\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;
int main() {
int n, amount = 100;
cin >> n;
for (int i = 0; i < n; i++) {
amount += amount * 0.05 + 0.999;
}
cout << amount * 100 << endl;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main() {
int n, i, x, xx;
double sum = 100000, y;
scanf("%d", &n);
for (i = 0; i < n; i++) {
sum = sum * 1.05;
x = sum / 1000;
x = x * 1000;
y = sum - x;
if (y > 0) {
x = x + 1000;
}
sum = x;
}
printf("%d\n", x);
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main(void) {
double tax = 0.05 * 100000;
double start = 100000;
int num;
cin >> num;
for (int r = 0; r <= num; r++) {
start += tax;
}
start /= 10000;
start = ceil(start);
start *= 10000;
cout << (int)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 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>
long double debtCalc(long int debt, int x) {
if (x != 0) {
debt = debtCalc(debt, x - 1) * 1.05;
}
return debt;
}
int main(void) {
int x = 0;
scanf("%d", &x);
printf("%.0lf\n", ceil(debtCalc(100000, x) / 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 i = 0;
char text[20] = {};
char x;
scanf("%s", text);
while (i <= (strlen(text) - 1) / 2) {
x = text[i];
text[i] = text[strlen(text) - 1 - i];
text[strlen(text) - 1 - i] = x;
i++;
}
printf("%s\n", text);
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
n = int(input())
debt = 100000
for i in range(n):
debt = int(math.ceil((debt * 1.05 / 1000) * 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 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, rest;
double ans = 100000;
scanf("%d", &n);
for (i = 0; i < n; i++) {
ans *= 1.05;
}
rest = (int)ans % 1000;
if (rest != 0) {
ans += (1000 - rest);
}
printf("%d\n", (int)ans);
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include<stdio.h>
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 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 <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
int main()
{
long double a = 100000;
int s;
cin >> s;
for (int i = 0; i < s; i++) {
a *= 1.05;
}
if (a % 1000 == 0) {
}
else { a = a - (a % 1000); }
cout << 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 | n = gets.to_i
m = 100000
n.times do
m = (m * 1.05).ceil
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 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.lang.Math;
/**
* @author Yuki
*/
public class Main {
/*** ??????????????? */
private static int revaluation = 1000;
/*** ?????? */
private static int dept = 100000;
/*** ??± */
private static int week;
/**
* ?????????????????????<br>
* ??????????????????????????????
*
* @param args
* ??????????????°
*/
public static void main(String[] args) {
// ?????????
week = Integer.parseInt(args[0]);
// ????????????????????????
System.out.println(getTotalDept());
}
/**
* ?????????????????????????????? ????????????????????±???????¨??????????????¨????????????????
*
* @return ???????????????
*/
private static int getTotalDept() {
dept = dept / revaluation;
for (int i = 1; i <= week; i++) {
dept = (int) Math.ceil(dept * 1.05); // ????????????
}
return dept * revaluation;
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above 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 = 100000
n = int(input())
def debt_hell(debt):
s=int(debt*1.05)
t=s//100
u=t%10
if u>0:
debt = (t//10+1)*1000
else:
debt = (t//10)*1000
return debt
for i in range(n):
debt=debt_hell(debt)
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 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, money;
cin >> n;
money = n;
for (int i = 0; i < money; i++) {
n *= 1.05;
n += 999;
n -= n % 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 | puts (10*(1.05**gets.to_i)+0.4).round*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 | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Prob0007
{
class Program
{
const int defMoney = 100000;
static void Main(string[] args)
{
int n = int.Parse(Console.ReadLine());
int money = defMoney;
for (int i = 0; i < n; i++)
{
money += (int)(money * 0.05);
}
if (money % 10000 != 0)
Console.WriteLine((money / 10000 + 1) * 10000);
else
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 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;
/**
* @author Yuki
*/
public class V0007 {
/*** 利子 */
private final static double INTEREST = 1.05;
/*** 切り上げ額 */
private final static double REVALUATION = 1000;
/*** 借金 */
private static int debt = 100000;
/*** 文字型入力ストリーム(標準入力) */
private static BufferedReader br;
/*** 週 */
private static int weekNum;
/*** 初期化 */
static {
br = new BufferedReader(new InputStreamReader(System.in));
}
/**
* メインメソッド<br>
* 借金の残高を出力する
*
*/
public static void main(String[] args) throws IOException {
weekNum = Integer.parseInt(br.readLine()); // 週を取得
System.out.println(getTotalDept()); // 借金の残高の出力
}
/**
* 借金の残高を取得する 利子をかけた週の合計の借金を計算して返す
*
* @return 借金の残高
*/
private static int getTotalDept() {
double debtTemp = debt / REVALUATION;
for (; weekNum > 0; weekNum--) {
debtTemp = Math.ceil(debtTemp * INTEREST); // 切り上げ
}
return (int) (debtTemp * REVALUATION);
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above 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
*
*/
public class DebtHell {
/**
* 標準入力から値を受け取り、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 calc(int n);
int main() {
int n;
scanf("%d", &n);
printf("%d\n", calc(n));
return 0;
}
int calc(int n) {
int a;
a = 100000;
for (; n > 0; n--) {
a *= 1.05;
if (a % 1000 != 0) {
a = (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 | java | import java.util.Scanner;
public class Main {
// ????????????10??????
public static int LOAN = 100000;
public static void main(String[] args) {
// ???????????????
@SuppressWarnings("resource")
Scanner sc = new Scanner(System.in);
int input = sc.nextInt();
// ??????????????????
double result = LOAN + (LOAN * 0.05) * input;
// ????????\?????????????????????
// ????????\???????°???°?????????
result = result / 10000;
// ?°???°???????????????
result = Math.ceil(result);
// ?????????????????????
result = result * 10000;
System.out.print((int) result);
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.