結果
| 問題 |
No.2608 Divide into two
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-01-21 18:45:03 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 49 ms / 1,000 ms |
| コード長 | 489 bytes |
| コンパイル時間 | 410 ms |
| コンパイル使用メモリ | 82,028 KB |
| 実行使用メモリ | 60,544 KB |
| 最終ジャッジ日時 | 2024-09-28 06:15:07 |
| 合計ジャッジ時間 | 1,060 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 2 |
ソースコード
for _ in range(int(input())):
n = int(input())
sum_ = n * (n + 1) // 2
if sum_ % 2 == 1:
print(-1)
else:
curr = sum_ // 2
ANS = [0 for _ in range(n)]
idx = n - 1
while curr > 0:
curr -= idx + 1
if curr <= 0:
curr += idx + 1
ANS[curr - 1] = 1
curr = 0
else:
ANS[idx] = 1
idx -= 1
print(''.join(map(str, ANS)))