FZU Problem 2244 Daxia want to buy house
模拟题,注意:
1、那两个贷款都是向银行贷的,就是两个贷款的总额不能超过70%,就算公积金贷款能贷也不行,我开始的时候以为公积金贷款是向公司借的,,欺负我这些小白嘛....
2、最坑的地方 *0.7是wa的,要*7/10
3、那个公式的-1不是减在月份上的,是减在总体上的
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
#define inf (0x3f3f3f3f)
typedef long long int LL; #include <iostream>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <string>
int price_house,max_fund;
double rate_bussiness,rate_fund;
int year;
double calc (int all,double rate,int mon)
{
all *= ;
mon *= ;
rate /= ;
rate /= ;
double ans = all*(rate*pow(+rate,mon*1.0))/(pow(+rate,mon*1.0)-);
return ans;
}
void work ()
{
//cout<<calc(107,rate_bussiness,20)<<endl;
int total = (int)floor(0.7*price_house);
int pr_begin=;
double pr_month=;
if (total >= max_fund)
{
total -= max_fund;
pr_month += calc(max_fund,rate_fund,year);
pr_month += calc(total,rate_bussiness,year);
pr_begin = price_house - total - max_fund;
printf ("%d %0.0f\n",pr_begin,pr_month);
return ;
}
else
{
pr_month += calc(total,rate_fund,year);
pr_begin = price_house - total;
printf ("%d %0.0f\n",pr_begin,pr_month);
}
return ;
}
int main()
{
#ifdef local
freopen("data.txt","r",stdin);
#endif
while(scanf("%d%d%lf%lf%d",&price_house,&max_fund,&rate_bussiness,&rate_fund,&year)!=EOF)
work();
return ;
}
FZU Problem 2244 Daxia want to buy house的更多相关文章
- 【模拟】FOJ 2244 Daxia want to buy house
题目链接: http://acm.fzu.edu.cn/problem.php?pid=2244 题目大意: 每月还款额=贷款本金×[月利率×(1+月利率)^还款月数]÷[(1+月利率)^还款月数-1 ...
- FZU Problem 2238 Daxia & Wzc's problem
Daxia在2016年5月期间去瑞士度蜜月,顺便拜访了Wzc,Wzc给他出了一个问题: Wzc给Daxia等差数列A(0),告诉Daxia首项a和公差d; 首先让Daxia求出数列A(0)前n项和,得 ...
- FZu Problem 2233 ~APTX4869 (并查集 + sort)
题目链接: FZu Problem 2233 ~APTX4869 题目描述: 给一个n*n的矩阵,(i, j)表示第 i 种材料 和 第 j 种材料的影响值,这个矩阵代表这n个物品之间的影响值.当把这 ...
- FZu Problem 2236 第十四个目标 (线段树 + dp)
题目链接: FZu Problem 2236 第十四个目标 题目描述: 给出一个n个数的序列,问这个序列内严格递增序列有多少个?不要求连续 解题思路: 又遇到了用线段树来优化dp的题目,线段树节点里 ...
- 翻翻棋(找规律问题)(FZU Problem 2230)
题目是这样的: FZU Problem 2230 象棋翻翻棋(暗棋)中双方在4*8的格子中交战,有时候最后会只剩下帅和将.根据暗棋的规则,棋子只能上下左右移动,且相同的级别下,主动移动到地方棋子方将吃 ...
- fzu Problem 2148 Moon Game(几何 凸四多边形 叉积)
题目:http://acm.fzu.edu.cn/problem.php?pid=2148 题意:给出n个点,判断可以组成多少个凸四边形. 思路: 因为n很小,所以直接暴力,判断是否为凸四边形的方法是 ...
- fzu Problem 2140 Forever 0.5(推理构造)
题目:http://acm.fzu.edu.cn/problem.php?pid=2140 题意: 题目大意:给出n,要求找出n个点,满足: 1)任意两点间的距离不超过1: 2)每个点与(0,0)点的 ...
- Fzu Problem 2082 过路费 LCT,动态树
题目:http://acm.fzu.edu.cn/problem.php?pid=2082 Problem 2082 过路费 Accept: 528 Submit: 1654Time Limit ...
- FZU Problem 2169 shadow
http://acm.fzu.edu.cn/problem.php?pid=2169 题目大意: S王国有N个城市,有N-1条道路.王都为编号1的城市.叛军驻扎在很多城市.除了王都外有K个城市有军队, ...
随机推荐
- 牛客网字节跳动冬令营网络赛J Sortable Path on Tree —— 点分治
题目:https://ac.nowcoder.com/acm/contest/296/J 用点分治: 记录了值起伏的形态,二元组 (x,y) 表示有 x 个小于号,y 个大于号: 因为小于号和大于号都 ...
- Poj 1125 Stockbroker Grapevine(Floyd算法求结点对的最短路径问题)
一.Description Stockbrokers are known to overreact to rumours. You have been contracted to develop a ...
- 【转】 Pro Android学习笔记(四一):Fragment(6):数据保留
目录(?)[-] 通过fragment参数实现数据保留 对TitleFragment进行修改 对DetailActivity进行修改 通过savedInstanceState进行数据保留 保留frag ...
- mysql命令之一:mysql常用命令之一
一.登录 1.本地登录:MySQL 连接本地数据库,用户名为“root”,密码“123”(注意:“-p”和“123” 之间不能有空格) C:\>mysql -h localhost -u roo ...
- centos6 搭建IPSEC
http://www.maxwhale.com/how-to-install-l2tp-vpn-on-centos/ http://blog.earth-works.com/2013/02/22/ho ...
- 进程中t.start(), t.daemon() t.jion()的使用
#!/usr/bin/env python import multiprocessing import time def f1(a1): time.sleep(2) print(a1) if __na ...
- sql 删除重复数据保留一条
--创建测试表 CREATE TABLE TEST ( DEPTNO ), DNAME ), LOC ) ); --插入测试数据 , 'test1', 'test2'); , 'test1', 'te ...
- mooon模板的automake、autoconf、m4和libtool版本信息
autoconf --version autoconf (GNU Autoconf) 2.59 automake --version automake (GNU automake) 1.9.6 m4 ...
- Linux中Root用户密码变更、密码忘记
用户设置bash的时候,错把root的bash改为bin/bash,注意,不是“/bin/bash”!. 然后就登录不了root了,也修改不了/etc/passwd了. 解决: 1.重启Ubuntu, ...
- windows下编译Boost库
下载源码 boost_1_66_0.7z 生成编译工具 D:\Project\boost_1_66_0> bootstrap.bat 配置Python环境变量(使用VS2017自带的32位pyt ...