結果
問題 |
No.688 E869120 and Constructing Array 2
|
ユーザー |
![]() |
提出日時 | 2018-05-18 23:50:30 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 629 bytes |
コンパイル時間 | 444 ms |
コンパイル使用メモリ | 56,656 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-07-07 13:41:14 |
合計ジャッジ時間 | 3,481 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | AC * 7 WA * 2 TLE * 1 |
ソースコード
#include<iostream> #include <algorithm> #include<string> using namespace std; int main() { long a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, ans = 0; int k; cin >> k; for ( a = 1; a <= 30; a++) { if (a>1) { b = a - 1; } else { b = 1; } if (k%(a*b)==0) { c = k / (a*b); if (!(c & (c - 1))) { break; } } } d = 0; while (c != 1) { d++; c /= 2; } if (a==1) { a++; d--; } cout <<d+a+1 <<endl; if (a == 2) { } for ( b = 0; b <= d; b++) { cout << "0 "; } for ( b = 0; b < a; b++) { cout << "1 "; } cout << endl; return 0; }