結果
| 問題 | No.2247 01 ZigZag |
| コンテスト | |
| ユーザー |
sotanishy
|
| 提出日時 | 2023-03-17 21:43:34 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 54 ms / 2,000 ms |
| コード長 | 746 bytes |
| コンパイル時間 | 275 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 73,984 KB |
| 最終ジャッジ日時 | 2024-09-18 16:06:25 |
| 合計ジャッジ時間 | 3,884 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 50 |
ソースコード
N, M, K = map(int, input().split())
a = 1+K//2
b = (K+1)//2
if K == 0:
if N > 0 and M > 0:
print(-1)
elif N > 0:
print("".join(map(str, [0] * N)))
else:
print("".join(map(str, [1] * M)))
exit()
if N >= a and M >= b:
if K % 2 == 0:
# 0010110
ans = [0]*(N-b) + [1, 0]*(b-1) + [1]*(M-(b-1)) + [0]
else:
# 001011
ans = [0]*(N-b+1) + [1, 0]*(b-1) + [1]*(M-(b-1))
print("".join(map(str, ans)))
elif M >= a and N >= b:
if K % 2 == 0:
# 1001011
ans = [1] + [0]*(N-(b-1)) + [1, 0] * (b-1) + [1]*(M-b)
else:
# 10010110
ans = [1] + [0]*(N-b) + [1, 0] * (b-1) + [1]*(M-b) + [0]
print("".join(map(str, ans)))
else:
print(-1)
sotanishy