But I still got WA.
Can someone tell me what is wrong??
Thanks!!!
- Code: Select all
//acm484
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main()
{
char *p,in[100000];
int find,c,n,t=0,times[100000][2];
for(n=0;n<100000;n++) times[n][1]=1;
gets(in);
p=strtok(in," ");
times[t++][0]=atoi(p);
while((p=strtok(NULL," "))!=0)
{
for(n=c=0;n<t;n++)
if(times[n][0]==atoi(p))
{
c=1;
find=n;
break;
}
if(c!=0) times[find][1]++;
else times[t++][0]=atoi(p);
}
for(n=0;n<t;n++) printf("%d %d\n",times[n][0],times[n][1]);
return 0;
}
