摘要:
View Code1#include<iostream>2#include<cstdio>3#include<algorithm>4usingnamespacestd;5structnode6{7intp,m;8}arr[110];9intcmp(nodex,nodey)10{11returnx.p>y.p;12}13intmain()14{15intv,n;16while(scanf("%d",&v)!=EOF)17{18if(v==0)19break;20scanf("%d",&n);21fo 阅读全文
摘要:
View Code1#include<iostream>2#include<cstdio>3#include<algorithm>4usingnamespacestd;5structnode6{7intl,w;8}arr[5100];9intvis[5100];10intcmp(nodex,nodey)11{12if(x.l==y.l)13returnx.w<y.w;14else15returnx.l<y.l;16}17intmain()18{19intt,n;20scanf("%d",&t);21while(t--) 阅读全文
摘要:
View Code1#include<iostream>2#include<cstdio>3#include<math.h>4usingnamespacestd;5intmain()6{7intn,u,d;8while(cin>>n>>u>>d)9{10if(n+u+d==0)11break;12intans=(int)(ceil((n-u)*1.0/(u-d)))*2+1;13printf("%d\n",ans);14}15return0;16 阅读全文