Sunday, February 27, 2011

484- The Department of Redundancy Department


#include<stdio.h>
#define M 100000
#define N 50000
int queue[M];
int count[M];
int main()
{
    register int n,f=-1,r=-1;
    //freopen("in.txt","r",stdin);
    while(scanf("%d",&n)==1)
    {
        if(!count[n+N])
            queue[++r]=n;
        count[n+N]++;
    }
    f=-1;
    while(f^r)
        printf("%d %d\n",queue[f],count[queue[++f]+N]);
    return 0;
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.