結果
問題 |
No.688 E869120 and Constructing Array 2
|
ユーザー |
|
提出日時 | 2022-10-04 21:52:09 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 604 bytes |
コンパイル時間 | 1,810 ms |
コンパイル使用メモリ | 193,556 KB |
最終ジャッジ日時 | 2025-02-07 21:25:18 |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 WA * 1 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); int K; cin >> K; // c1 + c0 = N // c1 * (c1 - 1) / 2 * 2^{c0} = K for(int c1 = 0; c1 <= 30; c1++) { for(int c0 = 0; c0 <= 30; c0++) { if(1LL * c1 * (c1 - 1) / 2 * (1LL << c0) == K) { cout << c1 + c0 << endl; rep(_,c1) cout << "1 "; rep(_,c0) cout << "0 "; cout << endl; return 0; } } } }