結果

問題 No.2881 Mod 2^N
ユーザー ArcAki
提出日時 2024-09-10 11:42:49
言語 Rust
(1.83.0 + proconio)
結果
WA  
実行時間 -
コード長 488 bytes
コンパイル時間 12,353 ms
コンパイル使用メモリ 402,656 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-10 11:43:05
合計ジャッジ時間 15,826 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 20 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

use proconio::{input};

fn main() {
    input!{
        n: usize, x: i64, y: i64,
    }
    if x==y{
        println!("0");
        return;
    } else if y&1==0{
        println!("-1");
        return;
    }
    let mut query = vec![n.to_string()];
    let mut x = 1;
    for i in (1..n).rev(){
        if y & 1<<i == 0{
            x += 1;
        } else {
            query.push(x.to_string());
            x = 1;
        }
    }
    println!("{}\n{}", query.len(), query.join(" "));

}
0