Search found 26 matches

by outsbook
Mon Nov 28, 2011 4:27 pm
Forum: Volume 4 (400-499)
Topic: 429 - Word Transformation
Replies: 82
Views: 17446

429 - Word Transformation

BFS problem 1. Input all dictionary words to string array word[] 2. Find adjacency list for all word. ab adjacency can be ac, ad,....,cb,db, and so on. i.e. only one character is different and two word length are same. but ab adjacency can not be ab,abc,dab,cd and so on. 3. Now run BFS from start wo...
by outsbook
Mon Nov 28, 2011 4:21 pm
Forum: Volume 109 (10900-10999)
Topic: 10977 - Enchanted Forest
Replies: 42
Views: 17751

10977 - Enchanted Forest

BFS Problem with some extra work 1. For each block location(R,C), set grid[R][C]=false 2. Jigglypuff at location (R,C) having loudness L blocks all grid points (r,c) satisfying: . so, you do not need to use floating point. If (r,c) satisfy then set grid[r][c]=false. Now you got all unsafe location. ...
by outsbook
Sat Nov 26, 2011 9:23 pm
Forum: Volume 115 (11500-11599)
Topic: 11513 - 9 Puzzle
Replies: 10
Views: 5073

Re: 11513 - 9 Puzzle

try this Input: 9 8 7 6 5 4 3 2 1 7 8 9 4 5 6 1 2 3 1 9 2 3 8 4 5 7 6 3 2 1 4 5 6 7 8 9 1 2 3 6 5 4 7 8 9 1 3 2 7 9 8 4 6 5 7 9 8 4 6 5 1 2 3 7 9 8 4 6 5 1 3 2 7 9 8 1 3 2 4 6 5 1 2 3 4 5 6 7 8 9 0 Output: 11 H2V3V3V1H3H3H2V2V1V1H1 Not solvable 8 V1H3V2H3V2H2H1H1 Not solvable Not solvable 11 H3V3V2V...
by outsbook
Thu Nov 24, 2011 11:30 pm
Forum: Volume 115 (11500-11599)
Topic: 11561 - Getting Gold
Replies: 31
Views: 9766

11561 - Getting Gold

1. Every T send a draft his top, bottom, left, right. 2. Find draft position for every T. 3. Start BFS from position P. 4. Find adj (left, right, top, bottom) and push to Queue when the position is not draft ( If the position is draft then do not find adj and do not push to Queue) 5. Count gold when...
by outsbook
Tue Nov 22, 2011 5:05 pm
Forum: Volume 123 (12300-12399)
Topic: 12372 - Packing for Holiday
Replies: 2
Views: 1198

12372 - Packing for Holiday

if L >20 or W>20 or H>20 then bad
else good
by outsbook
Mon Nov 21, 2011 5:34 pm
Forum: Volume 115 (11500-11599)
Topic: 11518 - Dominos 2
Replies: 24
Views: 8715

Re: 11518 - Dominos 2

Run BFS single time for all domino's which are knocked over by hand.
If you run BFS l time then you got time limit exit.

First push all z to queue then run bfs one time and calculate total number of domino's fall down.
by outsbook
Sat Nov 19, 2011 6:41 pm
Forum: Volume 6 (600-699)
Topic: 657 - The die is cast
Replies: 46
Views: 21680

Re: 657 - The die is cast

try this

Input:

Code: Select all

2 2
XX
XX
2 2
..
**
2 2
..
..
5 5
XX**X
XX**X
.....
.....
XX**X
Output:

Code: Select all

Throw 1
1

Throw 2
0

Throw 3
0

Throw 4
2 2

by outsbook
Thu Nov 17, 2011 2:55 am
Forum: Volume 110 (11000-11099)
Topic: 11060 - Beverages
Replies: 96
Views: 32880

Re: 11060 - Beverages

try this

Code: Select all

Input:
3
a
b
c
4
a b
b c
a b
b c

output:
Case #1: Dilbert should drink beverages in this order: a b c.

by outsbook
Sat Nov 12, 2011 11:36 am
Forum: Volume 122 (12200-12299)
Topic: 12280 - A Digital Satire of Digital Age
Replies: 3
Views: 2807

Re: 12280

try this: Input 4 ........||.../\... ........||../..\.. .../\...||./....\. ../..\..||/G.....\ ./.Q..\.||\______/ /Y.YFU.\||........ \______/||........ ------------------ .../\...||........ ../..\..||........ ./....\.||.../\... /WCGQG.\||../A.\.. \______/||./Y...\. ........||/O.....\ ........||\_____...
by outsbook
Fri Nov 04, 2011 3:39 am
Forum: Volume 102 (10200-10299)
Topic: 10267 - Graphical Editor
Replies: 190
Views: 52600

Re: 10267 - WA

In this problem, x1>x2 or y1>y2 so, you need if(x1>x2) then swap(x1,x2) and if(y1>y2) then swap(y1,y2) try this Input: I 5 6 L 2 3 A L 3 4 A F 2 3 B S one.bmp L 3 3 A L 2 3 A F 2 3 B S two.bmp C S three.bmp S four.jpeg K 1 5 2 1 X S five.jpeg K 2 2 5 5 Z S six.jpeg C V 2 3 6 W S seven.jpeg C V 2 6 3...
by outsbook
Fri Oct 28, 2011 2:49 am
Forum: Volume 123 (12300-12399)
Topic: 12318 - Digital Roulette
Replies: 5
Views: 2579

Re: 12318 - Digital Roulette

do not use pow() method for calculating x^k
make a pow method

Code: Select all

long pow(long x, int k)
----if k==0 then return 1
----powval = x%(N+1)
----for i=1 to k-1 
------powval *= x
------powval  %= (N+1)
:D :D :D I think now the problem is very easy

Go to advanced search