結果
| 問題 | 
                            No.436 ccw
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2019-04-27 11:20:43 | 
| 言語 | Rust  (1.83.0 + proconio)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 3 ms / 2,000 ms | 
| コード長 | 448 bytes | 
| コンパイル時間 | 16,372 ms | 
| コンパイル使用メモリ | 388,528 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-27 12:07:01 | 
| 合計ジャッジ時間 | 15,895 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 24 | 
ソースコード
use std::io::{self, BufRead};
fn get_lines() -> Vec<String> {
    let stdin = io::stdin();
    let lines: Vec<String> = stdin.lock().lines().map(|l| l.unwrap()).collect();
    return lines;
}
fn main(){
    let s = &get_lines()[0];
    let l = s.len();
    let mut i = 0;
    for c in s.chars().rev() {
        if c == 'c' {
            println!("{}", if l / 2 > i { i } else { l - i - 1 });
            return;
        }
        i += 1;
    }
}