Click
Here to go back to the homepage.
Saving Princess Peach Solution:
#include <bits/stdc++.h>
using namespace std;
int main(){
// #ifndef TESTING
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
// #endif
int nObstacles, nFound;
cin >> nObstacles >> nFound;
set<int> found;
while(nFound--){
int obstacle;
cin >> obstacle;
found.insert(obstacle);
}
for(int i = 0; i < nObstacles; i++){
auto it = found.find(i);
if(it == found.end()){
cout << i << endl;
}
}
cout << "Mario got " << found.size() << " of the dangerous obstacles." << endl;
return 0;
}