Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
55405 _JF_ T1 表白 C++ 通过 100 113 MS 248 KB 644 2022-08-18 10:57:33

Tests(9/9):


#include <bits/stdc++.h> using namespace std; int maxn = -1, n, m, i, j, ans[11], tmp; 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 - '0', ch = getchar(); return x * f; } int main() { n = read(); m = read(); int nm = n * m; ans[1] = nm; for (i = 1; i <= nm; i++) { tmp = read(); maxn = max(maxn, tmp); while (tmp >= 2) { ans[tmp]++; tmp--; } } cout << maxn << endl; for (i = 1; i <= maxn; i++) { cout << ans[i] << endl; } return 0; }


测评信息: