結果
問題 | No.2925 2-Letter Shiritori |
ユーザー |
|
提出日時 | 2024-10-12 17:10:24 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 62 ms / 2,000 ms |
コード長 | 802 bytes |
コンパイル時間 | 14,835 ms |
コンパイル使用メモリ | 391,168 KB |
実行使用メモリ | 25,488 KB |
平均クエリ数 | 26.00 |
最終ジャッジ日時 | 2024-10-12 17:10:41 |
合計ジャッジ時間 | 16,691 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 10 |
ソースコード
use std::io::Write;fn main() {let alpha = {let mut line = String::new();std::io::stdin().read_line(&mut line).unwrap();line.trim().parse::<String>().unwrap()};let mut prev = alpha.repeat(2);loop {println!("? {}", prev.chars().rev().collect::<String>());std::io::stdout().flush().unwrap();let (symbol, t) = {let mut line = String::new();std::io::stdin().read_line(&mut line).unwrap();let mut iter = line.split_whitespace();(iter.next().unwrap().parse::<char>().unwrap(),iter.next().unwrap().parse::<String>().unwrap(),)};if symbol == '!' {break;}prev = t.to_string();}}