結果
問題 | No.3019 YNeos |
ユーザー |
|
提出日時 | 2025-03-02 00:34:50 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 817 bytes |
コンパイル時間 | 12,038 ms |
コンパイル使用メモリ | 406,052 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-03-02 00:35:04 |
合計ジャッジ時間 | 13,918 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 41 |
ソースコード
#[allow(unused)]use proconio::{input, marker::Chars};fn main() {input! {x: String,y: String,}let n = x.len() + y.len();let mut s = String::new();let mut xx = x.clone();let mut yy = y.clone();for i in 0..n {if i % 2 == 0 && xx.len() > 0 {s.push(xx.remove(0));} else if i % 2 == 1 && yy.len() > 0 {s.push(yy.remove(0));}}let a = s.chars().enumerate().filter(|(i, _)| i % 2 == 0).map(|(_, x)| x).collect::<String>();let b = s.chars().enumerate().filter(|(i, _)| i % 2 == 1).map(|(_, x)| x).collect::<String>();if a == x && b == y {println!("{}", s)} else {println!("?")}}