結果
| 問題 |
No.2035 Tunnel
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-08-30 10:37:05 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 5 ms / 2,000 ms |
| コード長 | 556 bytes |
| コンパイル時間 | 13,224 ms |
| コンパイル使用メモリ | 379,548 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-07 05:37:48 |
| 合計ジャッジ時間 | 15,230 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
ソースコード
fn main() {
let mut n = String::new();
std::io::stdin().read_line(&mut n).ok();
let n: usize = n.trim().parse().unwrap();
let mut s = String::new();
std::io::stdin().read_line(&mut s).ok();
let mut s = s.trim().chars().collect::<Vec<char>>();
s.reverse();
let mut maxval = 0usize;
let mut delay = 0usize;
for i in 0..n {
if s[i] == '.' {
if delay > 0 { delay -= 1; }
continue;
}
maxval = maxval.max(i+1+delay);
delay += 1;
}
println!("{}", maxval);
}