結果
問題 | No.2118 遺伝的有限集合の数え上げ |
ユーザー |
|
提出日時 | 2022-11-23 18:12:50 |
言語 | Rust (1.83.0 + proconio) |
結果 |
WA
|
実行時間 | - |
コード長 | 395 bytes |
コンパイル時間 | 11,934 ms |
コンパイル使用メモリ | 400,124 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-24 23:10:28 |
合計ジャッジ時間 | 16,971 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 8 WA * 29 |
ソースコード
fn main() {let mut n = String::new();std::io::stdin().read_line(&mut n).ok();let n: usize = n.trim().parse().unwrap();let result = format!("{:b}", n).chars().rev().collect::<Vec<_>>();let result = (0..result.len()).filter(|&i| result[i] == '1').map(|i| format!("{}{}", "{".repeat(i+1), "}".repeat(i+1))).collect::<Vec<_>>().join(",");println!("{{{}}}", result);}