摘要: #include <iostream>using namespace std;int n,m;int can;int jump(int position, int direction,int times ){if(times==2)can=0;if(can==1)return can;if(direction==1)position=position+times*2-1;if(direction==-1)position=position-times*2+1;if(position==m){can=1;return can;}if(position>0&&po 阅读全文
posted @ 2012-05-04 22:26 梨子 阅读(144) 评论(0) 推荐(0)
摘要: #include <iostream>#include <string>using namespace std;string a,b;int cacl(int n){ int i=n; int j=0; int all=0; while(i<a.length()) { while( j<b.length()) { if(a[i]==b[j]) { all++; j++; break; } j++; } if(j==b.length()) break; i++; } return all; }int main(vo... 阅读全文
posted @ 2012-05-04 10:05 梨子 阅读(112) 评论(0) 推荐(0)
摘要: #include <iostream>using namespace std;int main(){int shu[100001];int a=0,b=0,sum=0,max=0;int T ,l=0,h=0;cin>>T;if(T>=1&&T<=20){for(int i=0;i<T;i++){int N;cin>>N;for( a=0;a<N;a++)cin>>shu[a];for(l=0,h=0,sum=0,max=shu[0],a=0;a<N;a++){for( sum=0,b=a;b< 阅读全文
posted @ 2012-05-02 10:28 梨子 阅读(155) 评论(1) 推荐(0)