Submission #3820962


Source Code Expand

fn read_input() -> String {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s);
    s
}

fn solve(s: String, t: String) {
    let mut v_s: Vec<_> = s.trim().chars().collect();
    let t_s: Vec<_> = t.trim().chars().collect();
    for _ in 0..s.len() {
        if v_s == t_s {
            println!("Yes");
            return;
        }
        let last = v_s.pop().unwrap();
        v_s.insert(0, last);
    }
    println!("No");
}

fn main() {
    solve(read_input(), read_input());
}

Submission Info

Submission Time
Task B - String Rotation
User knium_
Language Rust (1.15.1)
Score 200
Code Size 527 Byte
Status AC
Exec Time 2 ms
Memory 4352 KB

Compile Error

warning: unused result which must be used, #[warn(unused_must_use)] on by default
 --> ./Main.rs:3:5
  |
3 |     std::io::stdin().read_line(&mut s);
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 14
Set Name Test Cases
Sample sample_01, sample_02, sample_03
All 0_small_0, 0_small_1, 0_small_2, 0_small_3, 1_medium_0, 1_medium_1, 1_medium_2, 2_max_0, 2_max_1, 2_max_2, 2_max_3, sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
0_small_0 AC 2 ms 4352 KB
0_small_1 AC 2 ms 4352 KB
0_small_2 AC 2 ms 4352 KB
0_small_3 AC 2 ms 4352 KB
1_medium_0 AC 2 ms 4352 KB
1_medium_1 AC 2 ms 4352 KB
1_medium_2 AC 2 ms 4352 KB
2_max_0 AC 2 ms 4352 KB
2_max_1 AC 2 ms 4352 KB
2_max_2 AC 2 ms 4352 KB
2_max_3 AC 2 ms 4352 KB
sample_01 AC 2 ms 4352 KB
sample_02 AC 2 ms 4352 KB
sample_03 AC 2 ms 4352 KB