結果
問題 | No.2608 Divide into two |
ユーザー | Ekiben542 |
提出日時 | 2024-01-19 21:50:16 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 46 ms / 1,000 ms |
コード長 | 343 bytes |
コンパイル時間 | 147 ms |
コンパイル使用メモリ | 81,700 KB |
実行使用メモリ | 62,220 KB |
最終ジャッジ日時 | 2024-01-19 21:50:17 |
合計ジャッジ時間 | 784 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 34 ms
53,460 KB |
testcase_01 | AC | 39 ms
60,088 KB |
testcase_02 | AC | 46 ms
62,220 KB |
ソースコード
T = int(input()) for _ in range(T): N = int(input()) total = N*(N+1)//2 if total % 2 != 0: print(-1) else: half = total // 2 result = [0]*N for i in range(N, 0, -1): if half - i >= 0: result[i-1] = 1 half -= i print(''.join(map(str, result)))