Submission #51474942


Source Code Expand

use std::collections::VecDeque;

use proconio::{input, marker::Chars};

fn main() {
    input! {
        s: Chars,
    };
    let mut s = s.into_iter().collect::<VecDeque<char>>();
    while s.len() > 1 && s[0] == 'a' && s[s.len() - 1] == 'a' {
        s.pop_front();
        s.pop_back();
    }
    if s.len() <= 1 {
        println!("Yes");
        return;
    }

    while !s.is_empty() && s[s.len() - 1] == 'a' {
        s.pop_back();
    }

    for i in 0..s.len() / 2 {
        if s[i] != s[s.len() - 1 - i] {
            println!("No");
            return;
        }
    }
    println!("Yes");
}

Submission Info

Submission Time
Task E - kasaka
User bouzuya
Language Rust (rustc 1.70.0)
Score 300
Code Size 603 Byte
Status AC
Exec Time 5 ms
Memory 6836 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 29
Set Name Test Cases
Sample example_00.txt, example_01.txt, example_02.txt
All example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, hand_10.txt, hand_11.txt, hand_12.txt, hand_13.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt
Case Name Status Exec Time Memory
example_00.txt AC 1 ms 1968 KiB
example_01.txt AC 1 ms 2060 KiB
example_02.txt AC 1 ms 2080 KiB
hand_00.txt AC 5 ms 6836 KiB
hand_01.txt AC 5 ms 6776 KiB
hand_02.txt AC 5 ms 6744 KiB
hand_03.txt AC 5 ms 6684 KiB
hand_04.txt AC 5 ms 6736 KiB
hand_05.txt AC 5 ms 6692 KiB
hand_06.txt AC 4 ms 6760 KiB
hand_07.txt AC 5 ms 6736 KiB
hand_08.txt AC 4 ms 6700 KiB
hand_09.txt AC 0 ms 2000 KiB
hand_10.txt AC 1 ms 1924 KiB
hand_11.txt AC 5 ms 6756 KiB
hand_12.txt AC 5 ms 6680 KiB
hand_13.txt AC 5 ms 6836 KiB
random_00.txt AC 4 ms 6092 KiB
random_01.txt AC 4 ms 5992 KiB
random_02.txt AC 4 ms 6096 KiB
random_03.txt AC 3 ms 4880 KiB
random_04.txt AC 3 ms 4816 KiB
random_05.txt AC 4 ms 6140 KiB
random_06.txt AC 4 ms 6224 KiB
random_07.txt AC 3 ms 5280 KiB
random_08.txt AC 4 ms 6684 KiB
random_09.txt AC 3 ms 6132 KiB
random_10.txt AC 5 ms 6772 KiB
random_11.txt AC 4 ms 6752 KiB