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

## 英语阅读题

Posted by Eli_love at 2010-05-08 17:33:19 on Problem 3425
```关键在于理解这句：4.	Correct answer to a question which was already correctly answered before	+10 USD for each previous correct answerD

#include<iostream>
#include<map>
using namespace std;
map<int,int>xkey;
int main()
{
int n,q,a,b;
while(scanf("%d",&n)!=EOF)
{
xkey.clear();
int ans=0;
for(int i=0;i<n;i++)
{
scanf("%d%d%d",&q,&a,&b);
if(xkey.find(q)==xkey.end())
xkey[q]=0;
else if(xkey.find(q)!=xkey.end() && a==1) xkey[q]++;
if(a==0 && b==0) ans+=10;
else if(a==0 && b==1) ans+=10;
else if(a==1 && b==0) ans+=20;
else if(a==1 && b==1) ans+=40;
}
map<int,int>::iterator itr;
for(itr=xkey.begin();itr!=xkey.end();itr++)
if((*itr).second>=1)ans+=(*itr).second*10;
printf("%d\n",ans);
}
return 7;
}```

Followed by: