snake's blog

By snake, 14 years ago, In English
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!

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By snake, 14 years ago, In English
A.ad hoc
B.Simulation
C.Extended Euclid


First Contest Here, but not the last one. I like it

UPD:D.Palindrome Judgement(Use string hash function to decide if it is.O(n))

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By snake, 14 years ago, In English
  • Vote: I like it
  • 0
  • Vote: I do not like it