結果

問題 No.2247 01 ZigZag
ユーザー 👑 timitimi
提出日時 2023-03-17 21:54:27
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 984 bytes
コンパイル時間 425 ms
コンパイル使用メモリ 81,732 KB
実行使用メモリ 111,052 KB
最終ジャッジ日時 2023-10-18 14:30:56
合計ジャッジ時間 5,377 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,552 KB
testcase_01 AC 38 ms
53,552 KB
testcase_02 AC 88 ms
97,724 KB
testcase_03 AC 93 ms
93,812 KB
testcase_04 AC 51 ms
74,272 KB
testcase_05 AC 65 ms
75,596 KB
testcase_06 AC 80 ms
86,348 KB
testcase_07 AC 50 ms
70,296 KB
testcase_08 AC 95 ms
94,844 KB
testcase_09 AC 93 ms
94,232 KB
testcase_10 AC 55 ms
79,080 KB
testcase_11 AC 80 ms
87,716 KB
testcase_12 AC 67 ms
81,740 KB
testcase_13 AC 64 ms
78,216 KB
testcase_14 AC 51 ms
70,868 KB
testcase_15 AC 68 ms
79,076 KB
testcase_16 AC 77 ms
89,404 KB
testcase_17 AC 111 ms
103,604 KB
testcase_18 AC 58 ms
81,180 KB
testcase_19 AC 85 ms
97,460 KB
testcase_20 AC 53 ms
75,088 KB
testcase_21 AC 59 ms
74,240 KB
testcase_22 AC 100 ms
96,956 KB
testcase_23 AC 77 ms
85,760 KB
testcase_24 AC 60 ms
83,008 KB
testcase_25 AC 97 ms
94,844 KB
testcase_26 AC 87 ms
92,996 KB
testcase_27 AC 67 ms
78,636 KB
testcase_28 AC 107 ms
101,948 KB
testcase_29 AC 99 ms
96,568 KB
testcase_30 AC 105 ms
99,536 KB
testcase_31 AC 49 ms
67,744 KB
testcase_32 AC 92 ms
98,520 KB
testcase_33 AC 64 ms
81,276 KB
testcase_34 AC 61 ms
77,512 KB
testcase_35 AC 56 ms
69,692 KB
testcase_36 AC 65 ms
83,568 KB
testcase_37 AC 52 ms
69,368 KB
testcase_38 AC 52 ms
69,368 KB
testcase_39 AC 59 ms
77,636 KB
testcase_40 AC 84 ms
97,460 KB
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 AC 122 ms
111,048 KB
testcase_46 AC 120 ms
111,052 KB
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 WA -
testcase_51 AC 37 ms
53,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,K=map(int, input().split())
if M==0:
  if K==0:
    print('1'*N)
  else:
    print(-1)

if N==0:
  if K==0:
    print('1'*M)
  else:
    print(-1)
if K==0:
  print(-1)
  exit()
  
a,b=N,M  
A=[['0',1]]
C=[]
a-=1
for i in range(K):
  if i%2==0:
    A.append(['1',1])
    b-=1
  else:
    A.append(['0',1])
    a-=1

if a>=0 and b>=0:
  for i in range(2):
    if A[i][0]=='0':
      A[i][1]+=a 
  for i in range(2):
    if A[-1-i][0]=='1':
      A[-1-i][1]+=b 
  B=[]
  for a,b in A:
    for i in range(b):
      B.append(a)
  B=''.join(B)
  C.append(B)
  
a,b=N,M 
A=[['1',1]]
b-=1
for i in range(K):
  if i%2==0:
    A.append(['0',1])
    a-=1
  else:
    A.append(['1',1])
    b-=1

if a>=0 and b>=0:
  for i in range(2):
    if A[i][0]=='0':
      A[i][1]+=a 
  for i in range(2):
    if A[-1-i][0]=='1':
      A[-1-i][1]+=b 
  B=[]
  for a,b in A:
    for i in range(b):
      B.append(a)
  B=''.join(B)
  C.append(B)
if len(C)==0:
  print(-1)
else:
  C=sorted(C)
  print(C[0])
0