結果

問題 No.2247 01 ZigZag
ユーザー katonyonko
提出日時 2023-03-17 21:57:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 336 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 82,096 KB
実行使用メモリ 59,764 KB
最終ジャッジ日時 2024-09-18 10:50:25
合計ジャッジ時間 3,712 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 35 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,K=map(int,input().split())
def cnt(a,N,M):
  if N==0 or M==0: return 0
  elif a==0: return 1
  else: return 2*a-1+(1 if M>a else 0)+(1 if N>a else 0)
ans=-1
for i in range(min(N,M)+1):
  if cnt(i,N,M)==K: ans=i; break
if K==2 and N>1: print('0'*(N-1)+'1'*M+'0')
elif ans==-1: print(ans)
else: print('0'*(N-ans)+'10'*ans+'1'*(M-ans))
0