結果

問題 No.2608 Divide into two
ユーザー Meso Meso
提出日時 2024-08-11 12:57:44
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 1,000 ms
コード長 298 bytes
コンパイル時間 393 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-08-11 12:57:46
合計ジャッジ時間 1,414 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

t = int(input())

for i in range(t):
    n = int(input())
    S = n * (n+1) // 2

    if S % 2 != 0:
        print(-1)
        continue

    ans = [0] * n
    x = S // 2

    for i in range(n, 0, -1):
        if x >= i:
            ans[i-1] = 1
            x -= i
    print("".join(map(str, ans)))
0