CSES - HIIT Open 2018 - Results
Submission details
Task:HIIT Generation
Sender:TreamDeam
Submission time:2018-05-26 15:59:02 +0300
Language:Java
Status:READY
Result:
Test results
testverdicttime
#10.31 sdetails
#2--details
#30.34 sdetails
#40.14 sdetails

Code

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

public class H {
	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String cur = "HIIT";
		String s = "HIIT";
		for (int i = 0; i < n; i++) {
			String m = br.readLine();
			if (m.equals("I")) {
				cur = cur.replaceAll("II", "HIITHIIT");
			} else {
				cur = cur.replaceAll(m,  s);
			}
		}
	}
}

Test details

Test 1

Verdict:

input
17
I
I
I
I
...

correct output
HHHHHHHHHHHHHHHHHHIITHIITTHHII...

user output
(empty)

Test 2

Verdict:

input
333332
H
H
H
H
...

correct output
HIITIITIITIITIITIITIITIITIITII...

user output
(empty)

Test 3

Verdict:

input
24
H
T
H
T
...

correct output
HIIHIITIIHIIHIITIIHIITIIHIIHII...

user output
(empty)

Test 4

Verdict:

input
0

correct output
HIIT

user output
(empty)