提交时间:2022-08-18 10:58:10
运行 ID: 55410
#include<bits/stdc++.h> using namespace std; 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 n,m,sum[17],maxn,x,ans[17]; int main(){ // freopen("Declare.in","r",stdin); // freopen("Declare.out","w",stdout); n=read(),m=read(); for(int i=1;i<=n;i++) for(int j=1;j<=m;j++){ x=read(); maxn=max(maxn,x); sum[x]++; } for(int i=maxn;i>=1;i--) ans[i]=ans[i+1]+sum[i]; printf("%d\n",maxn); for(int i=1;i<=maxn;i++) printf("%d\n",ans[i]); return 0; }