| Task: | Palindromi |
| Sender: | Jaksu |
| Submission time: | 2025-10-27 18:37:43 +0200 |
| Language: | Rust (2021) |
| 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 |
Code
use std::io;
fn main() {
let mut input = String::new();
io::stdin().read_line(&mut input).expect("Failed to read input");
let s = input.trim().as_bytes();
let length = s.len();
let strlength = length/2;
let mut output= 0;
dbg!(s);
for index in 0..strlength {
if s[index] != s[length-index-1] {
output += 1
}
}
println!("{}", output);
}Test details
Test 1 (public)
Verdict: ACCEPTED
| input |
|---|
| datatahti |
| correct output |
|---|
| 3 |
| user output |
|---|
| 3 |
Error:
[input/code.rs:11] s = [
100,
97,
116,
97,
116,
97,
104,
116,
105,
]Test 2 (public)
Verdict: ACCEPTED
| input |
|---|
| saippuakauppias |
| correct output |
|---|
| 0 |
| user output |
|---|
| 0 |
Error:
[input/code.rs:11] s = [
115,
97,
105,
112,
112,
117,
97,
107,
97,
117,
112,
112,
105,
97,
115,
]Test 3 (public)
Verdict: ACCEPTED
| input |
|---|
| a |
| correct output |
|---|
| 0 |
| user output |
|---|
| 0 |
Error:
[input/code.rs:11] s = [
97,
]Test 4 (public)
Verdict: ACCEPTED
| input |
|---|
| aa |
| correct output |
|---|
| 0 |
| user output |
|---|
| 0 |
Error:
[input/code.rs:11] s = [
97,
97,
]Test 5 (public)
Verdict: ACCEPTED
| input |
|---|
| abc |
| correct output |
|---|
| 1 |
| user output |
|---|
| 1 |
Error:
[input/code.rs:11] s = [
97,
98,
99,
]Test 6 (public)
Verdict: ACCEPTED
| input |
|---|
| aybabtu |
| correct output |
|---|
| 2 |
| user output |
|---|
| 2 |
Error:
[input/code.rs:11] s = [
97,
121,
98,
97,
98,
116,
117,
]Test 7 (public)
Verdict: ACCEPTED
| input |
|---|
| abacabaca |
| correct output |
|---|
| 2 |
| user output |
|---|
| 2 |
Error:
[input/code.rs:11] s = [
97,
98,
97,
99,
97,
98,
97,
99,
97,
]Test 8 (public)
Verdict: ACCEPTED
| input |
|---|
| bbbbaaaababbbbbaabaaabaaaaabab... |
| correct output |
|---|
| 23 |
| user output |
|---|
| 23 |
Error:
[input/code.rs:11] s = [
98,
98,
98,
98,
97,
97,
97,
97,
98,
97,
98,
98,
98,
98,
98,
97,
97,
98,
97,
97,
97,
98,
97,
97,
97,
97,
97,
98,
97,
98,
97,
97,
97,
98,
98,
97,
97,
97,
98,
98,
97,
98,
98,
97,
97,
98,
98,
98,
97,
97,
97,
97,
97,
98,
97,
98,
97,
98,
97,
98,
97,
97,
98,
97,
97,
97,
98,
98,
97,
97,
97,
98,
98,
98,
98,
97,
97,
97,
98,
97,
97,
97,
98,
97,
97,
97,
98,
97,
98,
97,
98,
98,
97,
98,
98,
97,
98,
97,
97,
97,
]Test 9 (public)
Verdict: ACCEPTED
| input |
|---|
| acbaaabaabaddaccdcccbcdbdddacd... |
| correct output |
|---|
| 38 |
| user output |
|---|
| 38 |
Error:
[input/code.rs:11] s = [
97,
99,
98,
97,
97,
97,
98,
97,
97,
98,
97,
100,
100,
97,
99,
99,
100,
99,
99,
99,
98,
99,
100,
98,
100,
100,
100,
97,
99,
100,
99,
100,
100,
97,
97,
100,
100,
100,
98,
98,
99,
98,
98,
98,
100,
97,
99,
99,
100,
97,
100,
98,
98,
98,
100,
100,
100,
97,
99,
98,
97,
97,
99,
97,
100,
99,
99,
100,
100,
97,
98,
97,
97,
97,
100,
98,
100,
99,
99,
99,
100,
99,
100,
97,
97,
99,
100,
99,
98,
98,
98,
98,
97,
97,
100,
97,
98,
97,
98,
98,
]Test 10 (public)
Verdict: ACCEPTED
| input |
|---|
| uaqtmfftecryanvpshxsodjrllqnqp... |
| correct output |
|---|
| 49 |
| user output |
|---|
| 49 |
Error:
[input/code.rs:11] s = [
117,
97,
113,
116,
109,
102,
102,
116,
101,
99,
114,
121,
97,
110,
118,
112,
115,
104,
120,
115,
111,
100,
106,
114,
108,
108,
113,
110,
113,
112,
117,
110,
120,
105,
99,
104,
99,
118,
98,
113,
111,
118,
102,
119,
106,
116,
104,
119,
105,
101,
119,
109,
122,
119,
112,
105,
118,
116,
100,
116,
100,
108,
119,
98,
107,
105,
111,
105,
112,
97,
116,
98,
98,
104,
99,
118,
101,
112,
117,
107,
100,
111,
115,
119,
97,
102,
120,
105,
118,
114,
100,
103,
103,
115,
97,
112,
118,
108,
109,
104,
]