結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー cra77756176
提出日時 2022-11-30 23:42:23
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 402 bytes
コンパイル時間 10,988 ms
コンパイル使用メモリ 390,896 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-07 19:25:32
合計ジャッジ時間 12,367 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::io::{self, Read};

fn main() {
    let mut cc = String::new();
    io::stdin().read_to_string(&mut cc).ok();
    let cc = cc.chars().filter(|&c| c != '\n').collect::<Vec<_>>();

    let (mut max, mut seq) = (0, 0);
    for &c in &cc {
        if c == 'o' {
            seq += 1;
            max = max.max(seq);
        } else {
            seq = 0;
        }
    }

    println!("{}", max);
}
0