Submission #182399

# Submission time Handle Problem Language Result Execution time Memory
182399 2020-01-09T17:11:46 Z XmtosX Bridž (COCI17_bridz) C++17
50 / 50
8 ms 376 KB
#include <bits/stdc++.h>
using namespace std;
int n,ans;
string s;
int main()
{
    cin >>n;
    while(n--)
    {
        cin >>s;
        for (int i=0;i<s.size();i++)
        {
            if (s[i]=='A')
                ans+=4;
            else if (s[i]=='K')
                ans+=3;
            else if (s[i]=='Q')
                ans+=2;
            else if (s[i]=='J')
                ans++;
        }
    }
    cout <<ans;
    return 0;
}

Compilation message

bridz.cpp: In function 'int main()':
bridz.cpp:11:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (int i=0;i<s.size();i++)
                      ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 3 ms 256 KB Output is correct
8 Correct 3 ms 376 KB Output is correct
9 Correct 6 ms 376 KB Output is correct
10 Correct 8 ms 376 KB Output is correct