Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <iostream>
- #include <bitset>
- #define NMAX 9000001
- using namespace std;
- ifstream in("colectie.in");
- ofstream out("colectie.out");
- bitset <NMAX> f1;
- bitset <NMAX> f2;
- int i,n,input,ap;
- void Citire()
- {
- in>>n;
- for(i=1; i<=n; i++)
- {
- in>>input;
- if(f1[input]==0)
- f1[input]=1;
- else
- {
- if(f2[input]==0)
- f2[input]=1;
- }
- }
- }
- void Afisare()
- {
- for(i=1; i<=n; i++)
- {
- if(f1[i]==1 && f2[i]==0)
- ap++;
- }
- out<<ap;
- }
- int main()
- {
- Citire();
- Afisare();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement