1755: [Usaco2005 qua]Bank Interest】的更多相关文章

1755: [Usaco2005 qua]Bank Interest Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 187  Solved: 162[Submit][Status][Discuss] Description Farmer John made a profit last year! He would like to invest it well but wonders how much money he will make. He kn…
原来强行转int可以避免四舍五入啊 #include<iostream> #include<cstdio> using namespace std; int r,y; double m; int main() { scanf("%d%lf%d",&r,&m,&y); double l=1.0+(double)r/100.0; for(int i=1;i<=y;i++) m*=l; printf("%d\n",(i…
Description Farmer John made a profit last year! He would like to invest it well but wonders how much money he will make. He knows the interest rate R (an integer between 0 and 20) that is compounded annually at his bank. He has an integer amount of…
1754: [Usaco2005 qua]Bull Math Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 374  Solved: 227[Submit][Status] Description Bulls are so much better at math than the cows. They can multiply huge integers together and get perfectly precise answers ... o…
1751: [Usaco2005 qua]Lake Counting Time Limit: 5 Sec  Memory Limit: 64 MB Submit: 168  Solved: 130 [Submit][Status] Description Due to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N x…
Bank Interest Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 131072/65536K (Java/Other) Total Submission(s) : 45   Accepted Submission(s) : 18 Problem Description Farmer John made a profit last year! He would like to invest it well but wonder…
1753: [Usaco2005 qua]Who's in the Middle Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 290  Solved: 242[Submit][Status][Discuss] Description FJ is surveying his herd to find the most average cow. He wants to know how much milk this 'median' cow gives…
1754: [Usaco2005 qua]Bull Math Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 398  Solved: 242[Submit][Status][Discuss] Description Bulls are so much better at math than the cows. They can multiply huge integers together and get perfectly precise answ…
1751: [Usaco2005 qua]Lake Counting Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 190  Solved: 150[Submit][Status][Discuss] Description Due to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle…
bzoj3384[Usaco2004 Nov]Apple Catching 接苹果 bzoj1750[Usaco2005 qua]Apple Catching 题意: 两棵树,每分钟会从其中一棵树上掉一个苹果下来,捡苹果的人只愿意W次,问初始在树1处最多能捡多少苹果.分钟数≤1000,W≤30. 题解: dp.f[i][j][0/1]表示第i分钟移动了j次现在在第2/1棵树下.具体看代码. 代码: #include <cstdio> #include <cstring> #incl…
一.Description Farmer John made a profit last year! He would like to invest it well but wonders how much money he will make. He knows the interest rate R (an integer between 0 and 20) that is compounded annually at his bank. He has an integer amount o…
Description Bulls are so much better at math than the cows. They can multiply huge integers together and get perfectly precise answers ... or so they say. Farmer John wonders if their answers are correct. Help him check the bulls' answers. Read in tw…
Description FJ is surveying his herd to find the most average cow. He wants to know how much milk this 'median' cow gives: half of the cows give as much or more than the median; half give as much or less. Given an odd number of cows N (1 <= N < 10,0…
Description It is a little known fact that cows love apples. Farmer John has two apple trees (which are conveniently numbered 1 and 2) in his field, each full of apples. Bessie cannot reach the apples when they are on the tree, so she must wait for t…
Description Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty sleep, so she wants to get back as quickly as possible. Farmer Joh…
[算法]高精度乘法 #include<cstdio> #include<algorithm> #include<cstring> using namespace std; ; char s1[maxn],s2[maxn]; int a[maxn],b[maxn],c[maxn],lena,lenb,lenc; int main(){ scanf("%s%s",s1,s2); lena=strlen(s1);lenb=strlen(s2); ;i<…
--这可能是早年Pascal盛行的时候考排序的吧居然还是Glod-- #include<iostream> #include<cstdio> #include<algorithm> using namespace std; const int N=100005; int n,a[N]; int read() { int r=0,f=1; char p=getchar(); while(p>'9'||p<'0') { if(p=='-') f=-1; p=ge…
高精乘法板子 然而WA了两次也是没救了 #include<iostream> #include<cstdio> #include<cstring> using namespace std; const int N=105; int la,lb,lc,a[N],b[N],c[N],tot; char ch[N]; int main() { scanf("%s",ch+1); la=strlen(ch+1); for(int i=1;i<=la;i…
bzoj上的usaco题目还是很好的(我被虐的很惨. 有必要总结整理一下. 1592: [Usaco2008 Feb]Making the Grade 路面修整 一开始没有想到离散化.然后离散化之后就很好做了.F[I,j]表示第i个点,高度>=j或<=j,f[I,j]=min(f[i-1,j]+abs(b[j]-a[i]),f[I,j-1]) 1593: [Usaco2008 Feb]Hotel 旅馆 线段树 ★1594: [Usaco2008 Jan]猜数游戏 二分答案然后写线段树维护 15…
Search GO 说明:输入题号直接进入相应题目,如需搜索含数字的题目,请在关键词前加单引号 Problem ID Title Source AC Submit Y 1000 A+B Problem 10983 18765 Y 1036 [ZJOI2008]树的统计Count 5293 13132 Y 1588 [HNOI2002]营业额统计 5056 13607 1001 [BeiJing2006]狼抓兔子 4526 18386 Y 2002 [Hnoi2010]Bounce 弹飞绵羊 43…
本篇博客按照题号排序(带*为推荐题目) 1008 [HNOI2008]越狱 很经典的题了..龟速乘,龟速幂裸题,, 1010 [HNOI2008]玩具装箱toy* 斜率优化 基本算是裸题. 1012 最大数 单调队列/单调栈 随便搞一搞就好 (水题...) 1045 糖果传递(双倍经验请做 3293 分金币) 贪心+中位数  排序后搞一搞可过..(水题...) 1051 受欢迎的牛* tarjan (提高T1+ -- T2难度) 1106: [POI2007]立方体大作战tet* 树状数组+贪心…
续.....TAT这回不到50题编辑器就崩了.. 这里塞40道吧= = bzoj 1585: [Usaco2009 Mar]Earthquake Damage 2 地震伤害 比较经典的最小割?..然而一开始还是不会QAQ 和地震伤害1的区别在于这题求的是最少的损坏牧场数目.把牧场拆点,因为要让1和被报告的点不联通,把1归到S集,被报告的点归到T集,就变成求最小割了. 具体建图: 假设点拆成x和x’,x和x‘间连边(就是等下要割的).被报告的点和1点:容量无穷大(不能割):其他点容量为1. 原图中…
接下来要滚去bzoj刷usaco的题目辣=v=在博客记录一下刷题情况,以及存一存代码咯.加油! 1.[bzoj1597][Usaco2008 Mar]土地购买 #include<cstdio> #include<algorithm> #include<cstring> using namespace std; ; int n,cnt,q[N]; long long x[N],y[N],f[N]; struct node{long long x,y;}a[N]; bool…
听说KPM初二暑假就补完了啊%%% 先刷Gold再刷Silver(因为目测没那么多时间刷Silver,方便以后TJ2333(雾 按AC数降序刷 ------------------------------------------------------------------------------------------------------- bzoj1597: [Usaco2008 Mar]土地购买  斜率优化DP h升序,w降序. f[i]=min(f[j]+h[i]*w[j+1])…
bzoj 1606: [Usaco2008 Dec]Hay For Sale 购买干草——背包 #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int read(){ ,f=,c=getchar(); ; c=getchar();} +(c-'); c=getchar();} return ans*f; } ],k; int main() { h=read(); n=…
1.1编程基础之输入输出01:Hello, World! 02:输出第二个整数PS:a,b需用longint类型接收 03:对齐输出 04:输出保留3位小数的浮点数 05:输出保留12位小数的浮点数 08:字符三角形 09:字符菱形 10:超级玛丽游戏 1.2编程基础之变量定义.赋值及转换01:整型数据类型存储空间大小 02:浮点型数据类型存储空间大小PS:可利用sizeof函数 03:其他基本数据类型存储空间大小 04:填空:类型转换1 05:填空:类型转换2 06:浮点数向零舍入 07:打印…
感谢范意凯.陈申奥.庞可.杭业晟.王飞飏.周俊豪.沈逸轩等同学的收集整理.   题号:1003 Hangover求1/2+1/3+...1/n的和,问需多少项的和能超过给定的值 类似于Zerojudge a625 题号:1004 Financial Management 求12个实数的平均值   题号:1008 Maya Calendar 玛雅历 此题语言可选中文 PS:注意Haab历的日期是从0开始,而Tzolkin历的日期是从1开始   题号:1067 取石子游戏 此题语言为中文 PS:请百…
#-*- coding:utf-8 -*-#定义银行类,包含属性:用户名,账户,余额:包含方法有:查询余额,存钱,取钱class BankAccount(): def __init__(self,name,account,balance): self.name=name self.account=account self.balance=balance def printBalance(self): print "My balance is ",self.balance def sav…
bzoj 2197: [Usaco2011 Mar]Tree Decoration 树形dp..f[i]表示处理完以i为根的子树的最小时间. 因为一个点上可以挂无数个,所以在点i上挂东西的单位花费就是i所在子树里的最小单位花费.. 所以每次求f[i]只要使子树里的数量都满足要求就好了..i的祖先还要更多的话随时可以选某个节点多挂一些.. f[i]=sum{f[j]}+mincost[i]*max(need[i]-sum{need[j]},0)..(j是i的儿子,mincost[i]表示子树i里的…
UPD:我真不是想骗访问量TAT..一开始没注意总长度写着写着网页崩了王仓(其实中午的时候就时常开始卡了= =)....损失了2h(幸好长一点的都单独开了一篇)....吓得赶紧分成两坨....TAT.............. —————————————————————————————————————————————————————————————————————————————— 写(被虐)了整整一个月b站上usaco的金组题...然而到现在总共只写了100道上下TAT(当然是按AC人数降序排…