#include <iostream>
using namespace std;
int main(){
long long int n,sum=0;
string str;
cin>>n;
while(n--){
cin>>str;
for(int i=0;i<13;i++){
if(str[i]=='A')sum+=4;
if(str[i]=='K')sum+=3;
if(str[i]=='Q')sum+=2;
if(str[i]=='J')sum+=1;
}
}
cout<<sum;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
1 ms |
364 KB |
Output is correct |
7 |
Correct |
1 ms |
492 KB |
Output is correct |
8 |
Correct |
2 ms |
492 KB |
Output is correct |
9 |
Correct |
3 ms |
364 KB |
Output is correct |
10 |
Correct |
4 ms |
364 KB |
Output is correct |