結果
問題 |
No.2247 01 ZigZag
|
ユーザー |
|
提出日時 | 2023-03-08 14:13:32 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,020 bytes |
コンパイル時間 | 387 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 72,984 KB |
最終ジャッジ日時 | 2024-09-18 06:52:53 |
合計ジャッジ時間 | 4,363 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 21 WA * 29 |
ソースコード
import sys from collections import deque input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) INF = 2**63-1 mod = 998244353 n, m, k = mi() ans = '2' #0101...型 s1 = deque(['0']) cnt0 = 1 cnt1 = 0 for i in range(k): if i % 2 == 0: cnt1 += 1 s1.append('1') else: cnt0 += 1 s1.append('0') if cnt0 <= n and cnt1 <= m: while cnt0 < n: s1.appendleft('0') cnt0 += 1 while cnt1 < m: s1.appendleft('1') cnt1 += 1 ans = min(ans, ''.join(s1)) #1010...型 s1 = deque(['1']) cnt0 = 0 cnt1 = 1 for i in range(k): if i % 2: cnt1 += 1 s1.append('1') else: cnt0 += 1 s1.append('0') if cnt0 <= n and cnt1 <= m: while cnt0 < n: s1.appendleft('0') cnt0 += 1 while cnt1 < m: s1.appendleft('1') cnt1 += 1 ans = min(ans, ''.join(s1)) if ans == '2': print(-1) else: print(ans)