12282 - OmniGravity

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

Moderator: Board moderators

12282 - OmniGravity

Postby forthright48 » Thu Jun 14, 2012 8:01 pm

In the problem statement, it said "There is a blank line before every case." But in the sample, there is no space before the first case? Which one should I follow. In addition, I tried submitting in both ways, but I am getting WA.

Code: Select all
Got AC. :D
Last edited by forthright48 on Thu Jun 14, 2012 10:07 pm, edited 1 time in total.
What ever happens, happens for good. Even when we get WA :p
forthright48
New poster
 
Posts: 13
Joined: Wed Mar 14, 2012 11:57 am
Location: Bangladesh

Re: 12282 - OmniGravity

Postby brianfry713 » Thu Jun 14, 2012 9:28 pm

Don't read from a file.
brianfry713
Guru
 
Posts: 1751
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 12282 - OmniGravity

Postby brianfry713 » Thu Jun 14, 2012 9:30 pm

In my AC code I read the input using scanf("%s"), so it didn't matter if there was a blank line in the input or not.
brianfry713
Guru
 
Posts: 1751
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 12282 - OmniGravity

Postby mubashwir » Thu Jun 14, 2012 9:31 pm

Though its not a good case but still it proves your code wrong....check it out.......:p
    1
    .#..AA..
    .##.AA#.
    ........
    .CCBB...
    .CCBB#..
    #.......
    ..DD....
    ..DD....
your output
    Case 1: 2315
ans is :
    Case 1: 2314
........I am a simple man having a few simple dream........
.......................................AIUBCSE......................................
mubashwir
New poster
 
Posts: 5
Joined: Sat May 22, 2010 8:47 am
Location: Dhaka, Bangladesh

Re: 12282 - OmniGravity

Postby mubashwir » Thu Jun 14, 2012 9:39 pm

you can try this... this may help you....
Code: Select all
1
.#..AA..
.##.AA#.
..#.#.#.
.CCBB..#
.CCBB#..
##...#.#
#.DD..#.
.#DD....


your ans is :
Code: Select all
Case 1: 13

my ans is :
Code: Select all
Case 1: 12
........I am a simple man having a few simple dream........
.......................................AIUBCSE......................................
mubashwir
New poster
 
Posts: 5
Joined: Sat May 22, 2010 8:47 am
Location: Dhaka, Bangladesh

Re: 12282 - OmniGravity

Postby forthright48 » Thu Jun 14, 2012 10:12 pm

@brianfry713: Thanks. I used scanf to avoid the blank line problem.

@mubashwir: Thanks vaia. After seeing your test cases I realized the statement asked for "number of different static states that can be reached from the original position by enabling at least one gravity". Initially the gravity is off. So sometimes the initial state given may not be static. I simply removed two lines and got AC :D
What ever happens, happens for good. Even when we get WA :p
forthright48
New poster
 
Posts: 13
Joined: Wed Mar 14, 2012 11:57 am
Location: Bangladesh


Return to Volume CXXII

Who is online

Users browsing this forum: No registered users and 1 guest