mirror of
https://github.com/Manoj-HV30/dsa-competitive-programming.git
synced 2026-05-16 19:35:22 +00:00
63 lines
881 B
C++
63 lines
881 B
C++
//URL - https://cses.fi/problemset/task/1083
|
|
//CSES
|
|
#include <bits/stdc++.h>
|
|
using namespace std;
|
|
|
|
#ifdef LOCAL
|
|
#define dbg(x) cerr << #x << " = " << x << endl
|
|
#else
|
|
#define dbg(x)
|
|
#endif
|
|
|
|
#define ll long long
|
|
#define ld long double
|
|
#define ar array
|
|
#define all(x) (x).begin(), (x).end()
|
|
#define sza(x) (int)(x).size()
|
|
|
|
const ll INF = 1e18;
|
|
const int MOD = 1e9 + 7;
|
|
|
|
void solve() {
|
|
ll n;
|
|
cin>>n;
|
|
ll sum = (n*(n+1))/2;
|
|
int num;
|
|
while(cin>>num){
|
|
sum-=num;
|
|
|
|
}
|
|
cout<<sum;
|
|
|
|
}
|
|
|
|
int main() {
|
|
ios::sync_with_stdio(false);
|
|
cin.tie(NULL);
|
|
|
|
int tc = 1;
|
|
// cin >> tc;
|
|
while(tc--) solve();
|
|
}
|
|
|
|
//XOR approach
|
|
/*
|
|
void solve() {
|
|
int n;
|
|
cin >> n;
|
|
|
|
ll x = 0;
|
|
|
|
for(int i = 1; i <= n; i++)
|
|
x ^= i;
|
|
|
|
for(int i = 0; i < n-1; i++){
|
|
int a;
|
|
cin >> a;
|
|
x ^= a;
|
|
}
|
|
|
|
cout << x << "\n";
|
|
}
|
|
*/
|