結果
| 問題 |
No.688 E869120 and Constructing Array 2
|
| コンテスト | |
| ユーザー |
ngtkana
|
| 提出日時 | 2020-03-15 14:18:28 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 598 bytes |
| コンパイル時間 | 1,905 ms |
| コンパイル使用メモリ | 193,860 KB |
| 最終ジャッジ日時 | 2025-01-09 06:57:00 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 TLE * 1 |
ソースコード
#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;
}
}
}
ngtkana