Skip to content

Instantly share code, notes, and snippets.

@surinoel
Created October 18, 2019 10:10
Show Gist options
  • Save surinoel/b868cfc06b14803502c823b9228ca6f0 to your computer and use it in GitHub Desktop.
Save surinoel/b868cfc06b14803502c823b9228ca6f0 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int main(void) {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
int ans = 0;
for (int i = 0; i < n; i++) {
int m;
cin >> m;
ans += (m - 1);
}
cout << ans + 1 << '\n';
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment