Task: | HIIT remains |
Sender: | Verto |
Submission time: | 2016-05-28 12:40:33 +0300 |
Language: | C++ |
Status: | READY |
Result: | RUNTIME ERROR |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.05 s | details |
#2 | ACCEPTED | 0.06 s | details |
#3 | RUNTIME ERROR | 0.15 s | details |
#4 | RUNTIME ERROR | 0.14 s | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:17:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 1; i < s.size(); i++) { ^
Code
#include <iostream> #include <cstring> using namespace std; int main() { int t; cin >> t; const char target[] = "HIIT"; long long int arr[10000*4]; for (int tt = 0; tt < t; tt++) { string s; cin >> s; memset(arr, 0, 10000*4); if (s[0] == target[0]) arr[0] = 1; for (int i = 1; i < s.size(); i++) { for (int j = 0; j < 4; j++) { arr[i*4+j] = arr[(i-1)*4+j]; } for (int j = 0; j < 4; j++) { if (s[i] != target[j]) continue; if (j == 0) { arr[i*4+j] += 1; } else { arr[i*4+j] += arr[(i-1)*4+j-1]; } } } cout << arr[(s.size()-1)*4+3] << endl; } }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
100 IIITIIIHITHTHIIITIII HIHIIIIIIHIIITHIIIII ITTIIIITIIIIIIITIIIT IITHITITIHHIITTTIIII ... |
correct output |
---|
12 84 0 37 96 ... |
user output |
---|
12 84 0 37 96 ... |
Test 2
Verdict: ACCEPTED
input |
---|
100 TIIHHITTITITIHTHIIIITHIHHIIHTI... |
correct output |
---|
606723862 621369559 655243897 550750615 717769300 ... |
user output |
---|
606723862 621369559 655243897 550750615 717769300 ... |
Test 3
Verdict: RUNTIME ERROR
input |
---|
10 TTHTHHTIIIIIITHIIHIITITTITTIIH... |
correct output |
---|
64668032062669502 66159978956790306 65755072918424640 64408596558953628 65238005187079543 ... |
user output |
---|
(empty) |
Test 4
Verdict: RUNTIME ERROR
input |
---|
3 HHHHHHHHHHHHHHHHHHHHHHHHHHHHHH... |
correct output |
---|
781234375000000000 4999750003 0 |
user output |
---|
(empty) |