Skip to content

Instantly share code, notes, and snippets.

@delihiros
Created December 16, 2011 08:15
Show Gist options
  • Save delihiros/1485070 to your computer and use it in GitHub Desktop.
Save delihiros/1485070 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <cstdlib>
using namespace std;
int data[5001];
int main(){
for (int i = 0; i < 5001; i++) data[i] = 0;
int buf;
cin >> buf;
int foo = buf;
int c = buf;
while (c){
cin >> foo;
data[foo] += 1;
c--;
}
int counter = 0;
while (buf >= 1){
if (data[buf] == 0) counter++;
buf--;
}
cout << counter << endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment