Submission #63017040


Source Code Expand

Copy
#![allow(unused_imports)]
#![allow(unused_variables)]
#![allow(non_snake_case)]
use ac_library::*;
use once_cell::sync::Lazy;
use static_assertions::*;
use varisat::*;
use memoise::*;
use argio::*;
use bitvec::prelude::*;
use counter::Counter;
use hashbag::*;
use pathfinding::prelude::*;
use recur_fn::*;
use ::indexing::*;
use amplify::*;
use amplify_derive::*;
use amplify_num::*;
use easy_ext::*;
use multimap::*;
use btreemultimap::*;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#![allow(unused_imports)]
#![allow(unused_variables)]
#![allow(non_snake_case)]
use ac_library::*;
use once_cell::sync::Lazy;
use static_assertions::*;
use varisat::*;
use memoise::*;
use argio::*;
use bitvec::prelude::*;
use counter::Counter;
use hashbag::*;
use pathfinding::prelude::*;
use recur_fn::*;
use ::indexing::*;
use amplify::*;
use amplify_derive::*;
use amplify_num::*;
use easy_ext::*;
use multimap::*;
use btreemultimap::*;
use bstr::*;
use az::*;
use glidesort::*;
use ::tap::*;
use omniswap::*;
use multiversion::*;
use ::num::*;
use num_bigint::*;
use num_complex::*;
use num_integer::*;
use num_iter::*;
use num_rational::*;
use num_traits::*;
use num_derive::*;
use ndarray::*;
use nalgebra::*;
use alga::*;
use libm::*;
use rand::*;
use getrandom::*;
use rand_chacha::*;
use rand_core::*;
use rand_hc::*;
use rand_pcg::*;
use rand_distr::*;
use petgraph::*;
use indexmap::*;
use regex::*;
use lazy_static::*;
use ordered_float::*;
use ascii::*;
use permutohedron::*;
use superslice::*;
use itertools::*;
use itertools_num::*;
use maplit::*;
use either::*;
use im_rc::*;
use fixedbitset::*;
use bitset_fixed::*;
use proconio::input;
use proconio::marker::{Bytes, Chars, Usize1};
use text_io::*;
use rustc_hash::*;
use smallvec::*;
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};

fn main() {
    input! {
        S: proconio::marker::Chars
    }

    let ans = solve(S);
    println!("{}", ans.iter().collect::<String>());
}

fn solve(mut S: Vec<char>) -> Vec<char> {
    let mut i = 0;
    while i < S.len() - 1 {
        if S[i] == 'W' && S[i + 1] == 'A' {
            S[i] = 'A';
            S[i + 1] = 'C';
            i = if i > 0 { i - 1 } else { 0 };
        } else {
            i += 1;
        }
    }
    S
}

Submission Info

Submission Time
Task C - Debug
User maysay_d
Language Rust (rustc 1.70.0)
Score 300
Code Size 1753 Byte
Status AC
Exec Time 4 ms
Memory 3728 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 30
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, 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, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt
Case Name Status Exec Time Memory
example_00.txt AC 1 ms 1960 KB
example_01.txt AC 1 ms 2072 KB
example_02.txt AC 1 ms 2004 KB
hand_00.txt AC 3 ms 3628 KB
hand_01.txt AC 3 ms 3672 KB
hand_02.txt AC 4 ms 3620 KB
hand_03.txt AC 3 ms 3628 KB
hand_04.txt AC 1 ms 1896 KB
hand_05.txt AC 1 ms 1924 KB
hand_06.txt AC 3 ms 3648 KB
random_00.txt AC 4 ms 3636 KB
random_01.txt AC 4 ms 3668 KB
random_02.txt AC 3 ms 3652 KB
random_03.txt AC 3 ms 3568 KB
random_04.txt AC 3 ms 3588 KB
random_05.txt AC 3 ms 3584 KB
random_06.txt AC 3 ms 3672 KB
random_07.txt AC 3 ms 3700 KB
random_08.txt AC 4 ms 3648 KB
random_09.txt AC 3 ms 3728 KB
random_10.txt AC 3 ms 3728 KB
random_11.txt AC 3 ms 3628 KB
random_12.txt AC 3 ms 3664 KB
random_13.txt AC 3 ms 3516 KB
random_14.txt AC 3 ms 3724 KB
random_15.txt AC 3 ms 3728 KB
random_16.txt AC 3 ms 3568 KB
random_17.txt AC 3 ms 3564 KB
random_18.txt AC 3 ms 3560 KB
random_19.txt AC 3 ms 3680 KB


2025-04-04 (Fri)
03:51:04 +00:00