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 |
Re:超简单的方法!In Reply To:超简单的方法! Posted by:changzhiwin at 2008-07-23 17:43:10 我的和你的差不多,为什么我的就不能AC?? #include<iostream> #include<memory> using namespace std; main() { int tag[100]; int number; memset(tag,0,sizeof(tag)); while(cin>>number) { if(-1 == number) { break; } if(0==number) { int ans = 0; for(int i=1;i<50;i++) { if(tag[i]==1&&tag[2*i]==1) { ans++; } } cout<<ans<<endl; memset(tag,0,sizeof(tag)); } else { tag[number] = 1; } } //system("pause"); } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator