摘要:
#include<iostream>#include<vector>using namespace std;void out(int,int);void main(){out(5,8);}void out(int a,int b){static vector<int> result;if(a<=0||b<=0)return;if(b>=a){result.push_back(a);int end=b-a;int begin=a-1;if(end>0){out(begin,end);}if(end==0){for(vector<i
阅读全文
posted @ 2012-05-29 23:27
cs_jin_scor
阅读(192)
推荐(0)
编辑
摘要:
#include<iostream>using namespace std;bool ifpossible(int*,int*,int);void main(){int lhs[]={1,2,3,4,5};int rhs[]={4,3,2,1,5};cout<<ifpossible(lhs,rhs,5)<<endl;}bool ifpossible(int *in,int *out,int len){int num=0;int *stack=new int[len];int *end=in+len;for(int i=0;i<len;i++){if(n
阅读全文
posted @ 2012-05-29 00:44
cs_jin_scor
阅读(650)
推荐(1)
编辑