結果
問題 | No.2608 Divide into two |
ユーザー |
![]() |
提出日時 | 2024-01-19 21:41:45 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 50 ms / 1,000 ms |
コード長 | 651 bytes |
コンパイル時間 | 139 ms |
コンパイル使用メモリ | 82,212 KB |
実行使用メモリ | 61,312 KB |
最終ジャッジ日時 | 2024-09-28 04:13:24 |
合計ジャッジ時間 | 768 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 2 |
ソースコード
t = int(input())for _ in range(t):n = int(input())if n % 4 == 0:print('0110' * (n // 4))elif n % 4 == 3:ans = ['0', '1', '1', '0'] * ((n + 1) // 4)ans.pop()if ans[(n + 1) // 2 - 1] == '0':ans[-3] = '1'ans[-2] = '0'ans[-1] = '0'ans[(n + 1) // 2 - 1] = '1'else:ans[(n + 1) // 2 - 1] = '0'# a, b = 0, 0# for i in range(n):# if ans[i] == '0':# a += i + 1# else:# b += i + 1# print(a, b)print(*ans, sep='')else:print(-1)