結果

問題 No.688 E869120 and Constructing Array 2
ユーザー ngtkanangtkana
提出日時 2020-03-15 14:18:28
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 598 bytes
コンパイル時間 1,943 ms
コンパイル使用メモリ 199,912 KB
実行使用メモリ 8,752 KB
最終ジャッジ日時 2023-08-16 11:13:52
合計ジャッジ時間 5,217 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h>
using lint=long long;
int main(){
    std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
    std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
    lint k;std::cin>>k;
    for(lint i=2,j=1;;j+=i++){
        if(k%j==0&&__builtin_popcountll(k/j)==1){
            std::string s=std::string(__builtin_ctzll(k/j),'0')+std::string(i,'1');
            std::cout<<s.size()<<'\n';
            for(lint i=0;i<(lint)s.length();i++){
                std::cout<<(i?" ":"")<<s.at(i);
            }
            std::cout<<'\n';
            return 0;
        }
    }
}
0