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:59:22
2018-05-26 15:59:02
2018-05-26 15:58:43
2018-05-26 15:58:19
2018-05-26 15:56:40
2018-05-26 15:56:20
2018-05-26 15:55:52
2018-05-26 15:51:56
2018-05-26 15:42:44
2018-05-26 15:23:28
2018-05-26 15:19:32
2018-05-26 15:15:51
2018-05-26 15:11:26
2018-05-26 14:53:25
2018-05-26 14:39:01
2018-05-26 14:25:57
2018-05-26 13:21:37
2018-05-26 11:33:38
Task:HIIT Generation
Sender:TreamDeam
Submission time:2018-05-26 15:59:22
Status:READY
Result:WRONG ANSWER

Show test data

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);
			}
		}
	}
}