結果
| 問題 |
No.688 E869120 and Constructing Array 2
|
| コンテスト | |
| ユーザー |
focus
|
| 提出日時 | 2018-05-21 16:09:59 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 434 bytes |
| コンパイル時間 | 723 ms |
| コンパイル使用メモリ | 68,352 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-07 14:02:36 |
| 合計ジャッジ時間 | 2,833 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 3 WA * 7 |
ソースコード
#include<iostream>
#include<cmath>
using ll = long long ;
using namespace std;
int main(){
ll K,count=0,zero,one;
cin >> K;
if(K==0){
cout << 1<< endl << 0 << endl;
return 0;
}
while(K%2==0){
K/=2;
if(count==0) count++;
else count*=2;
}
if(count==0) zero = 0;
else zero = log2(count);
one = sqrt(K*2)+1;
cout << zero+one << endl;
while(zero--) cout << "0 ";
while(one--) cout << "1 ";
cout << endl;
return 0;
}
focus