結果

問題 No.688 E869120 and Constructing Array 2
ユーザー fura
提出日時 2020-05-05 06:15:12
言語 C++17
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 1,000 ms
+ 798µs
コード長 344 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,258 ms
コンパイル使用メモリ 214,824 KB
実行使用メモリ 9,904 KB
最終ジャッジ日時 2026-10-31 09:35:49
合計ジャッジ時間 2,640 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;
using lint=long long;

int main(){
	lint k; scanf("%lld",&k);

	for(lint n=1;n<=30;n++) for(lint m=0;m<=30;m++) if(n+m<=30 && n*(n-1)/2*(1<<m)==k) {
		printf("%lld\n",n+m);
		rep(i,n+m) printf("%d%c",i<n?1:0,i<n+m-1?' ':'\n');
		return 0;
	}

	return 0;
}
0