• Welcome to the world's largest Chinese hacker forum

    Welcome to the world's largest Chinese hacker forum, our forum registration is open! You can now register for technical communication with us, this is a free and open to the world of the BBS, we founded the purpose for the study of network security, please don't release business of black/grey, or on the BBS posts, to seek help hacker if violations, we will permanently frozen your IP and account, thank you for your cooperation. Hacker attack and defense cracking or network Security

    business please click here: Creation Security  From CNHACKTEAM

Recommended Posts

D.Divisions

含义:让你构造一个数列,使这个数列有k种除法,使除法分别增加和减少。

解:0,1比较特殊。对于k大于等于2的情况,可以发现,如果序列像111223333,那么k是\ (1 (2 {3}-1) (2 {2}-1) (2 {4}-1)),另一个1是空集。\

#includebits/stdc。h

使用命名空间std

矢量分辨率;

int main(){

int k;

CIN k;

if(k==0)cout ' 5 ' endl ' 2 3 1 5 4 ' endl;

else if(k==1)cout ' 6 ' endl ' 1 1 4 5 1 4 ' endl;

否则{

k-;

int ind=1;

while(k){

int CNT=0;

for(;cnt ){

if((1 (cnt 1)) - 1 k)破;

}

k-=(1cnt)-1;

while(CNT-)RES . push _ back(ind);

ind

}

cout RES . size()endl;

for(int I=0;IRES . size();i ){

cout RES“”;

}

cout endl

}

}

Link to comment
Share on other sites