結果

問題 No.2608 Divide into two
コンテスト
ユーザー hato336
提出日時 2024-01-19 21:27:49
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 200 ms / 1,000 ms
+ 796µs
コード長 665 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 237 ms
コンパイル使用メモリ 95,956 KB
実行使用メモリ 93,540 KB
最終ジャッジ日時 2026-09-05 11:57:45
合計ジャッジ時間 2,341 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 2
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
#sys.setrecursionlimit(10**9)
#sys.set_int_max_str_digits(0)
#input = sys.stdin.readline
t = int(input())
#alist = list(map(int,input().split()))
#alist = []
#s = input()
#n,m = map(int,input().split())
#for i in range(n):
#    alist.append(list(map(int,input().split())))
for _ in range(t):
    n = int(input())
    x = n*(n+1)//2
    if x % 2 == 1:
        print(-1)
        continue
    ans = ['0' for i in range(n)]
    temp = x // 2
    for i in reversed(range(n)):
        if temp >= i+1:
            temp -= i+1
            ans[i] = '1'
    print(''.join(ans))
0