結果

問題 No.2247 01 ZigZag
ユーザー shakayamishakayami
提出日時 2023-03-17 21:51:30
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 933 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 81,740 KB
実行使用メモリ 77,924 KB
最終ジャッジ日時 2023-10-18 14:25:58
合計ジャッジ時間 4,256 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,460 KB
testcase_01 AC 37 ms
53,464 KB
testcase_02 AC 42 ms
60,124 KB
testcase_03 AC 63 ms
77,400 KB
testcase_04 AC 41 ms
59,800 KB
testcase_05 AC 52 ms
64,436 KB
testcase_06 AC 56 ms
69,204 KB
testcase_07 AC 46 ms
62,168 KB
testcase_08 AC 59 ms
73,904 KB
testcase_09 AC 66 ms
77,400 KB
testcase_10 AC 42 ms
59,976 KB
testcase_11 AC 56 ms
69,204 KB
testcase_12 AC 55 ms
66,624 KB
testcase_13 AC 55 ms
68,988 KB
testcase_14 AC 46 ms
62,256 KB
testcase_15 AC 55 ms
64,436 KB
testcase_16 AC 54 ms
66,920 KB
testcase_17 AC 67 ms
77,648 KB
testcase_18 AC 41 ms
60,036 KB
testcase_19 AC 42 ms
60,224 KB
testcase_20 AC 42 ms
59,864 KB
testcase_21 AC 54 ms
66,624 KB
testcase_22 AC 57 ms
73,704 KB
testcase_23 AC 56 ms
69,200 KB
testcase_24 AC 42 ms
60,064 KB
testcase_25 AC 58 ms
73,904 KB
testcase_26 AC 56 ms
69,352 KB
testcase_27 AC 49 ms
62,340 KB
testcase_28 AC 64 ms
77,348 KB
testcase_29 AC 66 ms
77,428 KB
testcase_30 AC 66 ms
77,436 KB
testcase_31 AC 46 ms
62,120 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 55 ms
66,924 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 47 ms
61,204 KB
testcase_41 AC 38 ms
53,464 KB
testcase_42 AC 37 ms
53,464 KB
testcase_43 AC 37 ms
53,464 KB
testcase_44 AC 37 ms
53,464 KB
testcase_45 AC 66 ms
77,636 KB
testcase_46 AC 66 ms
77,632 KB
testcase_47 AC 37 ms
53,464 KB
testcase_48 AC 37 ms
53,464 KB
testcase_49 AC 37 ms
53,464 KB
testcase_50 AC 37 ms
53,464 KB
testcase_51 AC 37 ms
53,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

'''
K+1個のブロック
a_0,...,a_K
a_i>=1

a_{2i}個の0
a_{2i+1}個の1
辞書順最小にするためには
a_0を極力大きく
a_2,a_4,...,a_{2i}を1
'''
N,M,K=map(int,input().split())

if K==0:
    if N*M>0:
        print(-1)
    else:
        print("0"*N+"1"*M)
    exit()
Ncash=N
Mcash=M
A=[0 for i in range(K+1)]
for i in range(1,K+1,2):
    A[i]+=1
    M-=1
if M<0:
    print(-1)
    exit()
A[K-(K+1)%2]+=M
for i in range(0,K+1,2):
    A[i]+=1
    N-=1
if N<0:
    N=Ncash
    M=Mcash
    B=[0 for i in range(K+1)]
    for i in range(0,K+1,2):
        B[i]+=1
        M-=1
    if M<0:
        print(-1)
        exit()
    B[K-(K+1)%2]+=M
    for i in range(1,K+1,2):
        B[i]+=1
        N-=1
    if N<0:
        print(-1)
        exit()
    B[1]+=N
    for i in range(K+1):
        print(str((i+1)%2)*A[i],end="")
    print()
    exit()
else:
    A[0]+=N
for i in range(K+1):
    print(str(i%2)*A[i],end="")
print()
0