CSES - Datatähti 2024 loppu - Results
Submission details
Task:Palindromi
Sender:anotn
Submission time:2024-01-20 13:05:35 +0200
Language:C++ (C++17)
Status:READY
Result:100
Feedback
groupverdictscore
#1ACCEPTED100
Test results
testverdicttime
#1ACCEPTED0.00 sdetails
#2ACCEPTED0.00 sdetails
#3ACCEPTED0.00 sdetails
#4ACCEPTED0.00 sdetails
#5ACCEPTED0.00 sdetails
#6ACCEPTED0.00 sdetails
#7ACCEPTED0.00 sdetails
#8ACCEPTED0.00 sdetails
#9ACCEPTED0.00 sdetails
#10ACCEPTED0.00 sdetails
#11ACCEPTED0.00 sdetails
#12ACCEPTED0.00 sdetails
#13ACCEPTED0.00 sdetails
#14ACCEPTED0.00 sdetails
#15ACCEPTED0.00 sdetails
#16ACCEPTED0.00 sdetails
#17ACCEPTED0.00 sdetails

Code

#include <iostream>
using namespace std;

int main(){
    int n, k;
    cin >> n >> k;

    int counter = 0;
    for(int i = 0; i < (n-k)/2; i++){
        cout << char('a'+i%5);
        counter++;
    }

    for(int i = 0; i < k; i++){
        cout << "h";
        counter++;
    }

    for(int i = 0; i < n-counter; i++){
        cout << char('l'+i%5);
    }
    
}

Test details

Test 1

Verdict: ACCEPTED

input
1 1

correct output
a

user output
h

Test 2

Verdict: ACCEPTED

input
2 1

correct output
ab

user output
hl

Test 3

Verdict: ACCEPTED

input
2 2

correct output
aa

user output
hh

Test 4

Verdict: ACCEPTED

input
3 1

correct output
abc

user output
ahl

Test 5

Verdict: ACCEPTED

input
3 2

correct output
aab

user output
hhl

Test 6

Verdict: ACCEPTED

input
3 3

correct output
aaa

user output
hhh

Test 7

Verdict: ACCEPTED

input
4 1

correct output
abca

user output
ahlm

Test 8

Verdict: ACCEPTED

input
4 2

correct output
aabc

user output
ahhl

Test 9

Verdict: ACCEPTED

input
4 3

correct output
aaab

user output
hhhl

Test 10

Verdict: ACCEPTED

input
4 4

correct output
aaaa

user output
hhhh

Test 11

Verdict: ACCEPTED

input
100 1

correct output
abcabcabcabcabcabcabcabcabcabc...

user output
abcdeabcdeabcdeabcdeabcdeabcde...
Truncated

Test 12

Verdict: ACCEPTED

input
100 2

correct output
aabcabcabcabcabcabcabcabcabcab...

user output
abcdeabcdeabcdeabcdeabcdeabcde...
Truncated

Test 13

Verdict: ACCEPTED

input
100 5

correct output
aaaaabcabcabcabcabcabcabcabcab...

user output
abcdeabcdeabcdeabcdeabcdeabcde...
Truncated

Test 14

Verdict: ACCEPTED

input
100 10

correct output
aaaaaaaaaabcabcabcabcabcabcabc...

user output
abcdeabcdeabcdeabcdeabcdeabcde...
Truncated

Test 15

Verdict: ACCEPTED

input
100 50

correct output
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

user output
abcdeabcdeabcdeabcdeabcdehhhhh...
Truncated

Test 16

Verdict: ACCEPTED

input
100 90

correct output
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

user output
abcdehhhhhhhhhhhhhhhhhhhhhhhhh...
Truncated

Test 17

Verdict: ACCEPTED

input
100 100

correct output
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

user output
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhh...
Truncated