p1962求助QAQ

P1962 斐波那契数列

已解决,谢谢
by zi小眼聚光 @ 2019-01-10 19:16:21


#include<bits/stdc++.h> using namespace std; int main() { int n,a[100010]={INT_MIN,INT_MIN},p,t=0,x; cin>>n; for(int i=1;i<=n;i++) { cin>>x; int f=1; for(int j=1;j<=t;j++) if(x==a[j]) { f=0; break; } if(f==0)continue; t++; p=t; while(x<a[p-1]&&p>=1) { a[p]=a[p-1]; p--; } a[p]=x; } cout<<t<<endl; for(int i=1;i<=t;i++) cout<<a[i]<<" "; return 0; }
by 3346962731SUN @ 2019-01-13 13:11:18


@[3346962731SUN](/space/show?uid=155513) 希望更丰富的展现?[使用Markdown](https://www.luogu.org/wiki/show?name=%E5%B8%AE%E5%8A%A9%EF%BC%9Amarkdown)
by Jayun @ 2019-01-26 19:37:16


|