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:0ms STL 一次AC 爽!In Reply To:Re:0ms STL 一次AC 爽! Posted by:palqing at 2010-11-18 17:42:53 #include<iostream> #include<set> #include<vector> using namespace std; int main() { set<int> sts; sts.insert(1); int n; set<int>::iterator it=sts.begin(); for(int i=1;i!=1300;i++) { n=*it; sts.insert(n*2); sts.insert(n*3); sts.insert(n*5); ++it; } vector<int> vec(sts.begin(),sts.end()); int num; while(cin>>num) { if(num==0) break; cout<<vec[num-1]<<endl; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator