fork download
#include <bits/stdc++.h>
#define inf INT_MAX/2
#define ll long long
#define pb push_back
#define MS(a,y) memset(a,y,sizeof(a))

using namespace std;

int main()
{
    int n,a;
    cin >> n;
    unordered_map<int, int> m;
    for(int i=0; i<=n; i++)
    {
        cin >> a;
        m[a]++;
        if(m[a]==2)
        {
            cout << a << " is the repeated number";
            break;
        }
        if(i==n)
            cout << "No repeated numbers detected";
    }
    return 0;
}
Success #stdin #stdout 0.01s 5352KB
stdin
Standard input is empty
stdout
5288 is the repeated number