結果
| 問題 | No.3015 右に寄せろ! |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-01-25 14:22:30 |
| 言語 | Rust (1.94.0 + proconio + num + itertools) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 601 bytes |
| 記録 | |
| コンパイル時間 | 700 ms |
| コンパイル使用メモリ | 186,752 KB |
| 実行使用メモリ | 19,968 KB |
| 最終ジャッジ日時 | 2026-06-24 00:59:16 |
| 合計ジャッジ時間 | 7,818 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 -- * 35 |
ソースコード
use proconio::{input, marker::Chars};
fn main() {
input! {
mut s: Chars,
}
s.reverse();
let mut stack = vec![];
let mut ans = 0;
while let Some(ch) = s.pop() {
stack.push(ch);
if stack.len() < 3 {
continue;
}
if &stack[stack.len() - 3..] == &['1', '1', '0'] {
let a = stack.pop().unwrap();
let b = stack.pop().unwrap();
let c = stack.pop().unwrap();
s.push(c);
s.push(b);
s.push(a);
ans += 1;
}
}
println!("{}", ans);
}