fork download
  1. #include <iostream>
  2. #include <cstdio>
  3.  
  4. using namespace std;
  5.  
  6. int a[100003]={0};
  7.  
  8. int main() {
  9. int n, b;
  10. a[0]=1;
  11. scanf("%d", &n);
  12. for(int i=1; i<n; i++) scanf("%d", &b), a[b]++;
  13. for(int i=0; i<=n; i++) if(a[i]==0) printf("%d", i);
  14. return 0;
  15. }
Success #stdin #stdout 0s 3732KB
stdin
10
3 8 10 1 7 9 6 5 2
stdout
4