結果
| 問題 |
No.1376 Simple LPS Problem
|
| コンテスト | |
| ユーザー |
Kude
|
| 提出日時 | 2021-02-05 23:21:05 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 571 bytes |
| コンパイル時間 | 298 ms |
| コンパイル使用メモリ | 82,244 KB |
| 実行使用メモリ | 80,336 KB |
| 最終ジャッジ日時 | 2024-07-02 14:32:44 |
| 合計ジャッジ時間 | 4,903 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 59 WA * 1 |
ソースコード
n, k = map(int, input().split())
if k == 1:
if n > 1:
print(-1)
else:
print(0)
elif k == 2:
if n > 4:
print(-1)
else:
print('0011'[:n])
elif k == 3:
if n > 8:
print(-1)
else:
print('11101000'[:n])
else:
d = [k]
n -= k
i = 0
t = [1, 1, 2, 2]
while n:
v = min(n, t[i])
d.append(v)
n -= v
i = (i + 1) & 3
for i, c in enumerate(d):
if i % 2:
print('1' * c, end='')
else:
print('0' * c, end='')
print()
Kude