結果

問題 No.2247 01 ZigZag
ユーザー Alex WiceAlex Wice
提出日時 2023-03-17 22:35:47
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 530 bytes
コンパイル時間 1,172 ms
コンパイル使用メモリ 81,684 KB
実行使用メモリ 54,112 KB
最終ジャッジ日時 2023-10-18 15:31:56
合計ジャッジ時間 4,706 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,388 KB
testcase_01 AC 39 ms
53,388 KB
testcase_02 AC 39 ms
53,388 KB
testcase_03 AC 38 ms
53,388 KB
testcase_04 AC 38 ms
53,388 KB
testcase_05 AC 38 ms
53,388 KB
testcase_06 AC 38 ms
53,388 KB
testcase_07 AC 38 ms
53,388 KB
testcase_08 AC 39 ms
53,388 KB
testcase_09 AC 39 ms
53,388 KB
testcase_10 WA -
testcase_11 AC 39 ms
53,388 KB
testcase_12 AC 39 ms
53,388 KB
testcase_13 AC 39 ms
53,388 KB
testcase_14 AC 38 ms
53,388 KB
testcase_15 AC 38 ms
53,388 KB
testcase_16 AC 39 ms
53,388 KB
testcase_17 AC 39 ms
53,388 KB
testcase_18 AC 38 ms
53,388 KB
testcase_19 AC 39 ms
53,388 KB
testcase_20 AC 39 ms
53,388 KB
testcase_21 AC 39 ms
53,388 KB
testcase_22 AC 39 ms
53,800 KB
testcase_23 AC 39 ms
53,388 KB
testcase_24 AC 38 ms
53,388 KB
testcase_25 AC 39 ms
53,388 KB
testcase_26 AC 39 ms
53,388 KB
testcase_27 AC 39 ms
53,388 KB
testcase_28 AC 39 ms
53,784 KB
testcase_29 AC 38 ms
53,388 KB
testcase_30 AC 39 ms
53,836 KB
testcase_31 AC 38 ms
53,388 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 39 ms
53,388 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 39 ms
53,388 KB
testcase_41 AC 38 ms
53,388 KB
testcase_42 AC 38 ms
53,388 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 AC 39 ms
54,112 KB
testcase_46 AC 39 ms
53,916 KB
testcase_47 AC 38 ms
53,388 KB
testcase_48 AC 38 ms
53,388 KB
testcase_49 AC 38 ms
53,388 KB
testcase_50 AC 39 ms
53,388 KB
testcase_51 AC 38 ms
53,388 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
    ans = solve(n0, n1, diffs - 1)
    if ans == -1: return -1
    return ans + '0'

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