-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathACM_Contest.cpp
More file actions
50 lines (40 loc) · 970 Bytes
/
ACM_Contest.cpp
File metadata and controls
50 lines (40 loc) · 970 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include<iostream>
#include<map>
#include<vector>
#include<string>
using namespace std;
int main(){
int time;
char problem;
string state;
bool torun=true;
map<char,int>Mymp;
vector<char>arr;
while(torun){
cin >> time;
if(time!=-1){
cin>> problem>>state;
auto haveproblem=Mymp.find(problem);
if(state=="right" && haveproblem==Mymp.end()){
Mymp[problem]=time;
}else if(state=="wrong"){
arr.push_back(problem);
}
}else{
torun=false;
}
}
int Ttime=0;
for(auto x=Mymp.begin();x!=Mymp.end();++x){
int count=0;
for(int i=0;i<arr.size();i++){
if(x->first==arr[i]){
count++;
}
}
Ttime=Ttime+x->second+(count*20);
}
cout<<Mymp.size()<<" "<<Ttime;
}
for (auto x=mp.begin();x!=mp.end();++x){
}