結果
問題 |
No.2608 Divide into two
|
ユーザー |
|
提出日時 | 2024-05-13 20:04:19 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 45 ms / 1,000 ms |
コード長 | 267 bytes |
コンパイル時間 | 155 ms |
コンパイル使用メモリ | 82,152 KB |
実行使用メモリ | 60,208 KB |
最終ジャッジ日時 | 2024-12-20 09:36:22 |
合計ジャッジ時間 | 981 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 2 |
ソースコード
for _ in range(T := int(input())): N = int(input()) S = N*(N+1)//2 if S%2 == 1: print(-1) continue S //= 2 ans = ['0']*N for i in range(1, N+1): S -= i ans[i-1] = '1' if S <= 0: break if S < 0: ans[-S-1] = '0' print("".join(ans))