| Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 88677 | sh25_shenpy | 统计数字 | C++ | 通过 | 319 MS | 1032 KB | 370 | 2026-05-15 15:25:35 |
#include<bits/stdc++.h> using namespace std; int a[200005]; int n; int main(){ cin>>n; for(int i=1;i<=n;i++) cin>>a[i]; sort(a+1,a+1+n); int s=1; for(int i=1;i<=n;i++){ if(a[i]==a[i+1]) s++; //计数器加一 else{ cout<<a[i]<<" "<<s<<endl; //输出答案 s=1; //重置 } } return 0; }