結果
問題 |
No.2881 Mod 2^N
|
ユーザー |
|
提出日時 | 2024-09-08 12:54:00 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 510 bytes |
コンパイル時間 | 2,024 ms |
コンパイル使用メモリ | 195,192 KB |
最終ジャッジ日時 | 2025-02-24 05:25:20 |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 26 WA * 4 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); long long N,X,Y; cin >> N >> X >> Y; if(Y%2 == 0){cout << "-1" << endl; return 0;} int zero = 0; vector<int> need; for(int i=N-1; i>=0; i--){ if((1LL<<i)&Y) need.push_back(zero),zero = 0; else zero++; } cout << need.size()+60 << endl; for(int i=0; i<60; i++) cout << 1 << " "; for(auto &n : need) cout << n+1 << " "; cout << "\n"; }