CSES - Leirikisa 5 - Results
Submission details
Task:baka
Sender:zxc
Submission time:2016-08-02 15:05:48 +0300
Language:C++
Status:READY
Result:100
Feedback
groupverdictscore
#1ACCEPTED100
Test results
testverdicttime
#1ACCEPTED0.06 sdetails
#2ACCEPTED0.06 sdetails
#3ACCEPTED0.05 sdetails
#4ACCEPTED0.06 sdetails
#5ACCEPTED0.06 sdetails
#6ACCEPTED0.06 sdetails
#7ACCEPTED0.06 sdetails
#8ACCEPTED0.06 sdetails
#9ACCEPTED0.06 sdetails
#10ACCEPTED0.05 sdetails
#11ACCEPTED0.06 sdetails
#12ACCEPTED0.06 sdetails

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:7:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i = 0; i < s.size(); ++i) {
                               ^

Code

#include <bits/stdc++.h>
using namespace std;
int main() {
    string s;
    cin>>s;
    int lol = 0;
    for(int i = 0; i < s.size(); ++i) {
	int pos = 2;
	if(s[i] <= 'O') {
	    pos += (s[i]-'A')/3;
	}
	else if(s[i] <= 'S') {
	    pos = 7;
	}
	else {
	    pos = 8 + (s[i] - 'T')/3;
	}
	if(s[i] == 'Z') --pos;
	lol += pos + 1;
    }
    cout<<lol<<'\n';
}

Test details

Test 1

Verdict: ACCEPTED

input
WA

correct output
13

user output
13

Test 2

Verdict: ACCEPTED

input
UNUCIC

correct output
36

user output
36

Test 3

Verdict: ACCEPTED

input
MACDNKIHFGBEHOJ

correct output
74

user output
74

Test 4

Verdict: ACCEPTED

input
ABCDEFGHIJKLMNO

correct output
75

user output
75

Test 5

Verdict: ACCEPTED

input
NCC

correct output
13

user output
13

Test 6

Verdict: ACCEPTED

input
AUUI

correct output
26

user output
26

Test 7

Verdict: ACCEPTED

input
UOEAIAOIUE

correct output
56

user output
56

Test 8

Verdict: ACCEPTED

input
AOEUIIUEAOEAOIO

correct output
82

user output
82

Test 9

Verdict: ACCEPTED

input
CFILOSVZXQCPFZO

correct output
102

user output
102

Test 10

Verdict: ACCEPTED

input
BEHKNRUYKRUBNE

correct output
89

user output
89

Test 11

Verdict: ACCEPTED

input
ADGJMPTWTPMJGDA

correct output
94

user output
94

Test 12

Verdict: ACCEPTED

input
UNUCICA

correct output
39

user output
39