-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathacm.cpp
More file actions
36 lines (33 loc) · 686 Bytes
/
acm.cpp
File metadata and controls
36 lines (33 loc) · 686 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
#include <bits/stdc++.h>
using namespace std;
#define ar array
#define ll long long
int main() {
int t; char c; string status;
int numP=26;
int solved[numP];
int numTries[numP];
for (int i=0;i<numP;i++){
solved[i]=-1;
numTries[i]=0;
}
while(1){
cin>>t;
if (t==-1) break;
cin>>c>>status;
int idx=c-'A';
numTries[idx]++;
if(status=="right"){
solved[idx]=t;
}
}
int totS=0, p=0;
for(int i=0;i<numP;i++){
if (solved[i]!=-1){
p+=solved[i];
p+=(20*(numTries[i]-1));
totS++;
}
}
cout<<totS<<" "<<p<<endl;
}