Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define uns unsigned
- #define ll long long
- #define newline '\n'
- using namespace std;
- ///**************************contest setup
- const uns NMAX(3005);
- set <int> s;
- int v[NMAX];
- int main()
- {
- int n, nr(3);
- cin >> n;
- for (int i = 1; i <= n; i++)
- {
- cin >> v[i];
- s.insert(v[i]);
- }
- if ((int)s.size() < nr)
- {
- while (nr--)
- cout << -1 << ' ';
- }
- else
- {
- for (auto it = s.begin(); it != s.end() && nr--; it++)
- {
- int x = *it;
- for (int i = 1; i <= n; i++)
- if (x == v[i])
- {
- cout << i << ' ';
- break;
- }
- }
- }
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement