| Task: | HIIT Generation |
| Sender: | El Numero Uno |
| Submission time: | 2018-05-26 15:32:44 +0300 |
| Language: | C++ |
| Status: | READY |
| Result: | TIME LIMIT EXCEEDED |
| test | verdict | time | |
|---|---|---|---|
| #1 | ACCEPTED | 0.02 s | details |
| #2 | TIME LIMIT EXCEEDED | -- | details |
| #3 | ACCEPTED | 0.02 s | details |
| #4 | ACCEPTED | 0.02 s | details |
Compiler report
input/code.cpp: In function 'int main()':
input/code.cpp:17:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < f.size(); i++) {
~~^~~~~~~~~~Code
#include <iostream>
#include "stdio.h"
using namespace std;
int main() {
char c;
int n;
cin >> n;
string s = "HIIT";
string f = "HIIT";
string t = "";
f.reserve(1000000);
for (int _ = 0; _ < n; _++) {
cin >> c;
t = "";
for (int i = 0; i < f.size(); i++) {
if (f[i] == c) {
t += s;
}
else {
t += f[i];
}
}
f = t;
}
printf("%s\n", f.c_str());
return 0;
}
Test details
Test 1
Verdict: ACCEPTED
| input |
|---|
| 17 I I I I ... |
| correct output |
|---|
| HHHHHHHHHHHHHHHHHHIITHIITTHHII... |
| user output |
|---|
| HHHHHHHHHHHHHHHHHHIITHIITTHHII... |
Test 2
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 333332 H H H H ... |
| correct output |
|---|
| HIITIITIITIITIITIITIITIITIITII... |
| user output |
|---|
| (empty) |
Test 3
Verdict: ACCEPTED
| input |
|---|
| 24 H T H T ... |
| correct output |
|---|
| HIIHIITIIHIIHIITIIHIITIIHIIHII... |
| user output |
|---|
| HIIHIITIIHIIHIITIIHIITIIHIIHII... |
Test 4
Verdict: ACCEPTED
| input |
|---|
| 0 |
| correct output |
|---|
| HIIT |
| user output |
|---|
| HIIT |
