結果
問題 | No.436 ccw |
ユーザー |
|
提出日時 | 2019-04-27 11:17:23 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 521 bytes |
コンパイル時間 | 15,187 ms |
コンパイル使用メモリ | 377,972 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-27 12:02:32 |
合計ジャッジ時間 | 16,348 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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' { if l / 2 > i { println!("{}", i); } else { println!("{}", l - i - 1); } return; } i += 1; } }