提出 #9851294


ソースコード 拡げる

fn main() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    println!("{}", max_acgt_len(s.as_str()))
}

fn max_acgt_len(s: &str) -> i32 {
    fn inner(rest: &mut std::str::Chars, current: i32, max: i32) -> i32 {
        let head = match rest.next() {
            Some(head) => head,
            None => return max,
        };

        match "ACGT".find(head) {
            Some(_) => {
                let next = current + 1;
                inner(rest, next, if max > next { max } else { next })
            },
            None => inner(rest, 0, max),
        }
    }

    inner(&mut s.chars(), 0, 0)
}

提出情報

提出日時
問題 B - ATCoder
ユーザ nobita0918
言語 Rust (1.15.1)
得点 200
コード長 660 Byte
結果 AC
実行時間 2 ms
メモリ 4352 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 3
AC × 13
セット名 テストケース
Sample a01, a02, a03
All a01, a02, a03, b04, b05, b06, b07, b08, b09, b10, b11, b12, b13
ケース名 結果 実行時間 メモリ
a01 AC 2 ms 4352 KiB
a02 AC 2 ms 4352 KiB
a03 AC 2 ms 4352 KiB
b04 AC 2 ms 4352 KiB
b05 AC 2 ms 4352 KiB
b06 AC 2 ms 4352 KiB
b07 AC 2 ms 4352 KiB
b08 AC 2 ms 4352 KiB
b09 AC 2 ms 4352 KiB
b10 AC 2 ms 4352 KiB
b11 AC 2 ms 4352 KiB
b12 AC 2 ms 4352 KiB
b13 AC 2 ms 4352 KiB