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 |
顶!顶!顶!In Reply To:太ft了,竟然真的是用iostream导致超时的,打击了,直接郁闷啊! Posted by:lianxi at 2005-09-20 14:53:18 又学到一课了!呵呵 #include <iostream> #include <algorithm> using namespace std; int main() { int line; int num[1024]={0}; int n,k; cin>>line; while(line>0) { cin>>n>>k; for(int i=0;i<n;i++) //cin>>num[i]; scanf("%d",&num[i]); while(k>0) { k--; next_permutation(num,num+n); } for(int j=0;j<n;j++) printf("%d ",num[j]); cout<<endl; line--; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator