Code Submission Evaluation System Login

CSES - HIIT Open 2018

HIIT Open 2018

Contest start:2018-05-26 11:00:00
Contest end:2018-05-26 16:00:00

Task list | Submit code | Submissions | Messages | Scoreboard | Statistics


History
2018-05-26 15:48:58
2018-05-26 15:35:59
2018-05-26 11:48:51
Task:HIIT Generation
Sender:Sloths
Submission time:2018-05-26 15:48:58
Status:READY
Result:TIME LIMIT EXCEEDED

Show test data

Code

#include <bits/stdc++.h>
#include <string>

using namespace std;

int main()
{
  string base = "HIIT";
  int n = 0, l = 4;
  char c;
  cin >> n;

  for (int i=0; i<n; i++)
    {
      cin >> c;
	
      for (int j=0; j<l; j++)
      if (base[j] == c)
	{
	base.replace(j,1,"HIIT");
	l = base.length();
	j = j+3;
	}
    }

  cout << base;
  return 0;
}