Task: | HIIT Generation |
Sender: | Robotiimi |
Submission time: | 2018-05-26 15:59:54 +0300 |
Language: | C++ |
Status: | READY |
Result: | TIME LIMIT EXCEEDED |
test | verdict | time | |
---|---|---|---|
#1 | TIME LIMIT EXCEEDED | -- | details |
#2 | TIME LIMIT EXCEEDED | -- | details |
#3 | WRONG ANSWER | 0.01 s | details |
#4 | ACCEPTED | 0.01 s | details |
Code
#include <bits/stdc++.h> #include <string> #include <vector> #include <list> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); list <char> r; r.push_back('H'); r.push_back('I'); r.push_back('I'); r.push_back('T'); int n; cin >> n; char a; for (int i=0; i<n; i++) { cin >> a; for (list<char>::iterator it=r.begin(); it!=r.end(); ++it) { if (*it == a) { *it = 'T'; r.insert(it, 'H');++it; r.insert(it, 'I');++it; r.insert(it, 'I'); ++it; } } } for (list<char>::iterator it=r.begin(); it!=r.end(); ++it) { cout << *it; } }
Test details
Test 1
Verdict: TIME LIMIT EXCEEDED
input |
---|
17 I I I I ... |
correct output |
---|
HHHHHHHHHHHHHHHHHHIITHIITTHHII... |
user output |
---|
(empty) |
Test 2
Verdict: TIME LIMIT EXCEEDED
input |
---|
333332 H H H H ... |
correct output |
---|
HIITIITIITIITIITIITIITIITIITII... |
user output |
---|
(empty) |
Test 3
Verdict: WRONG ANSWER
input |
---|
24 H T H T ... |
correct output |
---|
HIIHIITIIHIIHIITIIHIITIIHIIHII... |
user output |
---|
IHHTIIIHIHTIIIIIHHTIIIIIHHTIII... |
Test 4
Verdict: ACCEPTED
input |
---|
0 |
correct output |
---|
HIIT |
user output |
---|
HIIT |