結果
| 問題 |
No.729 文字swap
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-11-05 10:51:08 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 580 bytes |
| コンパイル時間 | 24,833 ms |
| コンパイル使用メモリ | 377,680 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-15 19:47:35 |
| 合計ジャッジ時間 | 13,946 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 |
ソースコード
fn main() {
let mut vs: Vec<char> = input_line_string().chars().collect();
let swap: Vec<usize> = input_line_vc();
vs.swap(swap[0], swap[1]);
println!("{}", vs.iter().collect::<String>());
}
fn input_line_vc<T: std::str::FromStr>() -> Vec<T> {
let mut s = String::new();
std::io::stdin().read_line(&mut s).ok();
s.trim()
.split_whitespace()
.map(|e| e.parse().ok().unwrap())
.collect()
}
fn input_line_string() -> String {
let mut s = String::new();
std::io::stdin().read_line(&mut s).ok();
s.trim().to_string()
}