南京网站设计哪家好,wordpress sae 主题,iis做网站视,南京网站设计个人Problem - D - Codeforces
题意#xff1a; 思路#xff1a;
如果需要构造一个和为定值的序列#xff0c;那么考虑n-d,n-d1,.....nd-1,nd这种形式
如果要保证不能重复#xff0c;那么先考虑一个排列#xff0c;然后在排列上操作
如果根据小数据构造出了一些简单情形 思路
如果需要构造一个和为定值的序列那么考虑n-d,n-d1,.....nd-1,nd这种形式
如果要保证不能重复那么先考虑一个排列然后在排列上操作
如果根据小数据构造出了一些简单情形那么请继续使用这种构造方法构造别的情形 Code
#include bits/stdc.h#define int long longusing namespace std;const int mxn1e510;
const int mxe5e510;int N;void solve(){cinN;if(N%21){N;for(int iN/21;iN-1;i) couti ;for(int iN2;iN/2N1;i) couti \n[iN/2N1];}else{for(int iN/2;iN-1;i) couti ;for(int iN1;iN/2N;i) couti \n[iN/2N];}
}
signed main(){ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);int __1;cin__;while(__--)solve();return 0;
}