結果

問題 No.2247 01 ZigZag
ユーザー FromBooskaFromBooska
提出日時 2023-08-09 13:53:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 861 bytes
コンパイル時間 353 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 54,168 KB
最終ジャッジ日時 2024-04-27 08:49:43
合計ジャッジ時間 4,117 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,664 KB
testcase_01 AC 38 ms
52,280 KB
testcase_02 AC 39 ms
53,240 KB
testcase_03 AC 40 ms
53,496 KB
testcase_04 AC 39 ms
52,200 KB
testcase_05 AC 37 ms
53,364 KB
testcase_06 AC 38 ms
52,332 KB
testcase_07 AC 38 ms
53,152 KB
testcase_08 AC 39 ms
53,508 KB
testcase_09 AC 39 ms
52,688 KB
testcase_10 AC 39 ms
52,000 KB
testcase_11 AC 38 ms
52,708 KB
testcase_12 AC 38 ms
52,616 KB
testcase_13 AC 38 ms
52,144 KB
testcase_14 AC 38 ms
53,184 KB
testcase_15 AC 42 ms
53,324 KB
testcase_16 AC 39 ms
52,396 KB
testcase_17 AC 39 ms
53,008 KB
testcase_18 AC 38 ms
52,404 KB
testcase_19 AC 39 ms
54,168 KB
testcase_20 AC 39 ms
53,084 KB
testcase_21 AC 39 ms
52,344 KB
testcase_22 AC 39 ms
53,092 KB
testcase_23 AC 38 ms
52,440 KB
testcase_24 AC 38 ms
52,912 KB
testcase_25 AC 38 ms
53,804 KB
testcase_26 AC 39 ms
53,804 KB
testcase_27 AC 38 ms
53,216 KB
testcase_28 AC 40 ms
52,972 KB
testcase_29 AC 39 ms
52,892 KB
testcase_30 AC 39 ms
54,060 KB
testcase_31 AC 39 ms
53,804 KB
testcase_32 AC 37 ms
52,684 KB
testcase_33 AC 40 ms
53,072 KB
testcase_34 AC 38 ms
53,440 KB
testcase_35 AC 38 ms
52,888 KB
testcase_36 AC 38 ms
52,872 KB
testcase_37 AC 39 ms
52,084 KB
testcase_38 AC 38 ms
52,776 KB
testcase_39 AC 38 ms
52,960 KB
testcase_40 AC 39 ms
53,372 KB
testcase_41 AC 39 ms
52,692 KB
testcase_42 AC 40 ms
53,016 KB
testcase_43 AC 38 ms
52,976 KB
testcase_44 AC 39 ms
52,448 KB
testcase_45 AC 39 ms
53,724 KB
testcase_46 AC 39 ms
53,648 KB
testcase_47 AC 38 ms
52,032 KB
testcase_48 AC 38 ms
52,272 KB
testcase_49 AC 38 ms
52,500 KB
testcase_50 AC 39 ms
52,332 KB
testcase_51 AC 38 ms
53,436 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 考え方わかっても混乱して自力実装難しい
# 0の塊の個数をn, 1の塊の個数をmとする

N, M, K = map(int, input().split())
if K == 0:
    if N == 0:
        m = M
        ans = '1'*m
    elif M == 0:
        n = N
        ans = '0'*n
    else:
        ans = -1
else:
    if N >= (K+2)//2 and M >= (K+1)//2:
        n = (K+2)//2
        m = (K+1)//2
        if n > m: #つまり01010パターン
            ans = '0'*(N-m-1) + '01'*m + '1'*(M-m) + '0'*1
        else: #つまり0101パターン
            ans = '0'*(N-m) + '01'*m + '1'*(M-m)
    elif N >= (K+1)//2 and M >= (K+2)//2:
        n = (K+1)//2
        m = (K+2)//2
        if m > n: #つまり10101パターン
            ans = '10'*n + '1'*(M-n)
        else: #つまり01010パターン
            ans = '01'*n + '1'*(M-n) + '0'
    else:
        ans = -1
print(ans)
0