Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <map>
- using namespace std;
- int main()
- {
- int n;
- cin >> n;
- map<int, int> mp;
- for(int i = 0; i < n; ++i)
- {
- int a;
- cin >> a;
- if(mp.count(a) == 1)
- {
- cout << mp[a] << ' ' << i + 1 << '\n';
- return 0;
- }
- mp[a] = i + 1;
- }
- cout << "NO\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment