| Task: | HIIT Generation |
| Sender: | Robotiimi |
| Submission time: | 2018-05-26 15:58:54 +0300 |
| Language: | C++ |
| Status: | READY |
| Result: | WRONG ANSWER |
| test | verdict | time | |
|---|---|---|---|
| #1 | WRONG ANSWER | 0.01 s | 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');
r.insert(it, 'I');
r.insert(it, 'I');
++it; ++it; ++it;
}
}
}
for (list<char>::iterator it=r.begin(); it!=r.end(); ++it) {
cout << *it;
}
}
Test details
Test 1
Verdict: WRONG ANSWER
| input |
|---|
| 17 I I I I ... |
| correct output |
|---|
| HHHHHHHHHHHHHHHHHHIITHIITTHHII... |
| user output |
|---|
| HHHHHHHHHHHHHHHHHHHHHIITITITHI... |
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 |
|---|
| HIIHIITIIHIIHIITIIHIIHIITIIHII... |
Test 4
Verdict: ACCEPTED
| input |
|---|
| 0 |
| correct output |
|---|
| HIIT |
| user output |
|---|
| HIIT |
