Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
Register

## Re:printf("Sample Output %d\n",p); 这句是不用的

Posted by 407811696 at 2011-04-09 12:23:37 on Problem 3425
In Reply To:求救，各位帮忙看看我到底哪里错了。提供的数据都能够得到正确的啊！ Posted by:duanxian0621 at 2010-11-01 20:33:01
```> #include<stdio.h>
> #include<string.h>
> #define maxn 1000005
>
> int q[maxn],a[maxn],x[maxn],map[maxn];
> int main()
> {
> 	int n,i,p=0;
> 	while(scanf("%d",&n)!=EOF)
> 	{
> 		p++;
> 		memset(map,0,sizeof(map));
>
> 		for(i=0;i<n;i++)
> 			scanf("%d%d%d",&q[i],&a[i],&x[i]);
>
> 		int sum=0,count=0;
> 		for(i=0;i<n;i++)
> 		{
> 			if(a[i])
> 			{
> 				map[q[i]]++;
> 				if(map[q[i]]>1)
> 					sum+=10;
> 				if(x[i])
> 					sum+=40;
> 				else
> 					sum+=20;
> 			}
>
> 			else
> 				sum+=10;
> 		}
> 		printf("Sample Output %d\n",p);
> 		printf("%d\n",sum);
> 	}
>
> 	return 0;
> }
```

Followed by: