結果
| 問題 | No.2035 Tunnel |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-08-30 10:37:05 |
| 言語 | Rust (1.97.1 + proconio + num + itertools + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 3 ms / 2,000 ms |
| + 125µs | |
| コード長 | 556 bytes |
| 記録 | |
| コンパイル時間 | 6,441 ms |
| コンパイル使用メモリ | 186,740 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-09-20 02:45:50 |
| 合計ジャッジ時間 | 3,072 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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);
}