結果

問題 No.688 E869120 and Constructing Array 2
ユーザー ahe100ahe100
提出日時 2018-06-05 23:39:54
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 884 bytes
コンパイル時間 528 ms
コンパイル使用メモリ 71,476 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-21 20:47:40
合計ジャッジ時間 3,030 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<stack>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<numeric>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)
typedef long long ll;
typedef pair<ll, ll> mp;
ll MOD = 1e9+7;
//LLONG_MIN

//WA

int main(void){
	bool can=false;
	int K;
	cin>>K;
	reg(b,0,30){
		reg(a,0,30-b){
			if(a==0 && b==0)continue;
			ll c=1;
			rep(i,a-1)c*=2;
			if(c*b*(b-1)==K){
				rep(j,a){
					printf("0");
					if(b!=0)printf(" ");
				}
				rep(j,b){
					printf("1");
					if(j!=b-1)printf(" ");
				}
				printf("\n");
				return 0;
			}
		}
	}
}
0