标签:cst bsp oss ref rate sep new text send
Time Limit: 1000MS | Memory Limit: 10000K | |
Total Submissions: 19103 | Accepted: 8101 |
Description
Input
Output
Sample Input
7
Sample Output
3 4
Source
#include<cstdio> #include<algorithm> #include<iostream> #include<cstring> using namespace std; int n,tot,f[10008],ans,sum; int main(){ while(scanf("%d",&n)==1){ tot=0; memset(f,0,sizeof(f)); sum=n; for(int i=2;i<=n&&i<=sum;i++){ tot++; f[tot]=i; sum=sum-i; } if(sum==tot+1) f[tot]++; for(int i=tot;i>=tot-sum+1;i--) f[i]++; for(int i=1;i<tot;i++) printf("%d ",f[i]); if(tot) printf("%d",f[tot]); printf("\n"); } }
标签:cst bsp oss ref rate sep new text send
原文地址:http://www.cnblogs.com/WQHui/p/7598469.html