SEQ1 - 01 Sequence
题意翻译
给定7个整数N,A0,B0,L0,A1,B1,L1,要求设计一个01串S=s1s2…si…sN,满足:
1.si=0或si=1,1<=i<=N;
2.对于S的任何连续的长度为L0的子串sjsj+1…sj+L0-1(1<=j<=N-L0+1),0的个数大于等于A0且小于等于B0;
3.对于S的任何连续的长度为L1的子串sjsj+1…sj+L1-1(1<=j<=N-L1+1),1的个数大于等于A1且小于等于B1;
例如,N=6,A0=1,B0=2,L0=3,A1=1,B1=1,L1=2,则存在一个满足上述所有条件的01串S=010101。
题目描述
The input consists of exactly 5 test cases in the following format:
输入输出格式
输入格式
```
N A0 B0 L0 A1 B1 L1 [3<=N<=1000,1<=A0<=B0<=L0<=N,1<=A1<=B1<=L1<=N]
```
输出格式
Exactly 5 lines,each contains:
a) A N-character sequence (We name it S) consisting of only characters '0' and '1' and no extra whitespaces, which satisfy the following conditions:
- The number of '0' in any consecutive subsequence of S whose length is L0 is not more than B0 and not less than A0.
- The number of '1' in any consecutive subsequence of S whose length is L1 is not more than B1 and not less than A1.
输入输出样例
输入样例 #1
6 1 2 3 1 1 2
[and 4 test cases more]
输出样例 #1
010101
[and 4 test cases more]