CSES - Putka Open 2020 – 5/5 - Results
Submission details
Task:HQ9+
Sender:TapaniS
Submission time:2020-11-27 22:44:05 +0200
Language:Java
Status:READY
Result:100
Feedback
groupverdictscore
#1ACCEPTED15
#2ACCEPTED85
Test results
testverdicttimegroup
#1ACCEPTED0.21 s1, 2details
#2ACCEPTED0.24 s2details

Code

import java.util.*;

public class hq9 {


	public static void main(String[] args) {

		Scanner input = new Scanner(System.in);

		int t = input.nextInt();
		// int n = Integer.parseInt(input.nextLine());

		for (int i = 0; i < t; i++) {
			int n = input.nextInt();
			int Qty9 = n / 494;
			String ans = "";

			for (int i2 = 0; i2 < Qty9; i2++) {
				ans += "9";
			}
			n -= 494 * Qty9;

			for (int i3 = 0; i3 < n; i3++) {
				ans += "H";
			}

			System.out.println(ans);
		}

		
		input.close(); 
    }
}

Test details

Test 1

Group: 1, 2

Verdict: ACCEPTED

input
100
10
96
42
77
...

correct output
HHHHHHHHHH
HHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...

user output
HHHHHHHHHH
HHHHHHHHHHHHHHHHHHHHHHHHHHHHHH...
Truncated

Test 2

Group: 2

Verdict: ACCEPTED

input
100
76364
26254
35192
92572
...

correct output
999999999999999999999999999999...

user output
999999999999999999999999999999...
Truncated