結果
問題 | No.2247 01 ZigZag |
ユーザー |
|
提出日時 | 2023-03-17 21:46:27 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 551 bytes |
コンパイル時間 | 139 ms |
コンパイル使用メモリ | 82,100 KB |
実行使用メモリ | 259,036 KB |
最終ジャッジ日時 | 2024-09-18 10:36:09 |
合計ジャッジ時間 | 10,584 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 45 RE * 5 |
ソースコード
n,m,k = map(int,input().split()) num = min(n,m)*2 - (n==m) 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)