結果
| 問題 |
No.688 E869120 and Constructing Array 2
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-11-09 09:12:22 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 1,533 bytes |
| コンパイル時間 | 1,573 ms |
| コンパイル使用メモリ | 170,088 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-21 05:04:48 |
| 合計ジャッジ時間 | 2,329 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
ソースコード
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define inf (1ll<<60)
#define Yes(f) cout<<(f?"Yes":"No")<<endl
#define yes(f) cout<<(f?"yes":"no")<<endl
#define YES(f) cout<<(f?"YES":"NO")<<endl
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v), greater<int>())
#define VI(a,n) vi a(n); rep(i,n)cin>>a[i];
using namespace std;
const int mod=1e9+7;
void run();
void init() {
ios::sync_with_stdio(false);
cin.tie(0);
cout<<fixed<<setprecision(12);
}
signed main(){
init();
run();
return 0;
}
void run(){
int k;
cin>>k;
if(k==0){
cout<<1<<endl<<1<<endl;
return;
}
rep(one,31){
int o=one*(one-1)/2;
rep(zero,31){
if(one+zero>30)break;
int z=1;
rep(i,zero)z*=2;
if(o*z==k){
cout<<one+zero<<endl;
rep(i,one){
cout<<1<<" ";
}
rep(i,zero){
cout<<0<<" ";
}
cout<<endl;
return;
}
}
}
}