标签:highlight mat http def height 英语 int max getchar
//Serene #include<algorithm> #include<iostream> #include<cstring> #include<cstdlib> #include<cstdio> #include<cmath> #include<vector> using namespace std; const int maxn=1e4+10,INF=0x3f3f3f3f; int T,n,a[maxn],now,f; int aa,ff;char cc; int read() { aa=0;cc=getchar();ff=1; while(cc<‘0‘||cc>‘9‘) { if(cc==‘-‘) ff=-1; cc=getchar(); } while(cc>=‘0‘&&cc<=‘9‘) aa=aa*10+cc-‘0‘,cc=getchar(); return aa*ff; } int main() { n=read(); while(n) { now=0;f=0; for(int i=1;i<=n;++i) a[i]=read(); sort(a+1,a+n+1); for(int i=1;i<=n;++i) { if(a[i]==a[i-1]) now++; else now=1; f=max(f,now); } printf("%d\n",f); for(int i=1;i<=f;++i) { printf("%d",a[i]); for(int j=i+f;j<=n;j+=f) printf(" %d",a[j]); printf("\n"); } n=read(); } return 0; }
标签:highlight mat http def height 英语 int max getchar
原文地址:http://www.cnblogs.com/Serene-shixinyi/p/7608034.html