結果

問題 No.2247 01 ZigZag
ユーザー ShirotsumeShirotsume
提出日時 2023-03-08 14:39:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,005 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 81,676 KB
実行使用メモリ 70,936 KB
最終ジャッジ日時 2023-10-18 10:26:33
合計ジャッジ時間 4,504 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
55,520 KB
testcase_01 AC 42 ms
55,520 KB
testcase_02 AC 48 ms
61,704 KB
testcase_03 AC 56 ms
66,412 KB
testcase_04 AC 49 ms
61,704 KB
testcase_05 AC 56 ms
66,396 KB
testcase_06 AC 56 ms
66,412 KB
testcase_07 AC 49 ms
61,704 KB
testcase_08 AC 59 ms
68,460 KB
testcase_09 AC 56 ms
66,384 KB
testcase_10 AC 48 ms
61,704 KB
testcase_11 AC 60 ms
66,416 KB
testcase_12 AC 57 ms
66,400 KB
testcase_13 AC 57 ms
66,416 KB
testcase_14 AC 50 ms
61,704 KB
testcase_15 AC 56 ms
66,396 KB
testcase_16 AC 62 ms
68,464 KB
testcase_17 AC 57 ms
66,412 KB
testcase_18 AC 48 ms
61,704 KB
testcase_19 AC 48 ms
61,704 KB
testcase_20 AC 47 ms
61,704 KB
testcase_21 AC 52 ms
64,332 KB
testcase_22 AC 62 ms
70,800 KB
testcase_23 AC 58 ms
66,412 KB
testcase_24 AC 48 ms
61,704 KB
testcase_25 AC 58 ms
68,460 KB
testcase_26 AC 59 ms
68,464 KB
testcase_27 AC 59 ms
68,452 KB
testcase_28 AC 60 ms
68,712 KB
testcase_29 AC 57 ms
66,412 KB
testcase_30 AC 62 ms
70,824 KB
testcase_31 AC 48 ms
61,704 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 50 ms
61,964 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 49 ms
61,704 KB
testcase_41 AC 51 ms
66,168 KB
testcase_42 WA -
testcase_43 AC 44 ms
55,520 KB
testcase_44 AC 43 ms
55,520 KB
testcase_45 AC 64 ms
70,936 KB
testcase_46 AC 61 ms
68,876 KB
testcase_47 WA -
testcase_48 AC 43 ms
55,520 KB
testcase_49 AC 44 ms
55,520 KB
testcase_50 AC 44 ms
55,520 KB
testcase_51 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import deque
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
INF = 2**63-1
mod = 998244353
n, m, k = mi()
assert 0 <= n <= 10 ** 5 and 0 <= m <= 10 ** 5 and 0 <= k <= 10 ** 5 and n + m >= 1
ans = '2'
#WA
#0101...型

s1 = deque(['0'])
cnt0 = 1
cnt1 = 0
for i in range(k):
    if  i % 2 == 0:
        cnt1 += 1
        s1.append('1')
    else:
        cnt0 += 1
        s1.append('0')
if cnt0 <= n and cnt1 <= m:
    while cnt0 < n:
        if s1 and s1[0] == '1':
            t = s1.popleft()
            s1.appendleft('0')
            s1.appendleft(t)
        else:
            s1.appendleft('0')
        cnt0 += 1
    while cnt1 < m:
        if s1 and s1[-1] == '0':
            t = s1.pop()
            s1.append('1')
            s1.append(t)
        else:
            s1.append('1')
        cnt1 += 1
    ans = min(ans, ''.join(s1))
if ans == '2':
    print(-1)
else:
    print(ans)



0