Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- int main()
- {
- int n, t, sum = 0, mn = 0x7FFFFFFF, mn_t;
- cin >> n;
- vector<int> ans;
- for (int i = 0; i < n; i++)
- {
- cin >> t;
- sum += t;
- if (t != 0) ans.push_back(i);
- if (t % 2 == 1 && t < mn)
- {
- mn = t;
- mn_t = i;
- }
- }
- for (int i = 0; i < ans.size(); i++)
- {
- if (!(sum % 2 == 0 && ans[i] == mn_t)) cout << ans[i] + 1 << ' ';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement