結果

問題 No.688 E869120 and Constructing Array 2
ユーザー aguroshouaguroshou
提出日時 2018-05-18 23:48:50
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 613 bytes
コンパイル時間 1,834 ms
コンパイル使用メモリ 59,208 KB
実行使用メモリ 8,760 KB
最終ジャッジ日時 2023-09-21 20:08:08
合計ジャッジ時間 3,649 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include <algorithm>
#include<string>
using namespace std;

int main()
{
	long a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, ans = 0;
	int k;
	cin >> k;
	for ( a = 1; a <= 30; a++)
	{
		if (a>1)
		{
		b = a - 1;

		}
		else
		{
			b = 1;
		}
		if (k%(a*b)==0)
		{
			c = k / (a*b);
			if (!(c & (c - 1)))
			{
				

				
				break;
			}
		}
		
	}

	d = 0;
	while (c != 1)
	{
		d++;
		c /= 2;
	}
	if (a==1)
	{
		a++;
		d--;

	}
	cout <<d+a+1 <<endl;
	if (a == 2)
	{

	}
	for ( b = 0; b <= d; b++)
	{
	cout << "0 ";

	}

	for ( b = 0; b < a; b++)
	{
		cout << "1 ";

	}




	return 0;
}
0