Search is not available for this dataset
name
stringlengths 2
88
| description
stringlengths 31
8.62k
| public_tests
dict | private_tests
dict | solution_type
stringclasses 2
values | programming_language
stringclasses 5
values | solution
stringlengths 1
983k
|
---|---|---|---|---|---|---|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
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 given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
int main() {
int n, i, a, b, okane = 100000;
std::cin >> n;
for (i = 0; i < n; i++) {
okane = okane * 1.05;
if (okane % 1000 != 0) {
a = okane % 1000;
b = 1000 - a;
okane = okane + b;
}
}
std::cout << okane;
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 a;
cin >> a;
int ans = 100000;
for (int b = 0; b < a; b++) {
double rev = 0;
ans = ans * 1.05;
rev = ans % 1000;
cout << rev << endl;
if (rev != 0) ans = ans - rev + 1000;
cout << ans << endl;
}
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 | java | import java.util.*;
public class a0007 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner stdIn = new Scanner(System.in);
int n = stdIn.nextInt();
long money = 100000;
for(int i=1; i<=n; i++){
money = (long) (money*1.05);
if(money % 1000 != 0)
money = money - money%1000 +1000 ;
}
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 given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | package aizuonlinejudge;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* @author Yuki
*/
public class Main {
/*** ?????? */
private final static double INTEREST = 1.05;
/*** ??????????????? */
private final static double REVALUATION = 1000;
/*** ???????????\??????????????????????¨??????\?????? */
private static BufferedReader br;
/*** ??± */
private static int weekNum;
/*** ????????? */
static {
// ?¨??????\?????????
br = new BufferedReader(new InputStreamReader(System.in));
try {
weekNum = Integer.parseInt(br.readLine());
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* ?????????????????????<br>
* ??????????????????????????????
*
* @param args
* ??????????????°
*/
public static void main(String[] args) {
// ????????????????????????
System.out.println(getTotalDept());
}
/**
* ?????????????????????????????? ????????????????????±???????¨??????????????¨????????????????
*
* @return ???????????????
*/
private static int getTotalDept() {
double debt = 100000 / REVALUATION;
for (; weekNum > 0; weekNum--) {
debt = Math.ceil(debt * INTEREST); // ????????????
}
return (int) (debt * 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 | UNKNOWN | #include <bits/stdc++.h>
int main() {
int a, b;
scanf("%d", &a);
b = 25000 + (a * 1000);
printf("%d\n", b + 100000);
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int n;
double x;
double y;
scanf("%f", &n);
x = 100 * pow(1.05, y);
x = x * 1000;
printf("%f", 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 | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
double pri = 10.0;
int n, i, debt;
scanf("%d", &n);
for (i = 0; i < n; i++) {
pri = pri * (100 + n) / 100;
}
debt = (int)(pri + 0.5) * 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 | main = do
n <- readLn :: IO Int
let debt x = 100 * ceiling $ x * 0.0105
print $ iterate debt 100000 !! n |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | <?php
//$t = trim(fgets(STDIN));
//fscanf(STDIN, "%d", $a);
//echo $a * $a * $a;
while(true) {
fscanf(STDIN, "%d", $w);
if(feof(STDIN))
break;
$b = 100000;
for ($i=0;$i<$w;$i++) {
$b = $b * 1.05;
$c = 1000 * ceil($b/1000);
//printf("%d => %d", $b, $c);
$b = $c;
echo PHP_EOL;
}
printf("%d", $b);
echo PHP_EOL;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a 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"
"os"
"strconv"
"bufio"
"math"
)
var sc = bufio.NewScanner(os.Stdin)
func main(){
sc.Split(bufio.ScanWords)
n := nextInt()
ans := calc(n)
fmt.Println(ans)
}
func calc(n int) float64{
tmp := 100000.0
for i:=0; i<n; i++{
tmp*=1.05
// tmp = Ceil(tmp, -4) なぜかうまくいかない
tmp = Ceil(tmp, -3)
// fmt.Printf("now tmp: %d\n", int(tmp))
}
return tmp
}
func Ceil(f float64, places int) float64{
shift := math.Pow(10, float64(places))
return math.Ceil(f * shift)/shift
}
func next()string{
sc.Scan()
return sc.Text()
}
func nextInt()int{
a, _ := strconv.Atoi(next())
return 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 <stdio.h>
int main(void){
int loan=100000;
double temp=0;
int i=0;
int week;
int check=0;
scanf("%d", &week);
while(week > 0){
temp=loan*1.05;
loan=temp;
check = temp % 1000;
if(check!=0){
temp/=1000;
temp*=1000;
temp+=1000;
loan=temp;
week--;
continue;
}
check = temp % 100;
if(check!=0){
temp/=100;
temp*=100;
temp+=100;
loan=temp;
week--;
continue;
}
check = temp % 10;
if(check!=0){
temp/=10;
temp*=10;
temp+=10;
loan=temp;
week--;
continue;
}
if( (temp-loan) != 0){
loan+=1;
}
week--;
}
return 0;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <iostream>
int main(){
int n,debt=100000;
for(int i=0,cin>>n;i<n;i++) debt*=1.05;
std::cout<<(debt%1000 ? debt/1000*1000+1000 : debt)<<'\n';
return 0;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
double m = 100000;
cin >> n;
for (int i = 0; i < n; i++) {
m += m * 0.05;
if ((int)m % 1000) {
m = (int)m / 1000 * 1000;
m += 1000;
} else
m = (int)m / 1000 * 1000;
}
cout << m << endl;
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int n;
scanf("%d", &n);
double sum = 100000.0;
int i;
for (i = 0; i < n; i++) {
sum = sum * 1.05;
sum /= 1000.0;
sum = ceil(sum);
sum *= 1000.0;
}
printf("%d\n", (int)sum);
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a 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[]) {
double debt = 100000.0;
int nWeeks = new Scanner(System.in).nextInt();
for(int i = 0; i < nWeeks; i++) {
debt = Math.ceil(debt * 0.00105) * 1000.0;
}
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 | 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[]){
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try {
int shakkin = 100000;//??????
int rishi = 5;//??????
int n = Integer.parseInt(br.readLine());//N??±???????????????
System.out.println(getShakkin(shakkin, rishi, n));//???????????¨?????????
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* N??±????????????????????????????????????
* @param gankin
* @param rishi
* @param n
* @return
*/
public static int getShakkin(int gankin, int rishi , int n){
int result = gankin;//N??±???????????????
for(int i = 0; i < n; i++){
result = result + (result*rishi/100);//?????????????????????
}
if((result+5000)/10000 > result/10000){
result = result/10000;
result = (result + 1)*10000;
}else{
result = result/10000;
result = result*10000;
}
return result;//????????????
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
int sum = 100000;
while (cin >> n) {
for (int i = 0; i < n; i++) {
sum *= 105 / 100.0;
if (sum % 1000 > 100) {
sum /= 1000;
sum *= 1000;
sum += 1000;
}
}
cout << sum << endl;
}
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, ans;
ans = 100000;
cin >> n;
for (int i = 0; i < n; i++) {
ans = ans * 1.05;
if (ans % 1000 != 0) ans = ans + ans % 1000;
}
cout << ans;
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
double n, debt = 10, loan;
cin >> n;
for (int i = 0; i < n; i++) {
loan = debt * 5 / 100;
debt += loan;
}
cout << ceil(debt) << "0000" << 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>
struct yami {
double kinri;
int fusai;
};
int main(void) {
int i, week;
struct yami a;
a.kinri = 0.05;
a.fusai = 100000;
scanf("%d", &week);
for (i = 0; i < week; i++) {
a.fusai *= (1 + a.kinri);
}
if (a.fusai % 1000 != 0) {
a.fusai /= 10000;
a.fusai += 1;
a.fusai *= 10000;
}
printf("%d\n", a.fusai);
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
//ranker
using namespace std;
using ll = long long;
using lli = ll int;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using pii = pair<int, int>;
using pis = pair<int, string>;
using psi = pair<string, int>;
using D = double;
int main()
{
int n, sum=100000;
int i, j, k;
int sum, tot, ans, num;
cin >> n;
for(i=0; i<n; i++){
sum += sum*(i+1)*0.05;
sum = (sum/1000+1)*1000;
}
cout << sum << endl
return 0;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python2 | while True:
try:
n = int(raw_input())
l = int(100000*pow(1.05, n))
if l%10000 > 0:
l -= l%10000
l += 10000
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 given in a 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 i, n;
double ans;
cin >> n;
ans = 100.000;
for (i = 0; i < n; i++) {
ans *= 1.05;
ans = int(ans + 0.9999999);
ans = double(ans);
}
ans *= 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 | #include <bits/stdc++.h>
using namespace std;
int n, sg[55];
void mex() {
bool vis[55];
memset(sg, 0, sizeof(sg));
for (int i = 2; i <= 50; i++) {
memset(vis, false, sizeof(vis));
for (int j = 0; j <= i - 2; j++) vis[sg[j] ^ sg[i - j - 2]] = true;
for (int j = 0; j <= 55; j++)
if (!vis[j]) {
sg[i] = j;
break;
}
}
}
int main() {
mex();
while (cin >> n) {
int a, s = 0;
for (int i = 0; i < n; i++) {
cin >> a;
s ^= sg[a];
}
if (s)
cout << "Yes\n";
else
cout << "No\n";
}
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
double cath = 100000;
cin >> n;
for (int i = 1; i <= n; i++) {
cath += cath * 0.05;
cath = ceil(cath * 0.001);
cath *= 1000;
}
cout << cath << endl;
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int Debt = 100000;
int n;
cin >> n;
for (int i = 0; i < n; i++) {
Debt = Debt * 1.05;
if (Debt % 10000 > 0) Debt = Debt - (Debt % 10000) + 10000;
}
cout << n << endl;
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | main(){printf("%d",13530000);exit(0);} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int sum = 100000, i, data;
scanf("%d", &data);
for (i = 0; i < data; i++) {
sum = sum + (sum * 0.05);
if (0 != sum % 1000) {
sum = sum + 1000;
}
sum = sum / 1000;
sum = sum * 1000;
}
printf("%d", sum);
scanf("%d", &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 | python2 | num = int(raw_input())
result = 10
for i in range(num):
result *= 1.05
print result
print int(round(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 | #include <bits/stdc++.h>
int main(void) {
int mon, n;
int i;
mon = 100000;
scanf("%d", &n);
for (i = 1; i <= n; i++) {
mon = mon + mon * 0.05;
}
if (mon % 1000 != 0) {
mon = mon - (mon % 1000) + 1000;
}
printf("%d\n", mon);
return (0);
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int n;
int re = 100000;
int i;
scanf("%d", &n);
for (i = 0; i < n; i++) {
re *= 1.05;
printf("%d\n", re);
re = (re + 999) / 1000 * 1000;
}
printf("%d\n", re);
return (0);
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | 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\n", 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 | #include <bits/stdc++.h>
int main() {
int n;
scanf("%d", &n);
int i;
int syakkinn = 100000;
for (i = 0; i < n; i++) {
syakkinn *= 1.05;
int n = syakkinn / 1000;
syakkinn = n * 1000;
}
printf("%d\n", syakkinn);
scanf("%d", &n);
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int n;
int 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", debt);
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main() {
int i;
int n;
int kei;
scanf("%d", &n);
kei = 100000;
for (i = 0; i < n; i++) {
kei = 1.05 * kei;
}
printf("%d\n", kei - kei % 10000 + 10000);
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
const int first = 100000;
int round_up(int price) {
if (price <= 1000) {
return price;
}
int complement = 1000 - price % 1000;
return (price + complement);
}
int get_dept(int n) {
int dept = first;
for (int i = 0; i < n; i++) {
dept += dept / 20;
dept = round_up(dept);
}
return dept;
}
int main() {
int n;
std::cin >> n;
std::cout << (get_dept(n)) << std::endl;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int n, A = 0, b, a1, b1, A1 = 100000;
cin >> n;
for (int i = 0; i < n; i++) {
b1 = A1 * 0.05 / 1000;
a1 = b1 * 1000 + 1000;
A1 += a1;
cout << b1 << " " << A1 * 0.05 << " ";
}
cout << A1 << "\n";
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include<stdio.h>
int main(void){
int r=100000;
int n,a;
scanf("%d",&n);
for(int i = 0; i<n; i++){
r = r*1.05;
if(r%1000 > 0){
a=r%1000
r=r+1000-a;
}
}
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 | UNKNOWN | #include <bits/stdc++.h>
int main() {
int n;
scanf("%d", &n);
int a = 100000;
for (int i = 0; i < n; i++) {
a *= 1.05;
if (a % 1000 != 0) {
a = (a / 1000) * 1000;
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 given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
inline void minup(T1& m, T2 x) {
if (m > x) m = static_cast<T2>(x);
}
template <class T1, class T2>
inline void maxup(T1& m, T2 x) {
if (m < x) m = static_cast<T2>(x);
}
int n;
double res = 100000;
int main() {
cin >> n;
while (n--) {
res *= 1.05;
res = 1000 * ceil(res / 1000);
}
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 | cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int debt = 100'000;
while (n != 0) {
debt *= 1.05;
if (debt % 1000 != 0) {
debt = (debt / 1000 + 1) * 1000;
}
--n;
}
cout << debt << endl;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
double money;
money = 100000;
cin >> n;
for (int i = 0; i < n; i++) {
money = money * 1.05;
k = money / 1000;
k = k * 1000;
if (money - k > 0) {
k = k + 1000;
}
money = k;
}
cout << k << endl;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python3 | import math
n = int(input())
debt = 10**5
for i in range(5):
debt *= 1.05
few = math.ceil(debt / 10000)
print(few * 10000)
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
// System.out.println(n);
System.out.println(10000 * (int) Math.ceil(10.0f * Math.pow(1.05f, n)));
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int n, m = 100000;
cin >> n;
for (long long int i = 0; i < (n); i++) {
m *= 1.05;
if (m % 1000 != 0) {
m -= m % 1000;
m += 1000;
}
cout << m;
}
cout << m << "\n";
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int i, n;
double r = 0, m = 100000;
scanf("%d", &n);
for (i = 0; i != n; i++) {
m += m * 0.05;
r = floor(m * 0.001) * 1000;
if (m != r) {
m = r;
m += 1000;
}
}
printf("%.0f", m);
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.math.BigDecimal;
class Main {
public static void main(int input) {
BigDecimal shakkin = new BigDecimal(100000);
BigDecimal taxper = new BigDecimal(0.05);
BigDecimal rishi;
int output = 0;
for (int i = 0; i <= input; i++) {
// 5%の利子を計算する
rishi = shakkin.multiply(taxper);
// 5%の利子を元金に足す
shakkin = shakkin.add(rishi);
// 1000円未満を切り上げる
output = shakkin.setScale(-3, BigDecimal.ROUND_UP).intValue();
}
System.out.println(output);
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python2 | n=input()
m = 100000
for _ in xrange(5):
m = m + m*0.05
m = m + ( (1000 - (m % 1000)) if (m % 1000) != 0 else 0)
print int(m) |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int i, n, m = 100000;
scanf("%d", &n);
for (i = 0; i < n; i++) {
m *= 1.05;
m += m % 1000 ? 1000 - m % 1000 : 0;
}
printf("%d", m % 1000 ? m - m % 1000 + 10000 : m);
return EXIT_SUCCESS;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | 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 = debt * (1.05);
if ((debt % 1000) != 0 )
{
debt = debt - (debt % 1000) + 1000;
}
}
Console.Write(debt);
}
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | 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;
for( int i = 0 ; i < n ; i++ ){
money *= ( 1.05 );
money += 999;
money = (int)(money/1000)*1000;
}
System.out.printf( "%d" ,(int)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<stdio.h>
#include<iostream>
using#include<stdio.h>
#include<iostream>
using namespace std;
int main(){
int n=0;
int m=100000;
cin>>n;
for(int i=0;i<n;i++){
m=m*1.05;
if(m%1000!=0){
m=m+1000;
}
}
cout<<m<<endl;
return 0;
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | using System;
class main
{
static void Main(String[] args)
{
double n = double.Parse(Console.ReadLine());
double b = 100000;
for (int i = 0; i < n; i++)
{
b = b * 1.05;
b = (Math.Ceiling(b / 1000))*1000;
}
Console.WriteLine(b);
//Console.ReadKey();
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, i, sum = 100000, count;
cin >> n;
for (i = 0; i < n; i++) {
sum = sum * 1.05;
}
if (sum % 10000 != 0) {
sum = sum / 10000;
sum = sum + 1;
sum = sum * 10000;
}
cout << sum << endl;
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
int main() {
int week;
std::cin >> week;
int debt = 100000;
for (int cnt = 0; cnt < week; ++cnt) {
debt *= 1.05;
}
if (debt % 10000 != 0) {
debt += (10000 - (debt % 10000));
}
std::cout << debt << std::endl;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int n;
cin >> n;
double ans = 100000.0;
for (int i = 0; i < n; i++) {
ans = ans * 1.05;
}
ans = (int)ans / 10000;
ans = ans + 1;
ans = ans * 10000;
cout << ans << endl;
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | <?php
fscanf(STDIN, "%d", $n);
$debt = 100000;
for($i = 0; $i < $n; $i++){
$debt = ceil(($debt * 1.05)/1000) * 1000;
}
echo $debt."\n";
?> |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main() {
int i;
int n;
int kei = 100000;
scanf("%d", &n);
if (n > 100 && n < 0) {
return 0;
}
for (i = 0; i < n; i++) {
kei = 1.05 * kei;
kei = kei - kei % 1000 + 1000;
}
printf("%d\n", kei);
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int n;
int machi[20][20];
int kotsuhi(int start, int goal) {
int d[20], f[20];
int i, min, p;
for (i = 0; i < 20; i++) {
d[i] = 100000;
f[i] = 0;
}
d[start - 1] = 0;
while (1) {
min = 100000;
for (i = 0; i < n; i++) {
if (d[i] < min && f[i] == 0) {
min = d[i];
p = i;
}
}
if (min == 100000) break;
f[p] = 1;
for (i = 0; i < n; i++) {
if (d[p] + machi[p][i] < d[i]) {
d[i] = d[p] + machi[p][i];
}
}
}
return d[goal - 1];
}
int main() {
int i, j, m, a1, b1, c1, d1, x1, x2, y1, y2;
for (i = 0; i < 20; i++) {
for (j = 0; j < 20; j++) {
machi[i][j] = 100000;
}
}
scanf("%d", &n);
scanf("%d", &m);
for (i = 0; i < m; i++) {
scanf("%d,%d,%d,%d", &a1, &b1, &c1, &d1);
a1 -= 1;
b1 -= 1;
machi[a1][b1] = c1;
machi[b1][a1] = d1;
}
scanf("%d,%d,%d,%d", &x1, &x2, &y1, &y2);
printf("%d\n", y1 - y2 - kotsuhi(x1, x2) - kotsuhi(x2, x1));
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int m = 100000, i, w;
scanf("%d", &w);
for (i = 0; i < w; i++) {
m *= 21;
m /= 20;
if ((m % 1000) != 0) {
m / 1000;
m *= 1000;
m += 1000;
}
}
printf("%d", 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 debt_amount(int, int);
int main() {
int n;
scanf("%d", &n);
printf("%d\n", debt_amount(100000, n));
return 0;
}
int debt_amount(int a, int x) {
if (x >= 1) {
a = (a + a * 0.05) / 1000 + 0.9;
a = a * 1000;
return debt_amount(a, x - 1);
} else {
return 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 | package aizuonlinejudge;
/**
* @author Yuki
*/
public class V0007 {
/*** ??????????????? */
private static double revaluation = 1000;
/*** ?????? */
private static double rate = 1.05;
/*** ?????? */
private static double 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 = 0; i < week; i++) {
dept = Math.ceil(dept * rate); // ????????????
}
return (int) (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 | # -*- coding: utf-8 -*-
from math import ceil
n = int(input())
d = int(1e5)
for x in range(n):
d = (1.05*d)
d + int(int(ceil(d/1e3))*1e3)
print (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 given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int n, i;
int debt = 100000;
scanf("%d", &n);
for (i = 0; i < n; i++) {
debt *= 1.05;
if ((debt % 1000) != 0) {
debt /= 1000;
debt++;
debt *= 1000;
}
}
printf("%d", debt);
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main(void) {
long money = 100000;
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
money *= 1.05;
if (money / 100 % 10) money = (int)money / 1000 * 1000 + 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 | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, i, kane = 100000;
cin >> n;
for (i = 0; i < n; i++) {
kane = kane * 1.05;
}
kane = kane - kane % 1000 + 1000;
cout << kane << 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 |
/**
* @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 | python2 | rishi=0.05
debt= 100000
week = int(raw_input())
kiriage = 1000
def ceil(src, range):
return((int)(src / range) + 1) * range
for i in range(0,week):
debt = debt * (1+rishi)
print debt
print ceil(debt, kiriage) |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a 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 argc, const char* argv[]) {
int n, i, money = 100000;
scanf("%d", &n);
for (i = 0; i < n; i++) {
money = money * 1.05;
}
if (money % 10000 != 0) money = (money / 10000 + 1) * 10000 + 0;
printf("%d\n", money);
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <iostream>
using namespace std;
int main(){
int n;
scanf("%d",&n);
double base = 100000;
for(int i=0;i<n;i++){
base*=1.05;
}
printf("%d\n,(int)base);
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int n;
int debt = 100000;
int r = 0;
int i;
scanf("%d", &n);
for (i = 0; i < 5; 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 given in a 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, p;
double m;
m = 100;
scanf("%d", &n);
for (i = 0; i < n; i++) {
m = m + m * 0.05;
p = m;
printf("%f\n", m);
if (m > p) {
p++;
m = p;
}
printf("%d\n", p);
}
printf("%d\n", p * 1000);
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, s = 10000;
cin >> n;
n++;
while (n--) {
s += 500;
}
cout << s << 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(void) {
int x = 100000, i, n;
scanf("%d", &n);
for (i = 0; i < n; i++) {
x = x * 1.05;
if (x % 1000 != 0) {
x = (x / 1000 + 1) * 1000;
}
}
printf("%d", 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 | UNKNOWN | #include <bits/stdc++.h>
double roundup(double x);
int main(void) {
double debt;
int debt2;
double rishi;
int n;
int i;
debt = 100000;
rishi = 1.05;
scanf("%d", &n);
for (i = 0; i < n; i++) {
debt = debt * rishi;
printf("case%d : debt=%f ", i, debt);
debt = roundup(debt / 1000);
debt *= 1000;
printf(": debt=%f\n", debt);
}
debt2 = (int)debt;
printf("%d\n", debt2);
return 0;
}
double roundup(double x) {
if (x != (int)x) {
x += 1;
x = (int)x;
}
return x;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int weeks = s.nextInt();
double debt = 10;
while(weeks>0){
debt = debt*1.05;
debt = (int)Math.ceil(debt);
weeks--;
}
System.out.println((int)debt*1000);
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
inline void scd(int &a) { scanf("%d", &a); }
inline void scdd(int &a, int &b) { scanf("%d %d", &a, &b); }
inline void sctd(int &a, int &b, int &c) { scanf("%d %d %d", &a, &b, &c); }
inline void scdlld(long int &a, long int &b) { scanf("%I64d %I64d", &a, &b); }
inline void sclld(long long int &a) { scanf("%I64d", &a); }
int main() {
int a = 100000;
int n;
scd(n);
a += (a * 5 * n) / 100;
a += 1000 * n;
printf("%d\n", a);
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
double cutup(double x) {
if (x - (double)((int)x / 1000) * 1000 > 0) {
x = (double)((((int)x / 1000) + 1) * 1000);
}
return x;
}
double money(double x, int target, int depth = 0) {
if (target == depth) {
return x;
}
return money(cutup(x * 1.05), target, depth + 1);
}
int main() {
std::cin.tie(0);
std::ios::sync_with_stdio(false);
int n, x;
cin >> n;
cout << money(100000., 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(void) {
int n, debt, i, amari, real;
scanf("%d", &n);
debt = 100000;
for (i = 0; i < n; i++) {
debt = debt * 1.05;
}
amari = debt % 10000;
real = debt - amari + 10000;
printf("%d", real);
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python2 | import math
def Interest(money,n):
for i in range(n):
money *= 1.05
money = math.ceil(money)
return money
m = 100
n = input()
print n
print int(Interest(m,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 given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int n, i;
int sum = 100000;
scanf("%d", &n);
for (i = 0; i < n; i++) {
sum += sum * 0.05;
}
if (sum % 1000 > 0) {
sum /= 10000;
sum *= 10000;
sum += 10000;
}
printf("%d\n", sum);
return (0);
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python2 | n=input()
m=105
for i in range(n-1):
m=m*21/20+1
print m*1000 |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | java | import java.util.*;
class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int debt = 100000;
int n = scanner.nextInt();
for (int i = 0; i < n; i++) {
debt = (int)(debt * 1.05);
}
debt = debt - (debt % 10000) + 10000;
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 | main(){10^puts("13530000");} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a 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;
public class Main {
public static void main(String[] args) throws IOException {
// 宣言
BigDecimal shakkin = new BigDecimal(100000);
BigDecimal taxper = new BigDecimal(0.05);
BigDecimal rishi;
int output = 0;
// 文字列の入力
BufferedReader input = new BufferedReader(new InputStreamReader(System.in), 1);
System.out.println("何週間ですか?");
int week = Integer.parseInt(input.readLine());
if (week >= 100) {
System.out.println("100以上は入力できません");
}
for (int i = 0; i <= week; i++) {
// 5%の利子を計算する
rishi = shakkin.multiply(taxper);
// 5%の利子を元金に足す
shakkin = shakkin.add(rishi);
}
// 1000円未満を切り上げる
output = shakkin.setScale(-3, BigDecimal.ROUND_UP).intValue();
System.out.println(output);
}
} |
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main(void) {
int n;
double y;
scanf("%f", &n);
printf("%f", 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 week = 0;
cin >> week;
int a = 100000;
for (int i = week; i--;) {
a *= 1.05;
}
cout << a << endl;
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 given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
double m = 100;
for (int i = 0; i < n; i++) {
m = ceil(m * 1.05);
}
cout << m * 1000 << endl;
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main() {
int n, x = 100000, y, i;
scanf("%d", &n);
for (i = 0; i < n; i++) {
x += 0.05 * x;
y = x / 10;
if (x - y * 10 == 0)
x = y * 10;
else
x = y * 10 + 10000;
}
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 | import java.util.Scanner;
public class Main {
// ????????????10??????
public static int LOAN = 100000;
public static void main(String[] args) {
// ???????????????
@SuppressWarnings("resource")
Scanner input = new Scanner(System.in);
double result = LOAN;
// ?????±??????????¨????
for (int i = 0; input.nextInt() > i; i++) {
// ??????????????????
result = result * 1.05;
// 1000??§?????????????????\??????????????????
result = Math.ceil(result / 1000);
// ?????????????????????
result = result * 1000;
}
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 | cpp | #include <bits/stdc++.h>
using namespace std;
int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};
int A = 0, B = 0, K = 0, T = 0, W = 0, N = 0, H = 0;
int n = 0;
double L = 0;
double S = 0;
double ar = 0, br = 0, cr = 0;
int answer = 0;
string C;
string sA, strB;
vector<vector<char>> map;
vector<double> num;
vector<string> str;
int sum = 0;
vector<int> value;
vector<int> weight;
int dp[110][10010];
int data_[210][2] = {-2};
void input(void) {
cin >> n;
return;
}
int main(void) {
input();
double money = 100000;
for (int i = 0; i < n; i++) {
money *= 1.05;
if ((int)money % 1000 > 0) {
money =
money - ((int)(money) % 1000) + 1000 - (money - (double)(int)money);
}
}
cout << money << endl;
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python3 | import math
week = int(input())
debt = 100000
for i in range(week):
debt = math.ceil(debt*1.05/1000)*1000
print(int(debt))
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 given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main() {
int n;
long int debt = 100000;
scanf("%d", &n);
int i;
for (i = 0; i < n; i++) {
debt *= 1.05;
if (debt % 10000 != 0) {
debt += 10000;
debt -= debt % 10000;
}
}
printf("%ld\n", debt);
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main(void) {
double loan = 100000;
int week;
cin >> week;
for (int i = 0; i < week; i++) {
loan *= 1.05;
}
loan /= 10000;
loan += 0.5;
int ans = (int)loan * 10000;
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 | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
int m = 100000;
while (n--) {
m = ceil(m * 1.05 / 1000) * 1000;
}
cout << m << endl;
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | #include <bits/stdc++.h>
int main() {
int n, i;
double sum, a = 100000;
scanf("%d", &n);
for (i = 0; i < n; i++) a *= 1.05;
sum = fmod(a, 10000);
sum = 10000 - sum;
printf("%.0f\n", a + 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 | cpp | #include <bits/stdc++.h>
using namespace std;
template <class T>
inline void chmax(T& a, T b) {
if (b > a) a = b;
}
template <class T>
inline void chmin(T& a, T b) {
if (b < a) a = b;
}
int main() {
int N;
float money = 100000;
cin >> N;
for (int i = 0; i < (int)(N); i++) {
money = (money + money * 0.05);
}
float m = money / 10000;
cout << ceil(m) * 10000 << endl;
return 0;
}
|
p00007 Debt Hell | Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks.
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Example
Input
5
Output
130000 | {
"input": [
"5"
],
"output": [
"130000"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
static const int ROUND = 10000;
int weeks;
double loan = 100000;
int temp;
int main() {
scanf("%d", &weeks);
while (weeks != 0) {
loan = loan * 1.05;
temp = loan / ROUND;
loan = (temp + 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 | UNKNOWN | #include <bits/stdc++.h>
int main() {
int n, i, t;
scanf("%d", &n);
for (i = 100000; n > 0; n--) {
i *= 1.05;
t = i % 1000;
if (t > 0) {
i = i + 1000 - t;
}
}
printf("%d", i);
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.