Task: | Palindromi |
Sender: | 4321Boom4321 |
Submission time: | 2024-01-20 14:30:30 +0200 |
Language: | C++ (C++11) |
Status: | READY |
Result: | 100 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 100 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.00 s | details |
#2 | ACCEPTED | 0.00 s | details |
#3 | ACCEPTED | 0.00 s | details |
#4 | ACCEPTED | 0.00 s | details |
#5 | ACCEPTED | 0.00 s | details |
#6 | ACCEPTED | 0.00 s | details |
#7 | ACCEPTED | 0.00 s | details |
#8 | ACCEPTED | 0.00 s | details |
#9 | ACCEPTED | 0.00 s | details |
#10 | ACCEPTED | 0.00 s | details |
#11 | ACCEPTED | 0.00 s | details |
#12 | ACCEPTED | 0.00 s | details |
#13 | ACCEPTED | 0.00 s | details |
#14 | ACCEPTED | 0.00 s | details |
#15 | ACCEPTED | 0.00 s | details |
#16 | ACCEPTED | 0.00 s | details |
#17 | ACCEPTED | 0.00 s | details |
Code
#include <bits/stdc++.h> using namespace std; //create a sring of k length with "a" than add characters from b-z until the string is n long int main() { int n; cin >> n; int k; cin >> k; std::string answer; int x = 0; char letters[111]{ 'b', 'c', 'd', 'e','f','g','h','i','j','k','l','m','n','o','p','q','r','s', 't', 'b', 'c', 'd', 'e','f','g','h','i','j','k','l','m','n','o','p','q','r', 'u', 'b', 'c', 'd', 'e','f','g','h','i','j','k','l','m','n','o','p','q', 'w', 'b', 'c', 'd', 'e','f','g','h','i','j','k','l','m','n','o','p', 'x', 'b', 'c', 'd', 'e','f','g','h','i','j','k','l','m','n','o', 'y', 'b', 'c', 'd', 'e','f','g','h','i','j','k','l','m','n', 'z', }; for (int i = 0; i < k; i++) { answer += 'a'; } for (int j = k; j < n; j++){ answer += letters[x]; x += 1; } cout << answer << endl; }
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 |
---|
abcdefghijklmnopqrstbcdefghijk... Truncated |
Test 12
Verdict: ACCEPTED
input |
---|
100 2 |
correct output |
---|
aabcabcabcabcabcabcabcabcabcab... |
user output |
---|
aabcdefghijklmnopqrstbcdefghij... Truncated |
Test 13
Verdict: ACCEPTED
input |
---|
100 5 |
correct output |
---|
aaaaabcabcabcabcabcabcabcabcab... |
user output |
---|
aaaaabcdefghijklmnopqrstbcdefg... Truncated |
Test 14
Verdict: ACCEPTED
input |
---|
100 10 |
correct output |
---|
aaaaaaaaaabcabcabcabcabcabcabc... |
user output |
---|
aaaaaaaaaabcdefghijklmnopqrstb... 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 |