提交时间:2022-08-18 10:59:32
运行 ID: 55423
#include<bits/stdc++.h> using namespace std; int num[15],add[15],x,n,m,Max=0; inline long long read(){ register long long x=0,f=0; register char t=getchar(); while(t<'0'||t>'9')f^=(t=='-'),t=getchar(); while(t>='0'&&t<='9')x=(x<<3)+(x<<1)+(t^48),t=getchar(); return f?-x:x; } int main(){ n=read(),m=read(); for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ x=read(); num[x]++; } } int k=1; while(num[k]) k++; k--; printf("%d\n",k); for(int i=k;i>0;i--) add[i]=add[i+1]+num[i]; for(int i=1;i<=k;i++) printf("%d\n",add[i]); return 0; }