CodeFroces-- 514.div2.C-Sequence Transformation

题目链接 : 514.div2.C-Sequence Transformation

#include
using namespace std;
#define maxn 1000011
int a[maxn];
int main(){
  int n;
  cin>>n;
  int y=1,t=0;
  while(n>1){
     int x=0,z;
     for(int j=2;j<=n;j++){
        if(n/j>=x){
           x=n/j;
           z=j;
        }
     }
     for(int j=1;j<=n;j++){
       if(j%z!=0){
          a[t++]=y;
       }
     }
     n/=z;
     y*=z;
  }
  a[t++]=y;
  for(int j=0;j){
      cout<" ";
  }
}

 

转载于:https://www.cnblogs.com/DyLoder/p/9915264.html

你可能感兴趣的:(CodeFroces-- 514.div2.C-Sequence Transformation)