Skip to content

Instantly share code, notes, and snippets.

@jail238
Created March 29, 2022 15:23
Show Gist options
  • Save jail238/f0d21c8954eedd5c3e52db501246bcd1 to your computer and use it in GitHub Desktop.
Save jail238/f0d21c8954eedd5c3e52db501246bcd1 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int main() {
cin.tie(0);
ios_base::sync_with_stdio(0);
int n, s = 0;
cin >> n;
for (int i = 0; i < n; i++){
s += i;
int x;
cin >> x;
s -= x;
}
cout << -s;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment