結果

問題 No.2247 01 ZigZag
ユーザー first_vilfirst_vil
提出日時 2023-03-17 22:03:27
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 773 bytes
コンパイル時間 265 ms
コンパイル使用メモリ 81,696 KB
実行使用メモリ 88,980 KB
最終ジャッジ日時 2023-10-18 14:48:07
合計ジャッジ時間 9,461 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,160 KB
testcase_01 AC 38 ms
53,160 KB
testcase_02 AC 39 ms
53,160 KB
testcase_03 AC 384 ms
79,104 KB
testcase_04 AC 39 ms
53,160 KB
testcase_05 AC 43 ms
61,060 KB
testcase_06 AC 121 ms
74,748 KB
testcase_07 AC 39 ms
53,160 KB
testcase_08 AC 232 ms
76,580 KB
testcase_09 AC 350 ms
78,832 KB
testcase_10 AC 39 ms
53,160 KB
testcase_11 AC 119 ms
74,748 KB
testcase_12 AC 61 ms
74,316 KB
testcase_13 AC 84 ms
74,424 KB
testcase_14 AC 39 ms
53,160 KB
testcase_15 AC 52 ms
74,316 KB
testcase_16 AC 72 ms
74,384 KB
testcase_17 AC 640 ms
88,004 KB
testcase_18 AC 38 ms
53,160 KB
testcase_19 AC 38 ms
53,160 KB
testcase_20 AC 38 ms
53,160 KB
testcase_21 AC 63 ms
74,316 KB
testcase_22 AC 201 ms
76,244 KB
testcase_23 AC 115 ms
74,716 KB
testcase_24 AC 39 ms
53,160 KB
testcase_25 AC 248 ms
76,580 KB
testcase_26 AC 125 ms
74,780 KB
testcase_27 AC 42 ms
59,004 KB
testcase_28 AC 486 ms
80,948 KB
testcase_29 AC 558 ms
83,776 KB
testcase_30 AC 407 ms
80,052 KB
testcase_31 AC 39 ms
53,160 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 AC 38 ms
53,160 KB
testcase_44 AC 38 ms
53,160 KB
testcase_45 AC 609 ms
88,980 KB
testcase_46 AC 651 ms
88,980 KB
testcase_47 WA -
testcase_48 WA -
testcase_49 AC 38 ms
53,160 KB
testcase_50 AC 39 ms
53,160 KB
testcase_51 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,k=map(int,input().split())
d=min(n,m)*2
if n!=m:
    d-=1
if d<k:
    print(-1)
    exit()

def f(n,m,k):
    if n==0:
        return ""
    s="0"
    n-=1
    for i in range(k):
        if ~i&1:
            if m==0:
                return ""
            else:
                s+="1"
        else:
            if n==0:
                return ""
            else:
                s+="0"
    return s
    
s=f(n,m,k)
if not s:
    s=f(m,n,k)
    s=s.replace("1","x").replace("0","1").replace("x","0")
n-=s.count("0")
m-=s.count("1")
if n:
    for i in range(len(s)):
        if s[i]=="0":
            s=s[:i]+"0"*(n+1)+s[i+1:]
            break
if m:
    for i in range(len(s))[::-1]:
        if s[i]=="1":
            s=s[:i]+"1"*(m+1)+s[i+1:]
            break
print(s)
0