ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1510. Order

Why stack overflow? Help me, please!
Posted by Daniil 24 Jan 2014 22:04
#include<iostream>
using namespace std;
int main ()
{
    int n,a[500000],d,max=0,maxi;
    cin>>n;
    for (int i=0;i<n;i++)
    {
        cin>>d;
        a[d]++;
        if (a[d]>max)
        {
            max=a[d];
            maxi=d;
        }
    }
    cout<<maxi;
    return 0;
}
Re: Why stack overflow? Help me, please!
Posted by Anton Malyuta 24 Jan 2014 22:35
0 ≤ K ≤ 10^9

Edited by author 20.05.2014 20:54