CSES - Datatähti 2022 alku - Results
Submission details
Task:Merkkijono
Sender:valk
Submission time:2021-10-13 19:09:57 +0300
Language:Java
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#10.34 sdetails
#20.34 sdetails
#30.34 sdetails
#40.34 sdetails
#50.34 sdetails
#60.35 sdetails
#70.36 sdetails
#80.36 sdetails
#90.38 sdetails
#100.40 sdetails
#110.42 sdetails
#120.46 sdetails
#130.52 sdetails
#140.65 sdetails
#150.94 sdetails
#16--details

Code


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		String letter = "abcdefghijklmnopqrstuvwxyz";
		
        Scanner input = new Scanner(System.in);
        
        int a = input.nextInt(); //length
        String fString = "";
        
        for(int i = 0; i < a; i++) {
        	String currentLetter = letter.substring(i, i+1);
        	System.out.println("starting " + i + " letter " + currentLetter);
        	String newString = "";
        	int l = fString.length();
        	int it = 0;
        	newString += currentLetter;
        	//System.out.println("Free ram:" + Runtime.getRuntime().freeMemory());
        	System.out.println("length " + l + " new " + newString + " start of new " + fString);
        	while(it<l) {
        		newString += fString.substring(it, it+1);
        		newString += currentLetter;
        		it++;
        		System.out.println("it " + it);
        	}
        	fString = newString; //seemingly the failure point. too long?
        	System.out.println("mid " + fString);
        }
        
        System.out.println(fString);
        
        input.close();
    }
	
}

Test details

Test 1

Verdict:

input
1

correct output
a

user output
starting 0 letter a
length 0 new a start of new 
mid a
a

Test 2

Verdict:

input
2

correct output
bab

user output
starting 0 letter a
length 0 new a start of new 
mid a
starting 1 letter b
length 1 new b 
...
Truncated

Test 3

Verdict:

input
3

correct output
cbcacbc

user output
starting 0 letter a
length 0 new a start of new 
mid a
starting 1 letter b
length 1 new b 
...
Truncated

Test 4

Verdict:

input
4

correct output
dcdbdcdadcdbdcd

user output
starting 0 letter a
length 0 new a start of new 
mid a
starting 1 letter b
length 1 new b 
...
Truncated

Test 5

Verdict:

input
5

correct output
edecedebedecedeaedecedebedeced...

user output
starting 0 letter a
length 0 new a start of new 
mid a
starting 1 letter b
length 1 new b 
...
Truncated

Test 6

Verdict:

input
6

correct output
fefdfefcfefdfefbfefdfefcfefdfe...

user output
starting 0 letter a
length 0 new a start of new 
mid a
starting 1 letter b
length 1 new b 
...
Truncated

Test 7

Verdict:

input
7

correct output
gfgegfgdgfgegfgcgfgegfgdgfgegf...

user output
starting 0 letter a
length 0 new a start of new 
mid a
starting 1 letter b
length 1 new b 
...
Truncated

Test 8

Verdict:

input
8

correct output
hghfhghehghfhghdhghfhghehghfhg...

user output
starting 0 letter a
length 0 new a start of new 
mid a
starting 1 letter b
length 1 new b 
...
Truncated

Test 9

Verdict:

input
9

correct output
ihigihifihigihieihigihifihigih...

user output
starting 0 letter a
length 0 new a start of new 
mid a
starting 1 letter b
length 1 new b 
...
Truncated

Test 10

Verdict:

input
10

correct output
jijhjijgjijhjijfjijhjijgjijhji...

user output
starting 0 letter a
length 0 new a start of new 
mid a
starting 1 letter b
length 1 new b 
...
Truncated

Test 11

Verdict:

input
11

correct output
kjkikjkhkjkikjkgkjkikjkhkjkikj...

user output
starting 0 letter a
length 0 new a start of new 
mid a
starting 1 letter b
length 1 new b 
...
Truncated

Test 12

Verdict:

input
12

correct output
lkljlklilkljlklhlkljlklilkljlk...

user output
starting 0 letter a
length 0 new a start of new 
mid a
starting 1 letter b
length 1 new b 
...
Truncated

Test 13

Verdict:

input
13

correct output
mlmkmlmjmlmkmlmimlmkmlmjmlmkml...

user output
starting 0 letter a
length 0 new a start of new 
mid a
starting 1 letter b
length 1 new b 
...
Truncated

Test 14

Verdict:

input
14

correct output
nmnlnmnknmnlnmnjnmnlnmnknmnlnm...

user output
starting 0 letter a
length 0 new a start of new 
mid a
starting 1 letter b
length 1 new b 
...
Truncated

Test 15

Verdict:

input
15

correct output
onomonolonomonokonomonolonomon...

user output
starting 0 letter a
length 0 new a start of new 
mid a
starting 1 letter b
length 1 new b 
...
Truncated

Test 16

Verdict:

input
16

correct output
popnpopmpopnpoplpopnpopmpopnpo...

user output
(empty)