Code Submission Evaluation System Login

HIIT Open 2016

Start:2016-05-28 11:00:00
End:2016-05-28 16:00:00
 

Tasks | Messages | Scoreboard | Statistics


CSES - HIIT Open 2016 - Results
History
2016-05-28 16:01:26
2016-05-28 15:59:55
2016-05-28 14:35:00
Task:HIIT remains
Sender:zah
Submission time:2016-05-28 15:59:55
Language:C++
Status:READY
Result:WRONG ANSWER

Test results

testverdicttime (s)
#1WRONG ANSWER0.06 / 1.00details
#2WRONG ANSWER0.07 / 1.00details
#3WRONG ANSWER0.07 / 1.00details
#4WRONG ANSWER0.06 / 1.00details

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:40:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (int j=0; j<letters.size(); j++) {
                                      ^
input/code.cpp:18:9: warning: variable 'iit' set but not used [-Wunused-but-set-variable]
     int iit;
         ^
input/code.cpp:20:9: warning: unused variable 'tmp' [-Wunused-variable]
     int tmp;
         ^

Code

#include <iostream>
#include <map>
#include <vector>

using namespace std;

//ios_base::sync_with_stdio(0);
//cin.tie(0);


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

    int vastaus;
    int iit;

    int tmp;
    cin >> t;
    map<char,int> m;
    m['H']=1; m['I']=2; m['T']=3;    
    
    for (int i=0;i<t;i++) {
        vector<int> letters;
        vector<int> summa;
        vector<int> hoot;
        vector<int> teet;

        vastaus=0;
        cin >> data;
        int n=data.size();
        for (int j=0; j<n; ++j){
            if (m[data[j]] != 0) letters.push_back(m[data[j]]);
        }

        iit=0;
        int random=0, random2=0, r3=4, r4=0;
        for (int j=0; j<letters.size(); j++) {
            if (letters[j]==1) {hoot.push_back(j); r3=0;}
            else if (letters[j]==3) {teet.push_back(j); vastaus+=random; }
            else if (letters[j]==2) { random+=r4+random2;  r4+=random2;
                            if (r3==0) {
                                    r3=1;
                   
                                    random2+=1;
}
}
        //    summa.push_back(iit);   
        }


        /*for (int j=0; j<hoot.size(); j++) {
            for (int k=0; k<teet.size(); k++) {
                if (teet[k]>hoot[j]) {
                   tmp = summa[teet[k]] - summa[hoot[j]];
                   vastaus += (tmp*(tmp-1))/2;
                }
            }
        }*/
        cout << vastaus << "\n";
    }



}

Test details

Test 1

Verdict: WRONG ANSWER

input
100
IIITIIIHITHTHIIITIII
HIHIIIIIIHIIITHIIIII
ITTIIIITIIIIIIITIIIT
IITHITITIHHIITTTIIII
HTTTHIHTHTIHIHIHITIT
TTIIHTHIHHHHTTHTIHIH
IHTITTIIHHITHHITTIIT
IITIITIITHTHHTHTHHHH
THITHIHIHIITIIIITIHI
IIIHHIHITTIIIITTTITI
THHIITTITHITTHIHTIHI
IIITTIHIIHIIIHIITIII
IIIITHIHTTITIIHIIITI
HIIIIHIIHHIIHIIHHIII
TTTITIHITIIIHTIIHTTH
IHIHIIHIHTTIIIIIHHTT
THHIHHTIIITITTITIITI
ITIHHIIHTIITHIHTTIIH
HTIIHIIIHTIIIHHHHHII
...
view   save

correct output
12
84
0
37
96
0
69
0
120
181
55
32
40
0
38
196
230
61
13
6
...
view   save

user output
9
84
0
34
55
0
58
0
120
113
28
32
40
0
38
196
115
34
13
6
...
view   save

Test 2

Verdict: WRONG ANSWER

input
100
TIIHHITTITITIHTHIIIITHIHHIIHTI...
view   save

correct output
606723862
621369559
655243897
550750615
717769300
665089504
642274956
551961964
664708056
777169105
656828941
688142963
713223918
601227597
653912421
553449705
593989615
583046208
572753212
501740301
...
view   save

user output
419835542
431597035
430813071
403571799
472811983
413929856
494816986
362441661
492550067
563204697
459282143
423900536
512352711
385260173
476620826
378522304
422236214
368333842
393829134
359052552
...
view   save

Test 3

Verdict: WRONG ANSWER

input
10
TTHTHHTIIIIIITHIIHIITITTITTIIH...
view   save

correct output
64668032062669502
66159978956790306
65755072918424640
64408596558953628
65238005187079543
65592769713081781
64464967247944127
65438455195590511
64413241735660784
64966612866364956
view   save

user output
779404178
804612909
398167103
-2129254970
-342624817
-924971360
134845644
-858541777
695038139
-777499996
view   save

Test 4

Verdict: WRONG ANSWER

input
3
HHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...
view   save

correct output
781234375000000000
4999750003
0
view   save

user output
-807045696
704782707
0
view   save