Skip to content

Instantly share code, notes, and snippets.

@Anower77
Created December 24, 2023 16:02
Show Gist options
  • Save Anower77/8cdde35b706f17c28f7361889d25abf5 to your computer and use it in GitHub Desktop.
Save Anower77/8cdde35b706f17c28f7361889d25abf5 to your computer and use it in GitHub Desktop.
Goals of Victory
#include<bits/stdc++.h>
using namespace std;
int main() {
int t;cin>>t;
while (t--)
{
int n,sum=0;cin>>n;
vector<int>v(n-1);
for(int i=0;i<n-1;i++)
{
cin>>v[i];
sum+=v[i];
}
sum = -sum;
cout<<sum<<endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment