Page 3 of 5
Posted: Thu Aug 10, 2006 10:03 pm
by Ecou
Case 2:
4
15 16 17 18
is not a b2-seq. 15 + 17 = 16 + 16 for example. You probably forgot
to start at i = j because of "... for all i<=j" instead of i<j.
Posted: Thu Aug 10, 2006 10:35 pm
by asif_rahman0
thnx a lot.
Yes i totally missed "i<=j".
bye
Posted: Fri Aug 11, 2006 3:49 pm
by miras
Great thanks to
Observer for his help
I finally got AC ...

11063 - B2-Sequence
Posted: Thu Aug 31, 2006 8:52 pm
by serendipity
can anyone tell me wot is the problem wid my code for b2-sequence? Im still getting WA:(
///removed

Posted: Fri Sep 01, 2006 3:30 am
by daveon
Hi,
Code: Select all
while( (scanf("%ld",&N))==1)
{
.
.
.
if(b2[0]<=0) //not a b2-seq
{
flag= 0;
break;
}
.
.
.
}
This if-statement effectively ends your input while loop. You do not want this. Take out the break statement and try again.
Posted: Fri Sep 01, 2006 7:11 am
by serendipity
hey Daveon Thanx a lot. I get AC @last:D
Posted: Sat Sep 02, 2006 2:09 am
by daveon
Hey, no problem. And please remove your code.
WA
Posted: Mon Sep 04, 2006 11:12 pm
by mohsincsedu
what is the worng :
input:
Code: Select all
4
1 2 3 3
4
15 16 17 18
4
-5 0 5 9
6
1 9 19 0 45 70
6
1 9 19 45 70 150
5
15 16 -1 17 18
4
2 2 2 3
4
2 2 2 2
4
1 9 18 36
5
1 9 10 18 36
5
20 30 40 50 60
3
1 3 5
6
2 6 3 2 6 3
2
2 2
3
1 3 5
3
0 1 3
Output:
Code: Select all
Case #1: It is not a B2-Sequence.
Case #2: It is not a B2-Sequence.
Case #3: It is not a B2-Sequence.
Case #4: It is not a B2-Sequence.
Case #5: It is a B2-Sequence.
Case #6: It is not a B2-Sequence.
Case #7: It is not a B2-Sequence.
Case #8: It is not a B2-Sequence.
Case #9: It is a B2-Sequence.
Case #10: It is not a B2-Sequence.
Case #11: It is not a B2-Sequence.
Case #12: It is a B2-Sequence.
Case #13: It is not a B2-Sequence.
Case #14: It is a B2-Sequence.
Case #15: It is a B2-Sequence.
Case #16: It is not a B2-Sequence.
thanks in advanced.
Posted: Mon Sep 04, 2006 11:48 pm
by Erik
Hi,
my AC program outputs:
Code: Select all
Case #1: It is not a B2-Sequence.
Case #2: It is not a B2-Sequence.
Case #3: It is not a B2-Sequence.
Case #4: It is not a B2-Sequence.
Case #5: It is a B2-Sequence.
Case #6: It is not a B2-Sequence.
Case #7: It is not a B2-Sequence.
Case #8: It is not a B2-Sequence.
Case #9: It is a B2-Sequence.
Case #10: It is not a B2-Sequence.
Case #11: It is not a B2-Sequence.
Case #12: It is not a B2-Sequence.
Case #13: It is not a B2-Sequence.
Case #14: It is not a B2-Sequence.
Case #15: It is not a B2-Sequence.
Case #16: It is not a B2-Sequence.
Take a look at case #15, for example. Clearly 3+3=6=1+5.
By the way, input specification states
There is a blank line after each test case.
Cu, Erik

Acc
Posted: Wed Sep 06, 2006 9:49 pm
by mohsincsedu
Thanks to Erik
But why you don't print a blank line after case 16.
Posted: Wed Sep 06, 2006 10:43 pm
by Erik
Hi,
I'm sorry - of course it's in the output, but it didn't survive to be copied here into the forum
Cu, Erik

Posted: Sun Jul 15, 2007 7:24 pm
by chetan
hi all i am getting WA . can anybody plz help me with test cases
Posted: Sun Jul 15, 2007 8:55 pm
by ayeshapakhi
change..
Code: Select all
if(arr[0] <= 0) flag = 1;
for(int i=0;i<n;i++)
if(arr[i] <= 0 || arr[i]>10000) flag = 1;
for(int i=1;i<n;i++)
if(arr[i] <= arr[i-1]) flag = 1;
then fix PE...
Posted: Mon Jul 16, 2007 5:24 am
by chetan
thanks. but i got AC in 0.07s
many ppl have got ac in 0.002 ~ 0.004s. what optimizations can i make to speed it up ????
i made all possible optimizations. i even break out of the loops immediately when i find an error condintion and proceed to process the next test case.
is there any other better algo ???
Re: 11063 - B2-Sequence
Posted: Tue May 27, 2008 9:39 am
by Obaida
Is there any mistake in the algo??? Is there any test case failed??? I don't know why so many WA..
Why this gives WA????