CSES - Datatähti 2024 loppu - Results
Submission details
Task:Palindromi
Sender:Kemm1706
Submission time:2024-01-20 13:03:01 +0200
Language:C++ (C++11)
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

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:32:18: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 |     for(i = k; i < s.length(); i++)
      |                ~~^~~~~~~~~~~~

Code

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector <ll> vl;
typedef vector <vl> vvl;
typedef pair <ll, ll> pl;
typedef vector <pl> vpl;
typedef vector <bool> vb;

const ll inf = 1e18;
const ll mod = 1e9 + 7;
const ll nmax = 1e6;

#define fi first
#define se second
#define mp make_pair
#define pb push_back

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);

    ll n, k, i;
    char j = 'b';
    cin >> n >> k;

    string s;
    s.resize(n);
    for(i = 0; i < k; i++)
        s[i] = 'a';
    for(i = k; i < s.length(); i++)
    {
        s[i] = j;
        j++;
        if(j > 'z')
            j = 'b';
    }
    cout << s;

    return 0;
}

Test details

Test 1

Verdict: ACCEPTED

input
1 1

correct output
a

user output
a

Test 2

Verdict: ACCEPTED

input
2 1

correct output
ab

user output
ab

Test 3

Verdict: ACCEPTED

input
2 2

correct output
aa

user output
aa

Test 4

Verdict: ACCEPTED

input
3 1

correct output
abc

user output
abc

Test 5

Verdict: ACCEPTED

input
3 2

correct output
aab

user output
aab

Test 6

Verdict: ACCEPTED

input
3 3

correct output
aaa

user output
aaa

Test 7

Verdict: ACCEPTED

input
4 1

correct output
abca

user output
abcd

Test 8

Verdict: ACCEPTED

input
4 2

correct output
aabc

user output
aabc

Test 9

Verdict: ACCEPTED

input
4 3

correct output
aaab

user output
aaab

Test 10

Verdict: ACCEPTED

input
4 4

correct output
aaaa

user output
aaaa

Test 11

Verdict: ACCEPTED

input
100 1

correct output
abcabcabcabcabcabcabcabcabcabc...

user output
abcdefghijklmnopqrstuvwxyzbcde...
Truncated

Test 12

Verdict: ACCEPTED

input
100 2

correct output
aabcabcabcabcabcabcabcabcabcab...

user output
aabcdefghijklmnopqrstuvwxyzbcd...
Truncated

Test 13

Verdict: ACCEPTED

input
100 5

correct output
aaaaabcabcabcabcabcabcabcabcab...

user output
aaaaabcdefghijklmnopqrstuvwxyz...
Truncated

Test 14

Verdict: ACCEPTED

input
100 10

correct output
aaaaaaaaaabcabcabcabcabcabcabc...

user output
aaaaaaaaaabcdefghijklmnopqrstu...
Truncated

Test 15

Verdict: ACCEPTED

input
100 50

correct output
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

user output
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
Truncated

Test 16

Verdict: ACCEPTED

input
100 90

correct output
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

user output
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
Truncated

Test 17

Verdict: ACCEPTED

input
100 100

correct output
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

user output
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
Truncated