Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
122254 陈奕涵 处理随机数 C++ Wrong Answer 2 MS 272 KB 665 2025-06-15 09:22:45

Tests(0/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n,m=0,b; int a[1001]={0}; cin>>n; while(n--){ cin>>b; a[b]++; if(a[b]==1){ m++; }cout<<m<<endl; int i=1; while(a[i]==0){ i++; cout<<i; for(i=i+1;i<1001;i++){ if(a[i]>0){ cout<<" "<<i; cout<<endl; } } } } return 0; }


Run Info:

------Input------
9 10 29 39 67 58 48 29 57 23
------Answer-----
8 10 23 29 39 48 57 58 67
------Your output-----
1 2 10 10022 2 10 29 10023 2 10 29 39 10024 2 10 29 39 67 10025 2 10 29 39 58 67 10026 2 10 29 39 48 58 67 10026 2 10 29 39 48 58 67 10027 2 10 29 39 48 57 58 67 10028 2 10 23 29 39 48 57 58 67 1002