CSES - Datatähti 2024 loppu - Results
Submission details
Task:Palindromi
Sender:Username*
Submission time:2024-01-20 13:09:17 +0200
Language:C++ (C++20)
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#1ACCEPTED0.00 sdetails
#20.00 sdetails
#3ACCEPTED0.00 sdetails
#40.00 sdetails
#50.00 sdetails
#6ACCEPTED0.00 sdetails
#70.00 sdetails
#80.00 sdetails
#90.00 sdetails
#10ACCEPTED0.00 sdetails
#110.00 sdetails
#120.00 sdetails
#130.00 sdetails
#140.00 sdetails
#150.00 sdetails
#160.00 sdetails
#17ACCEPTED0.00 sdetails

Code

#include "bits/stdc++.h"

typedef long long ll;

using namespace std;

int main() {
    // palindrome
    int n;
    int k;
    cin >> n;
    cin >> k;
    string p;
    for (int i = 0; i< k; ++i) {
        p += 'a';
    }
    cout << p;
    string r;
    vector<char> ch = {'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
     'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y','z'};
    for (int i = 0; i< n-k; ++i) {
        r += ch[i % ch.size()-1];
    }
    cout << r << endl;
    return 0;
}

Test details

Test 1

Verdict: ACCEPTED

input
1 1

correct output
a

user output
a

Test 2

Verdict:

input
2 1

correct output
ab

user output
a

Test 3

Verdict: ACCEPTED

input
2 2

correct output
aa

user output
aa

Test 4

Verdict:

input
3 1

correct output
abc

user output
ab

Test 5

Verdict:

input
3 2

correct output
aab

user output
aa

Test 6

Verdict: ACCEPTED

input
3 3

correct output
aaa

user output
aaa

Test 7

Verdict:

input
4 1

correct output
abca

user output
abc

Test 8

Verdict:

input
4 2

correct output
aabc

user output
aab

Test 9

Verdict:

input
4 3

correct output
aaab

user output
aaa

Test 10

Verdict: ACCEPTED

input
4 4

correct output
aaaa

user output
aaaa

Test 11

Verdict:

input
100 1

correct output
abcabcabcabcabcabcabcabcabcabc...

user output
abcdefghijklmnopqrstuvwxybcd...
Truncated

Test 12

Verdict:

input
100 2

correct output
aabcabcabcabcabcabcabcabcabcab...

user output
aabcdefghijklmnopqrstuvwxybc...
Truncated

Test 13

Verdict:

input
100 5

correct output
aaaaabcabcabcabcabcabcabcabcab...

user output
aaaaabcdefghijklmnopqrstuvwxy...
Truncated

Test 14

Verdict:

input
100 10

correct output
aaaaaaaaaabcabcabcabcabcabcabc...

user output
aaaaaaaaaabcdefghijklmnopqrst...
Truncated

Test 15

Verdict:

input
100 50

correct output
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

user output
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
Truncated

Test 16

Verdict:

input
100 90

correct output
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

user output
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
Truncated

Test 17

Verdict: ACCEPTED

input
100 100

correct output
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

user output
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
Truncated