摘要: #includeusing namespace std;#include#include#define maxn 200005int h,n,w;int root[maxn200000) h=200000; make_tree(1,h,1); while(n--) { int a; ans=-1; scanf("%d",&a); query(a,1,h,1); printf("%d\n",ans); } } retur... 阅读全文
posted @ 2013-07-26 08:21 邹济岳 阅读(142) 评论(0) 推荐(0)
摘要: 题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=2147多看看,多比划比划就出来了代码:#includeusing namespace std;int main(){ int n,m; while(cin>>n>>m) { int sum; if(n==0&&m==0) break; if(n==1&m==1) cout<<"What a pity!"<<endl; else { sum=n*m;... 阅读全文
posted @ 2013-07-21 16:05 邹济岳 阅读(250) 评论(0) 推荐(0)
摘要: #include#include#include#includeusing namespace std;int a[30];int makes[30];int isprime[10001];void bfs(int u,int n){ if(u==n) { if(isprime[a[u-1]+1]) { printf("%d",a[0]); for(int i=1;i<n;i++) printf(" %d",a[i]); cout<<endl; ... 阅读全文
posted @ 2013-07-21 15:59 邹济岳 阅读(218) 评论(0) 推荐(0)