Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- typedef long long ll;
- const ll maxn = 200000;
- const ll maxa = 1000005;
- ll n, A[maxa], R[maxa], C[maxa], s, res, dva = 2LL;
- int main()
- {
- cin >> n;
- for (ll i = 0; i < n; ++i)
- cin >> A[i], s += A[i], C[A[i]]++;
- for (ll i = 0; i < n; ++i)
- {
- if (!((s - A[i]) & 1LL))
- {
- C[A[i]]--;
- if (C[(s - A[i]) >> 1LL])
- R[res++] = i + 1LL;
- C[A[i]]++;
- }
- }
- cout << res << '\n';
- for (ll i = 0; i < res; ++i)
- cout << R[i] << ' ';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement