プログラミングのお題スレ Part22 (863レス)
上下前次1-新
抽出解除 必死チェッカー(本家) (べ) 自ID レス栞 あぼーん
リロード規制です。10分ほどで解除するので、他のブラウザへ避難してください。
6(2): デフォルトの名無しさん [sage] 2023/08/06(日)19:07 ID:Md+pNxjw(1)
use std::io::{self, BufRead, BufReader};
const FULL_BITS: u32 = (1 << 26) - 1;
fn main() {
let mut shortest: Option<String> = None;
for line in BufReader::new(io::stdin()).lines() {
let line = line.unwrap();
let mut bits = 0;
for b in line.as_bytes() {
let index = match b {
b'A'..=b'Z' => b - b'A',
b'a'..=b'z' => b - b'a',
_ => continue,
};
bits |= 1 << index;
}
if bits != FULL_BITS {
continue;
}
if let Some(ref shortest) = shortest {
if shortest.len() < line.len() {
continue;
}
}
shortest = Some(line);
}
if let Some(shortest) = shortest {
println!("{shortest}");
} else {
eprintln!("ERROR: no matched lines");
}
}
上下前次1-新書関写板覧索設栞歴
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ AAサムネイル
ぬこの手 ぬこTOP 0.026s