题解 | #明明的随机数#
明明的随机数
http://www.nowcoder.com/practice/3245215fffb84b7b81285493eae92ff0
#include #include <unordered_map>
using namespace std;
int main() { int input; int size; unordered_map<int, int> a; cin>>size; int n = size; while(n--) { cin>>input; if(a.find(input) == a.end()) { a[input] = 1; } } for(int i = 1; i <=500; i ++) { if(a[i] == 1) cout<<i<<endl; } }