fork download
  1. #include <iostream>
  2. #include <cstdio>
  3. using namespace std;
  4.  
  5. int main() {
  6. long long int sum=0, total, n, a;
  7. scanf("%lld", &n);
  8. for(int i=1; i<n; i++) scanf("%lld", &a), sum+=a;
  9. total=(n*(n+1))/2;
  10. total-=sum;
  11. printf("%lld", total);
  12. return 0;
  13. }
Success #stdin #stdout 0s 3344KB
stdin
10
3 8 10 1 7 9 6 5 2
stdout
4