
HDU
topc0o0der
这个作者很懒,什么都没留下…
展开
-
1006
关键是精度;3600*24=86400;10E-4题目要求的是10E-5所以最少也要把一秒分为10份,但是我分到1000才对的。为啥呢,其实算上四舍五入的话,题目要求E-6,而计算时应该更小,因为有累加效果。当然我的这个方法会超时,没事,打表就行了。#include #include #include #include using namespace std;int t;int min(int a,int b){return a>b?b:a;}int abs(int a){return a>0?a:-a;}原创 2010-11-05 11:26:00 · 428 阅读 · 0 评论 -
1021
贴个模板 #include #include using namespace std; int mat[2][2]; int fmat[32][2][2]; int tmp[2][2]; int e[2][2]={1,0,0,1}; int r[2][2]; void pre(){ memcpy(fmat,e,sizeof(e)); memcpy(fmat[1],mat,sizeof(mat)); ////////////////////////原创 2010-11-06 23:35:00 · 804 阅读 · 0 评论 -
1029
stl水过 值得一提的是这道题规定大于等于一般,所以有种更好的方法,就是加减,结果的值一定大于等于0; #include #include using namespace std; int main(){ map hash; int n,tmp; while(~scanf("%d",&n)){ hash.clear(); for(int i=0; i::iterator it; fo原创 2010-11-06 16:49:00 · 389 阅读 · 0 评论 -
1023
明显的卡特兰数: http://baike.baidu.com/view/2499752.html 前几个数值: 1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, 58786, 208012, 742900, 2674440, 9694845, 35357670, 129644790, 477638700, 1767263190, 6564120420, 24466267020, 91482563640, 343059613650, 1289904147原创 2010-11-07 00:15:00 · 633 阅读 · 0 评论 -
hdu 1030
贪心思想,锻炼基本运算能力。 坐标采取中轴,水平;这样很好做 #include #include using namespace std;#define ABS(a) (a>0?a:-a)int main(){ int n,m; int fn,fm; int xn,xm; while(cin>>n>>m){ fn=ceil(sqrt(n)); fm=ceil(sqrt(m)); x原创 2010-11-08 05:57:00 · 671 阅读 · 0 评论 -
3689 浮云
<br />赛后a题都是浮云,就是不明白,之前怎么就连这么简单的题都不敢写。这种dp有什么,建个状态转移图不久ok了,什么时候我才不悲剧!!!!!!!!!!!<br />#include <iostream><br />#include <cstring><br />using namespace std;<br /><br />struct Node{<br /> int next[26];<br /> double p;<br />} node[10];<br /><br />struct原创 2010-11-12 22:46:00 · 499 阅读 · 0 评论 -
hdu 1564 证明 (2)
之前写了一个:http://blog.youkuaiyun.com/topc0o0der/article/details/5928391最近有个师弟又问,感觉当时写的不怎么好。绕来绕去。下面我精简一下证明。仍然拿奇数棋盘论证。设先手A,后手B,设A和B走过的棋子和为S。设当A和B的路径把棋盘第一次分割为两个部分的时候,一个部分棋盘个数为X1,另一个为X2,显然 X1+X2+S+1 = N*原创 2015-02-27 18:32:27 · 599 阅读 · 1 评论