Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
81249 尚雨钒 处理随机数 C++ Accepted 1 MS 280 KB 292 2024-07-12 11:04:22

Tests(10/10):


Code:

#include <iostream> using namespace std; int a[1001]; int main() { int n,k,sum=0; cin>>n; for(int i=1; i<=n; i++) { cin>>k; if(a[k]==0) { a[k]=1; sum++; } } cout<<sum<<endl; for(int j=1; j<=1000; j++) { if(a[j]!=0){ cout<<j<<" "; } } return 0; }