Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
給個代媽#include <stdio.h> int main() { while(1){ int f; scanf("%d",&f); if(f>>31)break; int st[55] = {0}, gs=0; while(1){ int k; scanf("%d",&k); if(f<=50){ st[f]++; if(!(st[f]^3))gs++; } if(!(f%2)){ st[f/2]+=2; if(!(st[f/2]^3))gs++; } if(!k)break; f=k; } printf("%d\n",gs); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator