Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- using namespace std;
- ifstream fin("izolate.in");
- ofstream fout("izolate.out");
- bool v[102];
- int main()
- {
- int n, st ,dr, nr = 0;
- fin >> n;
- while(fin >> st >> dr)
- {
- if(!v[st])
- {
- v[st] = true;
- nr++;
- }
- if(!v[dr])
- {
- v[dr] = true;
- nr++;
- }
- }
- fout << n - nr << ' ';
- for(int i = 1; i <= n; i++)
- if(!v[i])
- fout << i << ' ';
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement