提交时间:2022-08-18 10:57:17
运行 ID: 55399
#include <bits/stdc++.h> using namespace std; template<typename T> inline void read(T &x) { char ch=getchar();x=0; while(!isdigit(ch)) ch=getchar(); while(isdigit(ch)) x=(x<<1)+(x<<3)+(ch&15),ch=getchar(); } int maxx,n,m,x,a[11]; int main() { // freopen("Declare.in","r",stdin); // freopen("Declare.out","w",stdout); read(n),read(m); for(int i=1; i<=n*m; i++) read(x),a[x]++; for(int i=1; i<=10; i++) if(a[i]) maxx=i; for(int i=maxx-1; i>=1; i--) a[i]+=a[i+1]; cout<<maxx<<endl; for(int i=1; i<=maxx; i++) cout<<a[i]<<endl; return 0; }