## 11673 - Enemy at the Gateway

Moderator: Board moderators

tryit1
Experienced poster
Posts: 119
Joined: Sun Aug 24, 2008 9:09 pm

### 11673 - Enemy at the Gateway

i don't understand this problem. What is s7,s8,s9.
First
Output
For each test case, output the number of places, the preamble may start.
Isn't this an integer ? How can we have more values.

Then after constraints it says
Output

For each line of input produce two or more line of output. The first line should contain the serial of output. The next lines should contain possible values of s7, s8 and s9. Please note than you should print only those solutions where s7 ? s8 ? s9. If there is more than one solution then print them in the ascending order of s7. If there is still a tie then print in the ascending order of S8. If no valid values of s7, s8 and s9 is found print the line “Peter has Forgotten Everything” instead. Look at the output for sample input for details.
what is s7 ,s8 ,s9 ? What is S8 ?

Given a pattern x1,x2,x3..,.x60 (do sort it ), then generate the number of intervals (p1,q1) ,(p2,q2)...,(pn,qn) {n<=10^6} ,
now find how any unique intervals contains the part of pattern OR is it how many intervals contain the complete pattern. Can someone explain me this problem ?

Chimed
New poster
Posts: 12
Joined: Mon Oct 20, 2008 10:37 am

### Re: 11673 - Enemy at the Gateway

First the problem statement is messed up. You have to ignore the second "input output" explanation. But the last part is correct.
Statements should read like this "given a N number of integrals [pi, qi] as described, and preamble n1,n2...,nP.
find how many consecutive intervals that contains preamble in its order "

Lets take a look second input.
The integrals are s1=[1,3], s2=[1,3], s3=[1,3]
And preamble is 1,2
s1 has (include) 1, and s2 has 2.
Also s2 has 1, and s3 has 2.
So possible number of starting places is 2 which are s1, s2.

tryit1
Experienced poster
Posts: 119
Joined: Sun Aug 24, 2008 9:09 pm

### Re: 11673 - Enemy at the Gateway

thanks chimed, for all those who want to solve the problem.

don't swap ,< p0 , q0> , assume they are in correct order.

If the number of places where pattern can be found is 0, then print 0, not "Peter has Forgotten Everything".
the output is like printf("Case %d: %d\n", testcase,ans); for everything.

The problem statement needs to be corrected. A simple simulation will get accepted.

Question rephrased as chimed is given intervals [p1,q1],[p2,q2]....[pn,qn], how many intervals contains the complete pattern P ? if interval [pk,qk] contains pattern P, then all of the intervals [pk+1,qk+1]... [pR,qR] contains the pattern P,P...,P[R-1].