Submission #1024016

# Submission time Handle Problem Language Result Execution time Memory
1024016 2024-07-15T10:38:54 Z kustizus Bridž (COCI17_bridz) C++17
50 / 50
1 ms 352 KB
#include <bits/stdc++.h>
#define ll long long int

using namespace std;

ll n,ans=0;
string s;
void Solve(){
    cin>>s;
    for (ll 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+=1;
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin>>n;
    while (n--) Solve();
    cout<<ans;
}

Compilation message

bridz.cpp: In function 'void Solve()':
bridz.cpp:10:18: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |     for (ll i=0;i<s.size();i++)
      |                 ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 352 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct