12282 - OmniGravity

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

Moderator: Board moderators

Post Reply
forthright48
New poster
Posts: 37
Joined: Wed Mar 14, 2012 11:57 am
Location: Bangladesh
Contact:

12282 - OmniGravity

Post by forthright48 »

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
http://www.forthright48.com
brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 12282 - OmniGravity

Post by brianfry713 »

Don't read from a file.
Check input and AC output for thousands of problems on uDebug!
brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 12282 - OmniGravity

Post by brianfry713 »

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.
Check input and AC output for thousands of problems on uDebug!
mubashwir
New poster
Posts: 5
Joined: Sat May 22, 2010 8:47 am
Location: Dhaka, Bangladesh
Contact:

Re: 12282 - OmniGravity

Post by mubashwir »

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

Re: 12282 - OmniGravity

Post by mubashwir »

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......................................
forthright48
New poster
Posts: 37
Joined: Wed Mar 14, 2012 11:57 am
Location: Bangladesh
Contact:

Re: 12282 - OmniGravity

Post by forthright48 »

@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
http://www.forthright48.com
Post Reply

Return to “Volume 122 (12200-12299)”