上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 37 下一页
摘要: 根据姥姥提示,入栈顺序就是先序遍历,出栈顺序就是中序遍历。然后在用solve函数进行递归分治来求出后序遍历的结果。#include #include #include #include #include #include #include #include #include#incl... 阅读全文
posted @ 2015-05-08 21:56 xryz 阅读(115) 评论(0) 推荐(0) 编辑
摘要: A Find the Spy/* ***********************************************Author :xryzEmail :523689985@qq.comCreated Time :2015/4/12 13:... 阅读全文
posted @ 2015-05-08 21:13 xryz 阅读(131) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#include#include#includeusing namespace std;const int N=100000+5;int bin[N],ans[N];mapm;int Find(int x){ while(bin[... 阅读全文
posted @ 2015-05-08 11:04 xryz 阅读(90) 评论(0) 推荐(0) 编辑
摘要: #includeint main(){ int i,m,x,y,n,ans,num; while(~scanf("%d%d",&n,&m)&&n&&m) { ans=0; for(i=1; i=m) break; } ... 阅读全文
posted @ 2015-05-07 19:30 xryz 阅读(90) 评论(0) 推荐(0) 编辑
摘要: #include#includeint main(){ int n,i,ans,len,tmp,d,t,m; while(~scanf("%d",&n)) { ans=0; for(i=0;i0) { ... 阅读全文
posted @ 2015-05-07 18:49 xryz 阅读(117) 评论(0) 推荐(0) 编辑
摘要: #include#include#includeusing namespace std;int main(){ int a[20],b[20],i,len1,len2,flag,j,t,d; char s[25],s2[25]; while(~scanf("%s",... 阅读全文
posted @ 2015-05-07 18:00 xryz 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 本题测试点5是从小岛范围内可以直接跳到岸边…… 测试点4是验证步数第一跳最小的情况,刚开始没有考虑回溯,所以错了……#include #include #include #include #include #include #include #include #include #in... 阅读全文
posted @ 2015-05-06 22:39 xryz 阅读(331) 评论(0) 推荐(0) 编辑
摘要: 就是按照贪心的思路来,分成第一张牌翻不翻来考虑,接下来每次搜索看前面一张是0还是1,1的话就翻,最后看一下最后一张牌的状态。#include#include#includeusing namespace std;const int inf=1<<30;int ans,len,a[25... 阅读全文
posted @ 2015-05-06 11:50 xryz 阅读(100) 评论(0) 推荐(0) 编辑
摘要: #includeconst int _=100000+5;int bin[_],vis[_];int _find(int x){ while(x!=bin[x]) x=bin[x]; return x;}void intt(){ int i; for(i=1;... 阅读全文
posted @ 2015-05-05 21:52 xryz 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 二分查找#include#include#includedouble pi=2*acos(-1.0);double ex=1e-5;int main(){ int T,n,f,_,cnt,flag,i; double a[10000+24], Max,Min,Mid; ... 阅读全文
posted @ 2015-05-05 15:18 xryz 阅读(88) 评论(0) 推荐(0) 编辑
上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 37 下一页