Hello Competitors,
I would like to invite you all to participate in the follow up of Third Coding Marathon of Princess Sumaya University for Technology. The contest was originally held on April 30, and it will launch in Codeforces Gym tomorrow; May/07/2016 10:00.
The problems were prepared by Hasan0540, SaMer, and Dr. Ibrahim (earlgray).
The contest will be held with extended ACM ICPC rules. You'll be given 14 problems to solve within 270 minutes. Some of the problems have two parts (A and B), where A is easier than B, and the statement of B depends on the statement of A. The difficulty of the contest is similar to Codeforces Div. 2 contests.
Good luck to you, and I hope you can enjoy the problemset.
Note: Don't forget to use fast I/O methods.
I would appreciate if someone can explain solutions to Problem B and Problem I? Anyone please?
any hint for B ??
Problem B :
DSU
If
dp[i][j]==dp[i][j-1] or dp[i][j]==dp[i-1][j]
thenfirst_string[i] != second_string[j]
else: they are equal which means you need to merge node i from the first string with the node j from the second string. You can numerate the node with index j in the second string as j + n where n is the length of the first string to code it in an easier way.
so the nodes with same component have the same character and the rest of the nodes in the first string can be any character (choose one) but not anyone you used previously and the second string the same move but don't use any previous character including the ones you used in the first string and use one for each string because B,C <= 25 (to make sure you will have enough characters)
problem D why Runtime error on test 42 ?
http://ideone.com/eWW9sg