結果

問題 No.2247 01 ZigZag
ユーザー flygonflygon
提出日時 2023-03-17 21:48:00
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 583 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 81,828 KB
実行使用メモリ 258,672 KB
最終ジャッジ日時 2023-10-18 14:21:41
合計ジャッジ時間 11,804 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 37 ms
53,460 KB
testcase_02 AC 38 ms
53,460 KB
testcase_03 AC 341 ms
87,816 KB
testcase_04 AC 37 ms
53,460 KB
testcase_05 AC 60 ms
75,460 KB
testcase_06 AC 146 ms
77,976 KB
testcase_07 AC 37 ms
53,460 KB
testcase_08 AC 276 ms
82,036 KB
testcase_09 AC 551 ms
97,344 KB
testcase_10 AC 38 ms
53,460 KB
testcase_11 AC 138 ms
77,796 KB
testcase_12 AC 139 ms
80,084 KB
testcase_13 AC 117 ms
77,032 KB
testcase_14 AC 37 ms
53,460 KB
testcase_15 AC 97 ms
77,688 KB
testcase_16 AC 256 ms
90,552 KB
testcase_17 AC 818 ms
128,212 KB
testcase_18 AC 37 ms
53,460 KB
testcase_19 AC 36 ms
53,460 KB
testcase_20 AC 37 ms
53,460 KB
testcase_21 AC 79 ms
75,800 KB
testcase_22 AC 328 ms
89,316 KB
testcase_23 AC 115 ms
76,928 KB
testcase_24 AC 39 ms
53,460 KB
testcase_25 AC 542 ms
110,984 KB
testcase_26 AC 311 ms
90,504 KB
testcase_27 AC 43 ms
68,048 KB
testcase_28 AC 340 ms
89,600 KB
testcase_29 AC 491 ms
98,972 KB
testcase_30 AC 505 ms
100,284 KB
testcase_31 AC 38 ms
53,460 KB
testcase_32 AC 327 ms
86,204 KB
testcase_33 AC 140 ms
77,656 KB
testcase_34 AC 89 ms
76,020 KB
testcase_35 AC 56 ms
75,324 KB
testcase_36 AC 198 ms
79,940 KB
testcase_37 AC 70 ms
75,604 KB
testcase_38 AC 67 ms
75,604 KB
testcase_39 AC 128 ms
77,488 KB
testcase_40 AC 37 ms
53,460 KB
testcase_41 WA -
testcase_42 WA -
testcase_43 AC 37 ms
53,460 KB
testcase_44 AC 37 ms
53,460 KB
testcase_45 AC 1,237 ms
258,668 KB
testcase_46 AC 1,232 ms
258,672 KB
testcase_47 WA -
testcase_48 WA -
testcase_49 AC 37 ms
53,460 KB
testcase_50 AC 37 ms
53,460 KB
testcase_51 AC 37 ms
53,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,k = map(int,input().split())
num = min(n,m)*2 - (n==m) 
if k == 0:
  print(-1)
  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