Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
61555 彭慕允 处理随机数 C++ Accepted 2 MS 660 KB 366 2023-12-10 11:17:43

Tests(10/10):


Code:

#include <bits/stdc++.h> using namespace std; int main() { int n, tmp , m=0; cin>> n; int t[100001]= {0}; for(int i=0; i<n; i++) { cin>>tmp; t[tmp]++; if(t[tmp] == 1) { m++; } } cout<<m<<endl; for(int i=0; i<=100000; i++) { if(t[i] != 0) { cout<<i<<" "; } //for(int j=0; j<t[i]; j++) { // cout<<i<<" "; //} } }