11063 - B2-Sequence

All about problems in Volume 110. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Ecou
New poster
Posts: 10
Joined: Wed Aug 09, 2006 11:47 pm

Post by Ecou » Thu Aug 10, 2006 10:03 pm

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.

asif_rahman0
Experienced poster
Posts: 209
Joined: Sun Jan 16, 2005 6:22 pm

Post by asif_rahman0 » Thu Aug 10, 2006 10:35 pm

thnx a lot.
Yes i totally missed "i<=j".

bye

miras
Learning poster
Posts: 98
Joined: Sat Jun 14, 2003 1:45 pm

Post by miras » Fri Aug 11, 2006 3:49 pm

Great thanks to Observer for his help ;-)

I finally got AC ... ;-)
Remember Never Give Up
Regrads
Miras

serendipity
New poster
Posts: 6
Joined: Tue May 09, 2006 9:22 pm

11063 - B2-Sequence

Post by serendipity » Thu Aug 31, 2006 8:52 pm

can anyone tell me wot is the problem wid my code for b2-sequence? Im still getting WA:(

///removed

:-?
Last edited by serendipity on Mon Sep 11, 2006 11:19 am, edited 1 time in total.

daveon
Experienced poster
Posts: 229
Joined: Tue Aug 31, 2004 2:41 am
Location: TORONTO, CANADA

Post by daveon » Fri Sep 01, 2006 3:30 am

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.

serendipity
New poster
Posts: 6
Joined: Tue May 09, 2006 9:22 pm

Post by serendipity » Fri Sep 01, 2006 7:11 am

hey Daveon Thanx a lot. I get AC @last:D

daveon
Experienced poster
Posts: 229
Joined: Tue Aug 31, 2004 2:41 am
Location: TORONTO, CANADA

Post by daveon » Sat Sep 02, 2006 2:09 am

Hey, no problem. And please remove your code.

mohsincsedu
Learning poster
Posts: 63
Joined: Tue Sep 20, 2005 12:31 am
Location: Dhaka
Contact:

WA

Post by mohsincsedu » Mon Sep 04, 2006 11:12 pm

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.
Amra korbo joy akhdin............................

Erik
Learning poster
Posts: 67
Joined: Fri Jul 01, 2005 11:29 am
Location: Germany
Contact:

Post by Erik » Mon Sep 04, 2006 11:48 pm

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 :)

mohsincsedu
Learning poster
Posts: 63
Joined: Tue Sep 20, 2005 12:31 am
Location: Dhaka
Contact:

Acc

Post by mohsincsedu » Wed Sep 06, 2006 9:49 pm

Thanks to Erik

But why you don't print a blank line after case 16.
Amra korbo joy akhdin............................

Erik
Learning poster
Posts: 67
Joined: Fri Jul 01, 2005 11:29 am
Location: Germany
Contact:

Post by Erik » Wed Sep 06, 2006 10:43 pm

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 :)

chetan
New poster
Posts: 43
Joined: Sun Sep 24, 2006 2:39 pm

Post by chetan » Sun Jul 15, 2007 7:24 pm

hi all i am getting WA . can anybody plz help me with test cases

Code: Select all


CODE DELETED AFTER AC

Last edited by chetan on Mon Jul 16, 2007 5:25 am, edited 1 time in total.

ayeshapakhi
Learning poster
Posts: 60
Joined: Sun Apr 16, 2006 7:59 pm

Post by ayeshapakhi » Sun Jul 15, 2007 8:55 pm

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...

chetan
New poster
Posts: 43
Joined: Sun Sep 24, 2006 2:39 pm

Post by chetan » Mon Jul 16, 2007 5:24 am

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 ???

Obaida
A great helper
Posts: 380
Joined: Wed Jan 16, 2008 6:51 am
Location: (BUBT) Dhaka,Bagladesh.

Re: 11063 - B2-Sequence

Post by Obaida » Tue May 27, 2008 9:39 am

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????

Code: Select all

deleted
Last edited by Obaida on Wed Jul 30, 2008 2:07 pm, edited 1 time in total.
try_try_try_try_&&&_try@try.com
This may be the address of success.

Post Reply

Return to “Volume 110 (11000-11099)”