Saleh127

Untitled

May 8th, 2020
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. ll a[1000000]={0};
  5. int main()
  6. {
  7. ll n,i,k;
  8. cin>>n;
  9. for(i=1;i<n;i++)
  10. {
  11. cin>>k;
  12. a[k]++;
  13. }
  14. for(i=1;i<=n;i++)
  15. {
  16. if(a[i]==0)
  17. {
  18. printf("%lld\n",i);
  19. return 0;
  20. }
  21. }
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment