| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 73132 | 梁敖铭 | 处理随机数 | C++ | Compile Error | 0 MS | 0 KB | 362 | 2024-05-18 09:27:26 |
#include<iostream> using namespace std; int main(){ int n,tmp,ans=0 int cnt[1000000]; cin>>n; while(n--){ cin>>tmp; cnt[tmp]++; if(cnt[tmp]==1){ ans++; } } cout<<ans; int i=1; while(cnt[i]==0)i++; cout<<i; for(i=i+1;i<1001;i++){ if(cnt[i]>0){ cout<<i; } } cout<<endl; return 0; }
Main.cc: In function 'int main()':
Main.cc:5:1: error: expected ',' or ';' before 'int'
int cnt[1000000];
^
Main.cc:9:5: error: 'cnt' was not declared in this scope
cnt[tmp]++;
^
Main.cc:16:7: error: 'cnt' was not declared in this scope
while(cnt[i]==0)i++;
^
Main.cc:19:8: error: 'cnt' was not declared in this scope
if(cnt[i]>0){
^