結果

問題 No.2247 01 ZigZag
ユーザー Kude
提出日時 2023-03-17 21:46:52
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 384 bytes
コンパイル時間 234 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 53,120 KB
最終ジャッジ日時 2024-09-18 16:06:51
合計ジャッジ時間 3,764 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 49 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, k = map(int, input().split())
if n * m == 0:
    if k:
        print(-1)
    else:
        print('0' * n if n else '1' * m)
    exit(0)
k += 1
c0 = (k + 1) // 2
c1 = k // 2
if c0 <= n and c1 <= m:
    ans = '0' * (n - c0) + '01' * c1 + '1' * (m - c1) + '0' * (k % 2)
elif c0 <= m and c1 <= n:
    assert n == c1
    ans = '10' * c1 + '1' * (m - c1)
else:
    ans = -1
print(ans)
0