提交时间:2022-08-18 11:01:29
运行 ID: 55435
#include<bits/stdc++.h> #define N 5005 using namespace std; inline int read(){ int x(0),f(1);char ch(getchar()); while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=(x<<1)+(x<<3)+(ch^48),ch=getchar();} return x*f; } int n,m,k,h[15]; int main(){ // freopen("Declare.in","r",stdin); // freopen("Declare.out","w",stdout); n=read();m=read(); for(int i(1);i<=n*m;++i){ int x(read());k=max(k,x); ++h[1];--h[x+1]; } printf("%d\n",k); for(int i(1);i<=k;++i) printf("%d\n",h[i]+=h[i-1]); return 0; }