求教大佬,这个为什么会wa

P1088 [NOIP2004 普及组] 火星人

你知道 ``` next_permutation(,); ``` 这个函数吗
by 钱逸凡 @ 2018-09-04 12:42:58


@[钱逸凡](/space/show?uid=28088) ....不会,必须用这个吗?
by 谪仙 @ 2018-09-06 12:27:34


@[谪仙](/space/show?uid=73854) 用这个很方便 可以去网上搜一下这个函数
by 钱逸凡 @ 2018-09-06 12:36:24


@[钱逸凡](/space/show?uid=28088) 我感觉我这个程序怎么写也没错啊,但是只ac了两个点
by 谪仙 @ 2018-09-06 23:13:55


@[谪仙](https://www.luogu.org/space/show?uid=73854) #include<bits/stdc++.h> using namespace std; int N,M,a[10010];仙 int main() { cin>>N>>M; for(int i=0;i<N;i++)cin>>a[i]; for(int i=0;i<M;i++)next_permutation(a,a+N); for(int i=0;i<N-1;i++)cout<<a[i] <<" "; cout<<a[N-1]; return 0; } 试试这个
by yzh_Error404 @ 2019-02-07 13:50:11


|