結果

問題 No.2608 Divide into two
ユーザー hiro1729hiro1729
提出日時 2024-01-19 21:24:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 1,000 ms
コード長 525 bytes
コンパイル時間 183 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 59,840 KB
最終ジャッジ日時 2024-01-19 21:24:59
合計ジャッジ時間 763 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
53,460 KB
testcase_01 AC 36 ms
53,460 KB
testcase_02 AC 41 ms
59,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input
R = range
P = print
def I(): return int(S())
def M(): return map(int, S().split())
def L(): return list(M())
def O(): return list(map(int, open(0).read().split()))
def yn(b): print("Yes" if b else "No")
biga = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
smaa = "abcdefghijklmnopqrstuvwxyz"

for _ in R(I()):
	n = I()
	if n*(n+1)//2%2:
		print(-1)
		continue
	k = n*(n+1)//4
	x = n
	a = []
	while k >= x:
		k -= x
		a.append(x)
		x -= 1
	if k > 0:
		a.append(k)
	ans = ['0'] * n
	for i in a:
		ans[i - 1] = '1'
	print(''.join(ans))
0