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!