上一页 1 2 3 4 5 6 7 ··· 11 下一页
摘要: #include#include#includeusing namespace std;struct node{ __int64 num,pre,next;};int main(){ int n; freopen("in.txt","r",stdin); while(sca... 阅读全文
posted @ 2014-11-13 20:48 天I火 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 这里先只考虑x,y都大于0的情况如果x^2+y^2=r^2,则(r-x)(r+x)=y*y令d=gcd(r-x,r+x),r-x=d*u^2,r+x=d*v^2,显然有gcd(u,v)=1且u#include #include #include #include #include #include ... 阅读全文
posted @ 2014-11-11 20:15 天I火 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 习题8-1 Uva1149 11.8 #include #include using namespace std;int main(){// freopen("in.txt","r",stdin); int T; cin>>T; while(T--) { int n, m, mi; ... 阅读全文
posted @ 2014-11-08 19:17 天I火 阅读(278) 评论(0) 推荐(0) 编辑
摘要: 习题7-1,UVa208,Time:11.6#include #include #include using namespace std;vectormap[10005];int vis[1005];int dfs(int s, int t, int n, int tmp[]){ if(s == t... 阅读全文
posted @ 2014-11-06 19:41 天I火 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 第一次刷书,感觉也是不一样,每天都有目标,也给了希望第六章说是数据结构,我倒是没那么多感觉是,递归用得挺多,还有vector,queue,等STL有很多题目不是做不出,其实只是想的时间少,不敢做,所以,刷书,是进步的,最好的,选择。11月6号,第七章开始 阅读全文
posted @ 2014-11-06 00:02 天I火 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 习题6-1,UVa673,Time:11.1#include #include#include#include#include#include using namespace std;int main() { int Case; string str; bool flag; ... 阅读全文
posted @ 2014-11-01 21:54 天I火 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 【功能】Tarjan算法的用途之一是,求一个有向图G=(V,E)里极大强连通分量。强连通分量是指有向图G里顶点间能互相到达的子图。而如果一个强连通分量已经没有被其它强通分量完全包含的话,那么这个强连通分量就是极大强连通分量。【算法思想】用dfs遍历G中的每个顶点,通dfn[i]表示dfs时达到顶点i... 阅读全文
posted @ 2014-10-29 08:46 天I火 阅读(305) 评论(0) 推荐(0) 编辑
摘要: Largest Rectangle in a HistogramTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 11706Accepted Subm... 阅读全文
posted @ 2014-10-28 19:16 天I火 阅读(119) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #include #include using namespace std;long long num[1000005];long long fz[1000005];long long xds[1000005]... 阅读全文
posted @ 2014-10-19 15:16 天I火 阅读(108) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include using namespace std;struct node{ int f, s;};vectorimap[40005];int deep[40005];int dis[40005];int fa[40005... 阅读全文
posted @ 2014-10-19 11:24 天I火 阅读(111) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 11 下一页