1510 : Order

Problem Link

Huge chance to get TLE on 21 & 31 , i got 5times 😥

Morning shock

#Solution

#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <stack>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <iomanip>
using namespace std;
#include<stdint.h>
#define ll long long
map<ll,ll>in;
#define uu first
#define vv second
#include <iomanip>
int64_t x,mx=-1,ans=0;
int main() {
int t;
ios_base::sync_with_stdio(0);

scanf(“%d”,&t);

for(int i=0;i<t;i++)

{
scanf(“%I64d”,&x);
++in[x];
}
for(map<ll,ll>::iterator it=in.begin();it!=in.end();it++)
{
if((*it).vv>mx)
{

mx=it->second;
ans=it->first;
}
}

printf(“%I64d\n”,ans);
return 0;
}

Advertisements

About waprogramming

I am in CSE,from CUET
This entry was posted in timus, Uncategorized and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s