Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
55447 . T1 表白 C++ 通过 100 49 MS 248 KB 778 2022-08-18 11:02:47

Tests(9/9):


#include <bits/stdc++.h> 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*10+ch-48;ch=getchar();} return x*f; } template<typename T> inline void write(T X){ if(X<0){ putchar('-');X=~(X-1);} int s[50],top=0; while(X){ s[++top]=X%10;X/=10;} if (!top) s[++top]=0; while(top) putchar(s[top--]+'0'); putchar('\n'); return; } int Map,n,m,num[15],cnt=10,k; int main(){ n=read(),m=read(); for(int i=1;i<=n;i++) for(int j=1;j<=m;j++) Map=read(),num[Map]++; while(!num[cnt]) cnt--; write(cnt); k=n*m; for(int i=1;i<=cnt;i++) write(k),k-=num[i]; return printf("\n"),0; }


测评信息: