結果
問題 | No.2247 01 ZigZag |
ユーザー |
![]() |
提出日時 | 2023-03-17 22:06:34 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 58 ms / 2,000 ms |
コード長 | 832 bytes |
コンパイル時間 | 144 ms |
コンパイル使用メモリ | 82,164 KB |
実行使用メモリ | 80,384 KB |
最終ジャッジ日時 | 2024-09-18 16:09:47 |
合計ジャッジ時間 | 3,553 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 50 |
ソースコード
import sys, mathinput = lambda: sys.stdin.readline()[:-1]def MI(): return map(int, input().split())inf = 10**18n,m,k = MI()if k==0:if n==0:print('1'*m)elif m==0:print('0'*n)else:print(-1)exit()cnt = [0,0]ans = []for i in range(k+1):cnt[i%2] += 1ans.append(str(i%2))# print(ans)# print(cnt)if cnt[0] > n or cnt[1] > m:passelse:ans[0] += '0'*(n-cnt[0])if (k+1)%2==0:ans[-1] += '1'*(m-cnt[1])else:ans[-2] += '1'*(m-cnt[1])print("".join(ans))exit()cnt = [0,0]ans = []for i in range(1, k+2):cnt[i%2] += 1ans.append(str(i%2))if cnt[0] > n or cnt[1] > m:print(-1); exit()ans[1] += '0'*(n-cnt[0])if (k+1)%2==0:ans[-2] += '1'*(m-cnt[1])else:ans[-1] += '1'*(m-cnt[1])print("".join(ans))