#include<stdio.h> #include<stdlib.h> #include<bitset> const int MAXSIZE=10000000; using namespace std; bitset <MAXSIZE> bitvec; int main() { // printf("!!!!!!!!!!!!!!!!!!"); FILE *fin,*fout; fin=fopen("in.txt","r"); int i; while(fscanf(fin,"%d",&i)!=EOF) { bitvec.set(i); } fout=fopen("out.txt","rw"); for(i=1;i<MAXSIZE;i++) { if(bitvec.test(i)) fprintf(fout,"%d ",i); } return 0; }