結果

問題 No.688 E869120 and Constructing Array 2
ユーザー hiro71687khiro71687k
提出日時 2023-04-04 06:51:30
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 596 bytes
コンパイル時間 4,619 ms
コンパイル使用メモリ 263,744 KB
実行使用メモリ 8,696 KB
最終ジャッジ日時 2023-10-26 00:59:52
合計ジャッジ時間 7,604 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
8,696 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 2 ms
4,348 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll=long long;
using ld=long double;
ld pie=3.141592653589793;
ll inf=144499999994;
ll mod=1000000007;
int main(){
    ll k;
    cin >> k;
    ll x=0;
    while (k%2==0)
    {
        k/=2;
        x+=1;
    }
    vector<ll>a={1,1};
    for (ll i = 0; i < x; i++)
    {
        a.push_back(0);
    }
    for (ll i = 0; i < k-2; i++)
    {
        a.push_back(1);
    }
    cout << a.size() << endl;
    for (ll i = 0; i < a.size(); i++)
    {
        cout << a[i] << ' ';
    }
    cout << endl;
}
0