結果
問題 |
No.688 E869120 and Constructing Array 2
|
ユーザー |
|
提出日時 | 2020-10-27 11:50:05 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 745 bytes |
コンパイル時間 | 854 ms |
コンパイル使用メモリ | 92,128 KB |
実行使用メモリ | 10,016 KB |
最終ジャッジ日時 | 2024-07-21 21:53:08 |
合計ジャッジ時間 | 3,875 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | AC * 7 WA * 2 TLE * 1 |
ソースコード
#include <iostream> #include <string> #include <algorithm> #include <vector> #include <iomanip> #include <cmath> #include <stdio.h> #include <queue> #include <deque> #include <cstdio> #include <set> #include <map> #include <bitset> #include <stack> #include <cctype> using namespace std; int main() { int k; cin >> k; for (int i = 2; i <= 30; i++) { int k1 = k / (i * (i - 1) / 2); int co = 0; while (k1 % 2 == 0) { k1 /= 2; co++; } if (k1 == 1) { cout << co + i << endl; for (int j = 0; j < i; j++) { cout << 1; if (j != co + i - 1) { cout << " "; } } for (int j = 0; j < co; j++) { cout << 0; if (j + i != co + i - 1) { cout << " "; } } cout << endl; return 0; } } }