Task: | Palindromi |
Sender: | Bean Benestrom |
Submission time: | 2024-01-20 13:14:23 +0200 |
Language: | C++ (C++17) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.00 s | details |
#2 | WRONG ANSWER | 0.00 s | details |
#3 | WRONG ANSWER | 0.00 s | details |
#4 | WRONG ANSWER | 0.00 s | details |
#5 | WRONG ANSWER | 0.00 s | details |
#6 | WRONG ANSWER | 0.00 s | details |
#7 | WRONG ANSWER | 0.00 s | details |
#8 | WRONG ANSWER | 0.00 s | details |
#9 | WRONG ANSWER | 0.00 s | details |
#10 | WRONG ANSWER | 0.00 s | details |
#11 | WRONG ANSWER | 0.00 s | details |
#12 | WRONG ANSWER | 0.00 s | details |
#13 | WRONG ANSWER | 0.00 s | details |
#14 | WRONG ANSWER | 0.00 s | details |
#15 | WRONG ANSWER | 0.00 s | details |
#16 | WRONG ANSWER | 0.00 s | details |
#17 | WRONG ANSWER | 0.00 s | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:12:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare] 12 | for (int i=0; i<palindrome.size()/2; i++) { | ~^~~~~~~~~~~~~~~~~~~~
Code
#include <iostream> #include <vector> int main() { int N, K; std::cin >> N >> K; std::vector<char> palindrome(K); for (int i=0; i<palindrome.size()/2; i++) { char c = (char)('a'+(i%24)); palindrome[i] = c; palindrome[palindrome.size()-1-i] = c; } if (palindrome.size() % 2) palindrome[palindrome.size()/2] = (char)('a'+24); int left = N - palindrome.size(); if (left > 0) { palindrome.push_back('z'); left--; } int i=0; while (left > 0) { palindrome.push_back((char)('a'+(i%24))); left--; i++; } return 0; } // 'a'+25 = z // (i%25) last is Y
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
1 1 |
correct output |
---|
a |
user output |
---|
(empty) |
Test 2
Verdict: WRONG ANSWER
input |
---|
2 1 |
correct output |
---|
ab |
user output |
---|
(empty) |
Test 3
Verdict: WRONG ANSWER
input |
---|
2 2 |
correct output |
---|
aa |
user output |
---|
(empty) |
Test 4
Verdict: WRONG ANSWER
input |
---|
3 1 |
correct output |
---|
abc |
user output |
---|
(empty) |
Test 5
Verdict: WRONG ANSWER
input |
---|
3 2 |
correct output |
---|
aab |
user output |
---|
(empty) |
Test 6
Verdict: WRONG ANSWER
input |
---|
3 3 |
correct output |
---|
aaa |
user output |
---|
(empty) |
Test 7
Verdict: WRONG ANSWER
input |
---|
4 1 |
correct output |
---|
abca |
user output |
---|
(empty) |
Test 8
Verdict: WRONG ANSWER
input |
---|
4 2 |
correct output |
---|
aabc |
user output |
---|
(empty) |
Test 9
Verdict: WRONG ANSWER
input |
---|
4 3 |
correct output |
---|
aaab |
user output |
---|
(empty) |
Test 10
Verdict: WRONG ANSWER
input |
---|
4 4 |
correct output |
---|
aaaa |
user output |
---|
(empty) |
Test 11
Verdict: WRONG ANSWER
input |
---|
100 1 |
correct output |
---|
abcabcabcabcabcabcabcabcabcabc... |
user output |
---|
(empty) |
Test 12
Verdict: WRONG ANSWER
input |
---|
100 2 |
correct output |
---|
aabcabcabcabcabcabcabcabcabcab... |
user output |
---|
(empty) |
Test 13
Verdict: WRONG ANSWER
input |
---|
100 5 |
correct output |
---|
aaaaabcabcabcabcabcabcabcabcab... |
user output |
---|
(empty) |
Test 14
Verdict: WRONG ANSWER
input |
---|
100 10 |
correct output |
---|
aaaaaaaaaabcabcabcabcabcabcabc... |
user output |
---|
(empty) |
Test 15
Verdict: WRONG ANSWER
input |
---|
100 50 |
correct output |
---|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... |
user output |
---|
(empty) |
Test 16
Verdict: WRONG ANSWER
input |
---|
100 90 |
correct output |
---|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... |
user output |
---|
(empty) |
Test 17
Verdict: WRONG ANSWER
input |
---|
100 100 |
correct output |
---|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... |
user output |
---|
(empty) |