Блог пользователя snake

Автор snake, 16 лет назад, По-английски
A: STL find(in contest, i was confused with the function find_first_of and find_last_of ,which caused me 3 wa's)

B: Construct the map with obstacles but where the robot moved, Then do a straightforward BFS.

C:Dynamic Program. Every state s's bit means an object, 1 for gotten. And dp[s] means the minimum time for tidying the things.So 
dp[s] = min(mini(dp[s - (1 <  < i)] + singledis[i]), minij(dp[s - (1 <  < i) - (1 <  < j)] + doubledis[i][j]))
Note that there is a important optimization, or TLE.

Waiting for D and E

BTW, I found Khromov solved the Problem C with greedy algorithm!
  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

16 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится
Note that B can be solved without BFS.
16 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится
My WA idea for C:
Robot way don`t have self-intersecting.
And my AC idea for C:
Every step of robot must have no more than 1 cells, which robot have been.
i.e. check on every step.

Sample (1-way):
08760
09050
12340

9 step - 2 neighbors => BUG
054
123
5 step - 2 neighbors => BUG

If all steps are check without BUG  then OK