結果

問題 No.2247 01 ZigZag
ユーザー flygonflygon
提出日時 2023-03-17 21:49:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,253 ms / 2,000 ms
コード長 669 bytes
コンパイル時間 1,710 ms
コンパイル使用メモリ 81,476 KB
実行使用メモリ 258,532 KB
最終ジャッジ日時 2023-10-18 20:10:17
合計ジャッジ時間 12,105 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,356 KB
testcase_01 AC 37 ms
53,356 KB
testcase_02 AC 37 ms
53,356 KB
testcase_03 AC 330 ms
87,668 KB
testcase_04 AC 37 ms
53,356 KB
testcase_05 AC 59 ms
75,320 KB
testcase_06 AC 142 ms
77,832 KB
testcase_07 AC 37 ms
53,356 KB
testcase_08 AC 239 ms
81,896 KB
testcase_09 AC 440 ms
97,268 KB
testcase_10 AC 38 ms
53,356 KB
testcase_11 AC 136 ms
77,652 KB
testcase_12 AC 139 ms
79,948 KB
testcase_13 AC 114 ms
76,876 KB
testcase_14 AC 37 ms
53,356 KB
testcase_15 AC 95 ms
77,544 KB
testcase_16 AC 245 ms
90,408 KB
testcase_17 AC 779 ms
128,068 KB
testcase_18 AC 37 ms
53,356 KB
testcase_19 AC 36 ms
53,356 KB
testcase_20 AC 37 ms
53,356 KB
testcase_21 AC 77 ms
75,656 KB
testcase_22 AC 315 ms
89,176 KB
testcase_23 AC 116 ms
76,784 KB
testcase_24 AC 37 ms
53,356 KB
testcase_25 AC 541 ms
110,840 KB
testcase_26 AC 306 ms
90,360 KB
testcase_27 AC 44 ms
67,904 KB
testcase_28 AC 348 ms
89,456 KB
testcase_29 AC 503 ms
98,824 KB
testcase_30 AC 473 ms
100,140 KB
testcase_31 AC 38 ms
53,356 KB
testcase_32 AC 310 ms
86,060 KB
testcase_33 AC 139 ms
77,512 KB
testcase_34 AC 91 ms
75,876 KB
testcase_35 AC 56 ms
75,180 KB
testcase_36 AC 190 ms
79,800 KB
testcase_37 AC 69 ms
75,460 KB
testcase_38 AC 65 ms
75,460 KB
testcase_39 AC 130 ms
77,344 KB
testcase_40 AC 38 ms
53,356 KB
testcase_41 AC 37 ms
53,356 KB
testcase_42 AC 37 ms
53,356 KB
testcase_43 AC 37 ms
53,356 KB
testcase_44 AC 36 ms
53,356 KB
testcase_45 AC 1,241 ms
258,524 KB
testcase_46 AC 1,253 ms
258,532 KB
testcase_47 AC 37 ms
53,356 KB
testcase_48 AC 37 ms
53,356 KB
testcase_49 AC 38 ms
53,356 KB
testcase_50 AC 37 ms
53,356 KB
testcase_51 AC 37 ms
53,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,k = map(int,input().split())
num = min(n,m)*2 - (n==m) 
if k == 0:
  if n != 0 and m != 0:
    print(-1)
    exit()
  else:
    ans = "0"*n + "1"*m
    print(ans)
    exit()
if num < k:
  print(-1)
  exit()
elif num == k:
  if n >= m:
    l = [0,1] *( (k+1)//2 )
  else:
    l = [1,0] * ((k+1)//2)
  if k % 2 == 0:
    l.append(l[0])
else:
  l = [0,1] *( (k+1)//2 )
  if k % 2 == 0:
    l.append(l[0])

cnt = [1]*len(l)
n -= l.count(0)
m -= l.count(1)
for i in range(len(l)):
  if l[i] == 0:
    cnt[i] += n
    break
for i in range(len(l))[::-1]:
  if l[i] == 1:
    cnt[i] += m
    break
  
ans = ""
for i in range(len(l)):
  ans += str(l[i]) * cnt[i]

print(ans)
0