Submission #244815

#TimeUsernameProblemLanguageResultExecution timeMemory
244815VEGAnnBridž (COCI17_bridz)C++14
50 / 50
6 ms384 KiB
#include <bits/stdc++.h>
#define sz(x) ((int)x.size())
using namespace std;
const int N = 110;
string s;
int n, ans = 0;

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);

#ifdef _LOCAL
    freopen("in.txt","r",stdin);
#endif // _LOCAL

    cin >> n;

    for (int it = 0; it < n; it++){
        cin >> s;

        for (int j = 0; j < sz(s); j++) {
            if (s[j] == 'A')
                ans += 4; else
            if (s[j] == 'K')
                ans += 3; else
            if (s[j] == 'Q')
                ans += 2; else
            if (s[j] == 'J')
                ans += 1;
        }
    }

    cout << ans;

    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...