結果

問題 No.2247 01 ZigZag
ユーザー roarisroaris
提出日時 2023-03-17 21:45:04
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 677 bytes
コンパイル時間 155 ms
コンパイル使用メモリ 81,828 KB
実行使用メモリ 93,584 KB
最終ジャッジ日時 2023-10-18 20:09:05
合計ジャッジ時間 4,339 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
55,620 KB
testcase_01 AC 41 ms
55,620 KB
testcase_02 AC 52 ms
72,256 KB
testcase_03 AC 62 ms
81,468 KB
testcase_04 AC 47 ms
65,672 KB
testcase_05 AC 51 ms
67,932 KB
testcase_06 AC 55 ms
71,188 KB
testcase_07 AC 46 ms
63,756 KB
testcase_08 AC 61 ms
81,028 KB
testcase_09 AC 62 ms
81,772 KB
testcase_10 AC 51 ms
68,464 KB
testcase_11 AC 56 ms
73,716 KB
testcase_12 AC 52 ms
68,692 KB
testcase_13 AC 52 ms
69,504 KB
testcase_14 AC 46 ms
64,352 KB
testcase_15 AC 51 ms
68,176 KB
testcase_16 AC 56 ms
72,352 KB
testcase_17 AC 69 ms
91,292 KB
testcase_18 AC 51 ms
69,616 KB
testcase_19 AC 54 ms
73,920 KB
testcase_20 AC 49 ms
66,512 KB
testcase_21 AC 51 ms
67,352 KB
testcase_22 AC 62 ms
81,172 KB
testcase_23 AC 54 ms
70,776 KB
testcase_24 AC 52 ms
70,832 KB
testcase_25 AC 62 ms
80,080 KB
testcase_26 AC 57 ms
74,940 KB
testcase_27 AC 52 ms
67,880 KB
testcase_28 AC 66 ms
86,380 KB
testcase_29 AC 66 ms
85,524 KB
testcase_30 AC 66 ms
86,608 KB
testcase_31 AC 46 ms
63,256 KB
testcase_32 AC 65 ms
84,180 KB
testcase_33 AC 58 ms
75,648 KB
testcase_34 AC 54 ms
72,228 KB
testcase_35 AC 51 ms
67,340 KB
testcase_36 AC 61 ms
78,064 KB
testcase_37 AC 51 ms
67,484 KB
testcase_38 AC 51 ms
67,480 KB
testcase_39 AC 55 ms
71,668 KB
testcase_40 AC 54 ms
73,968 KB
testcase_41 AC 47 ms
65,116 KB
testcase_42 AC 47 ms
65,116 KB
testcase_43 AC 41 ms
55,620 KB
testcase_44 AC 41 ms
55,620 KB
testcase_45 AC 73 ms
93,584 KB
testcase_46 AC 72 ms
93,584 KB
testcase_47 AC 41 ms
55,620 KB
testcase_48 AC 40 ms
55,620 KB
testcase_49 AC 41 ms
55,620 KB
testcase_50 AC 41 ms
55,620 KB
testcase_51 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import *

def g(x):
    l = [x]
    
    for _ in range(K):
        l.append(l[-1]^1)
    
    return l

N, M, K = map(int, input().split())
l0, l1 = g(0), g(1)

if l0.count(0)<=N and l0.count(1)<=M:
    l = l0
elif l1.count(0)<=N and l1.count(1)<=M:
    l = l1
else:
    exit(print(-1))

idx1, idx2 = -1, -1

for i in range(len(l)):
    if l[i]==0:
        if idx1==-1:
            idx1 = i
    else:
        idx2 = i

ans = []

for i in range(len(l)):
    ans.append(l[i])
    
    if i==idx1:
        ans += [0]*(N-l.count(0))
    elif i==idx2:
        ans += [1]*(M-l.count(1))

ans = ''.join(map(str, ans))
print(ans)
0