結果

問題 No.2247 01 ZigZag
ユーザー Alex WiceAlex Wice
提出日時 2023-03-17 22:34:55
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 488 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 81,680 KB
実行使用メモリ 65,868 KB
最終ジャッジ日時 2023-10-18 15:29:59
合計ジャッジ時間 3,639 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,444 KB
testcase_01 AC 37 ms
53,444 KB
testcase_02 AC 37 ms
53,444 KB
testcase_03 AC 37 ms
53,444 KB
testcase_04 AC 37 ms
53,444 KB
testcase_05 AC 37 ms
53,444 KB
testcase_06 AC 37 ms
53,444 KB
testcase_07 RE -
testcase_08 AC 37 ms
53,444 KB
testcase_09 AC 37 ms
53,444 KB
testcase_10 WA -
testcase_11 AC 37 ms
53,444 KB
testcase_12 AC 37 ms
53,444 KB
testcase_13 AC 37 ms
53,444 KB
testcase_14 AC 38 ms
53,444 KB
testcase_15 AC 37 ms
53,444 KB
testcase_16 AC 38 ms
53,444 KB
testcase_17 AC 37 ms
53,444 KB
testcase_18 AC 36 ms
53,444 KB
testcase_19 AC 37 ms
53,444 KB
testcase_20 AC 37 ms
53,444 KB
testcase_21 AC 37 ms
53,444 KB
testcase_22 AC 38 ms
53,856 KB
testcase_23 AC 38 ms
53,444 KB
testcase_24 AC 37 ms
53,444 KB
testcase_25 AC 38 ms
53,444 KB
testcase_26 AC 37 ms
53,444 KB
testcase_27 AC 37 ms
53,444 KB
testcase_28 AC 38 ms
53,840 KB
testcase_29 AC 38 ms
53,444 KB
testcase_30 AC 38 ms
53,892 KB
testcase_31 RE -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 36 ms
53,444 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 38 ms
53,444 KB
testcase_41 AC 38 ms
53,444 KB
testcase_42 AC 38 ms
53,444 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 AC 38 ms
54,168 KB
testcase_46 AC 38 ms
53,972 KB
testcase_47 AC 37 ms
53,444 KB
testcase_48 AC 38 ms
53,444 KB
testcase_49 AC 38 ms
53,444 KB
testcase_50 AC 37 ms
53,444 KB
testcase_51 AC 37 ms
53,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve(n0, n1, diffs):
    if diffs == 0:
        if n0 == 0:
            return '1' * n1
        if n1 == 0:
            return '0' * n0
        return -1
    if diffs >= n0 + n1:
        return -1
    if diffs & 1:
        splits = diffs // 2
        if splits > n0:
            return -1
        return '0' * (n0 - splits) + '10' * splits + '1' * (n1 - splits)
    n0 -= 1
    if n0 < 0: return -1
    return solve(n0, n1, diffs - 1) + '0'

print(solve(*map(int, input().split())))
0