結果

問題 No.2608 Divide into two
ユーザー yulightoyulighto
提出日時 2024-02-05 15:40:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 570 bytes
コンパイル時間 181 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 61,988 KB
最終ジャッジ日時 2024-02-05 15:40:57
合計ジャッジ時間 1,114 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

n = int(input())
for i in range(n):
    test = int(input())
    nums = sum([j + 1 for j in range(test)])
    ans = ['0' for j in range(test)]
    check = nums // 2
    if nums % 2 == 1:
        print(-1)
        continue
    else:
        for j in range(test + 1):
            if check == nums:
                print(''.join(ans))
                break
            elif check < nums:
                nums -= (test - j)
                ans[test - j - 1] = '1'
            else:
                nums += (test - j) + 1
                ans[test - j] = '0'
0