Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
124665 | 罗锦墨 | 处理随机数 | C++ | Wrong Answer | 1 MS | 272 KB | 323 | 2025-07-12 10:55:06 |
#include<bits/stdc++.h> using namespace std; int a[1005]; int main() { int n,k,sum=0; cin>>n; while(n--){ cin>>k; a[k] =k; } for(int i=1;i<=1000;i++){ if(a[k]>0){ sum++; } } cout<<sum<<endl; for(int i=1;i<=1000;i++){ if(a[i]>0){ cout<<a[i]<<" "; } } return 0; }
------Input------
9 10 29 39 67 58 48 29 57 23
------Answer-----
8 10 23 29 39 48 57 58 67
------Your output-----
1000 10 23 29 39 48 57 58 67