提出 #40106483


ソースコード 拡げる

use std::collections::VecDeque;

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

fn main() {
    input! {
        s: [Chars; 3],
    };
    let mut s = vec![
        s[0].iter()
            .copied()
            .map(|c| (c as u8 - b'a') as usize)
            .collect::<VecDeque<usize>>(),
        s[1].iter()
            .copied()
            .map(|c| (c as u8 - b'a') as usize)
            .collect::<VecDeque<usize>>(),
        s[2].iter()
            .copied()
            .map(|c| (c as u8 - b'a') as usize)
            .collect::<VecDeque<usize>>(),
    ];
    let mut index = 0_usize;
    while let Some(c) = s[index].pop_front() {
        index = c;
    }
    let ans = (b'A' + index as u8) as char;
    println!("{}", ans);
}

提出情報

提出日時
問題 B - 3人でカードゲームイージー
ユーザ bouzuya
言語 Rust (1.42.0)
得点 200
コード長 727 Byte
結果 AC
実行時間 7 ms
メモリ 2168 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果 AC
AC × 12
セット名 テストケース
Sample
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, sample_01.txt, sample_02.txt
ケース名 結果 実行時間 メモリ
01.txt AC 7 ms 2024 KiB
02.txt AC 1 ms 1988 KiB
03.txt AC 3 ms 2168 KiB
04.txt AC 1 ms 2084 KiB
05.txt AC 1 ms 2016 KiB
06.txt AC 1 ms 2028 KiB
07.txt AC 2 ms 2116 KiB
08.txt AC 1 ms 2092 KiB
09.txt AC 1 ms 1968 KiB
10.txt AC 1 ms 1996 KiB
sample_01.txt AC 2 ms 2120 KiB
sample_02.txt AC 1 ms 2000 KiB