9 条题解
-
2
#include<bits/stdc++.h> using namespace std ; bool visited[10001] = { false } ;
int main ( ) { int n ; cin >> n ; int ans[20005] ; int cnt = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int x ; cin >> x ; if ( ! visited[x] ) { visited[x] = true ; ans[cnt++] = x ; } } for ( int i = 0 ; i < cnt ; i ++ ) { cout << ans[i] ; if ( i != cnt - 1 ) { cout << ' ' ; } } cout << endl ; return 0 ; }
信息
- ID
- 1030
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 6
- 标签
- 递交数
- 1335
- 已通过
- 427
- 上传者