Submission #713848

# Submission time Handle Problem Language Result Execution time Memory
713848 2023-03-23T06:06:46 Z ALTAKEXE Bridž (COCI17_bridz) C++14
50 / 50
3 ms 340 KB
#include <bits/stdc++.h>
using namespace std;
int main() {
	//freopen("input.txt","r",stdin);
	int n,sum=0;
    cin>>n;
    while(n--){
        string a;
        cin>>a;
        for(int i=0;i<a.size();i++){
            if(a[i]=='A') sum+=4;
            if(a[i]=='K') sum+=3;
            if(a[i]=='Q') sum+=2;
            if(a[i]=='J') sum+=1;
        }
    }
    cout<<sum;
    return 0;
}

Compilation message

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