結果
問題 | No.2608 Divide into two |
ユーザー | Kude |
提出日時 | 2024-01-19 21:26:22 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 45 ms / 1,000 ms |
コード長 | 309 bytes |
コンパイル時間 | 152 ms |
コンパイル使用メモリ | 81,700 KB |
実行使用メモリ | 59,644 KB |
最終ジャッジ日時 | 2024-01-19 21:26:22 |
合計ジャッジ時間 | 760 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 36 ms
53,460 KB |
testcase_01 | AC | 45 ms
59,600 KB |
testcase_02 | AC | 45 ms
59,644 KB |
ソースコード
for _ in range(int(input())): n = int(input()) sm = n * (n + 1) // 2 if sm % 2: print(-1) continue tgt = sm // 2 ans = ['0'] * n for x in range(n, 0, -1): if x <= tgt: ans[x - 1] = '1' tgt -= x assert tgt == 0 print(''.join(ans))