-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathF.cpp
More file actions
40 lines (37 loc) · 957 Bytes
/
F.cpp
File metadata and controls
40 lines (37 loc) · 957 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define ENDL '\n'
#define all(a) begin(a), end(a)
#define sz(a) (int)(a.size())
#define deb(a) cout << #a << ": " << a << ENDL
#define fore(i, a, b) for(int i(a), ThkMk(b); i < ThkMk; ++i)
#define _ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
typedef long long lli;
typedef long double ld;
typedef pair<lli, lli> ii;
typedef vector<lli> vi;
int main()
{ ///_
lli n; cin >> n;
lli tot, x;
cout << "? 1 " << n << endl;
cin >> tot;
lli last;
cout << "? 1 " << n - 1 << endl;
cin >> last;
last = tot - last;
vi v;
fore(i, 2, n) {
cout << "? " << i << " " << n << endl;
cin >> x;
v.pb(tot - x);
tot = x;
}
v.pb(tot - last);
v.pb(last);
cout << "! "; for(auto it : v) cout << it << ' '; cout << endl;
return 0;
}