| Task: | Palindromi |
| Sender: | Pinval |
| Submission time: | 2025-10-30 13:59:08 +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 |
Code
#include <iostream>
#include <cmath>
using namespace std;
int main(){
string str;
int laskuri=0;
//Luetaan syöte
cin >> str;
//Selvitetaan syötteen merkkimäärä
int p=str.size();
cout << p << endl;
int a=0;
int b=p-1;
// Syöte on parillinen
cout <<"a"<< a << " b " << b << endl;
for(int i=0; i<(ceil(p/2)-1); i+=1){
if(str[a]!=str[b]){
laskuri+=1;
}
a+=1;
b-=1;
cout << "i "<< i << endl;
cout << a << " " << b << endl;
}
cout << laskuri << endl;
return 0;
}
Test details
Test 1 (public)
Verdict: WRONG ANSWER
| input |
|---|
| datatahti |
| correct output |
|---|
| 3 |
| user output |
|---|
| 9 a0 b 8 i 0 1 7 i 1 ... |
Test 2 (public)
Verdict: WRONG ANSWER
| input |
|---|
| saippuakauppias |
| correct output |
|---|
| 0 |
| user output |
|---|
| 15 a0 b 14 i 0 1 13 i 1 ... |
Test 3 (public)
Verdict: WRONG ANSWER
| input |
|---|
| a |
| correct output |
|---|
| 0 |
| user output |
|---|
| 1 a0 b 0 0 |
Test 4 (public)
Verdict: WRONG ANSWER
| input |
|---|
| aa |
| correct output |
|---|
| 0 |
| user output |
|---|
| 2 a0 b 1 0 |
Test 5 (public)
Verdict: WRONG ANSWER
| input |
|---|
| abc |
| correct output |
|---|
| 1 |
| user output |
|---|
| 3 a0 b 2 0 |
Test 6 (public)
Verdict: WRONG ANSWER
| input |
|---|
| aybabtu |
| correct output |
|---|
| 2 |
| user output |
|---|
| 7 a0 b 6 i 0 1 5 i 1 ... |
Test 7 (public)
Verdict: WRONG ANSWER
| input |
|---|
| abacabaca |
| correct output |
|---|
| 2 |
| user output |
|---|
| 9 a0 b 8 i 0 1 7 i 1 ... |
Test 8 (public)
Verdict: WRONG ANSWER
| input |
|---|
| bbbbaaaababbbbbaabaaabaaaaabab... |
| correct output |
|---|
| 23 |
| user output |
|---|
| 100 a0 b 99 i 0 1 98 i 1 ... |
Test 9 (public)
Verdict: WRONG ANSWER
| input |
|---|
| acbaaabaabaddaccdcccbcdbdddacd... |
| correct output |
|---|
| 38 |
| user output |
|---|
| 100 a0 b 99 i 0 1 98 i 1 ... |
Test 10 (public)
Verdict: WRONG ANSWER
| input |
|---|
| uaqtmfftecryanvpshxsodjrllqnqp... |
| correct output |
|---|
| 49 |
| user output |
|---|
| 100 a0 b 99 i 0 1 98 i 1 ... |
