### dolphinigle's blog

By dolphinigle, 9 years ago,

UPD: Editorial

Hello!

After the barrage of non-standard contests (memSQL, ABBYY, Yandex), we present you a standard and fun (and strange) Codeforces round! This contest is prepared by Indonesian coders: fushar, jonathanirvings, and me (dolphinigle)! fushar wrote D2-E/D1-C, jonathanirvings wrote D2-B, and I wrote the rest. For me, this is my fourth contest, after Codeforces Beta Round #87 (Div. 1 Only), Croc Champ 2012 - Final, and last week’s MemSQL start[c]up Round 1 (only 1 problem there though). We would also like to thank Gerald for helping with the contest preparation, Delinur for translation, and MikeMirzayanov for the system!

I think this contest is stranger than usual -- The statements are strange, there are pictures everywhere, etc. There is a single problem with very lengthy statement (I am unable to shorten it further without losing clarity, I'm sorry), but I think it's very clear. The other problems have relatively short statements.

fushar drops a message for you:

We think that the solutions to all problems are satisfying to discover. We want to add a special note: you might find that the solutions will not be too “usual” :).

Happy solving!

UPD: The contest is finished! Editorial will be posted tomorrow by fushar. Hope you enjoyed the contest!

...Div1-D 329D - The Evil Temple and the Moving Rocks was a little too strange I guess.

UPD: Congratulations to the winners!

D1:

D2:

You guys are certainly good at ad hoc problems! :)

UPD: Komaki, followed by Marcin_smu finally solved the last problem 329E - Evil after the contest. During the contest, they submitted some solutions with the right idea but got caught by pretest. You guys are awesome! UPD: Scores:

D2: standard (500 1000 1500 2000 2500)

D1: 500 1000 1500 1500 2500

UPD: Important: This contest is held in an unusual time (2 hours earlier than usual): http://www.timeanddate.com/worldclock/fixedtime.html?day=20&month=7&year=2013&hour=17&min=30&sec=0&p1=166

• +382

 » 9 years ago, # |   0 WOW like that kind of contests.But to clarify, what do you mean by "unusual" or "unusual solutions"?
•  » » 9 years ago, # ^ |   +26 Nothing drastic really -- you can compete as if it's a normal round and you should be fine :)
•  » » » 9 years ago, # ^ |   -12 Is it similar to April fools day contest?!
•  » » » » 9 years ago, # ^ |   -7 Don't you see that author said that it's a normal round?
•  » » 9 years ago, # ^ |   +14 May be the problems will have less similarity with past problems and the solutions are not as usual as we seen before.That means no chance to have a common problem. But that's only my point of view. :)
 » 9 years ago, # |   +18 What you said really arouse my curiosity."you might find that the solutions will not be too “usual” " I hope I can solve some of them.
 » 9 years ago, # |   -30 I imagine some crazy ad-hocs (contruction algorithms with tolerance, debugging a code, games where game theory is useless...) as strange tasks. In general, I don't find "strange" good, because it's easier to mess up when preparing such problems... oh well, I'm travelling to IMO during the contest, so I won't be able to participate no matter what.
•  » » 9 years ago, # ^ | ← Rev. 2 →   +29 This is a good time to test out the new polygon's features then!
•  » » » 9 years ago, # ^ |   0 This new feature is awesome. It really helps!
•  » » » 9 years ago, # ^ |   0 I think it was tested in Test round 8.
•  » » » 9 years ago, # ^ |   0 I have used polygon for a contest and my problems are ready.But I don't know what should I do now!How to submit theme to Gerald or... ? Sorry for poor English
•  » » 9 years ago, # ^ |   -46 F**k IMO, compete at CF!!!
•  » » » 9 years ago, # ^ |   +48 That's really rude. :/
 » 9 years ago, # |   +72 What I can say is: the problems will be interesting, and you will be very satisfied when you solve them :)
•  » » 9 years ago, # ^ |   -11 Well, then I must have a try and take part in this contest!
•  » » 9 years ago, # ^ |   +9 What I can add is : When you solve them, you will be proud of yourself, as we are :)
 » 9 years ago, # |   +39 You should mention about the unusual time in this contest!
•  » » 9 years ago, # ^ |   +18 Right! Thank you!
 » 9 years ago, # |   -25 i cant wait :3
•  » » 9 years ago, # ^ |   -10 You can wait She can wait He can wait We can wait They can wait
 » 9 years ago, # |   -12 is the earlier time because of indonesian setter :P ?i like this kind of time :D
•  » » 9 years ago, # ^ |   +17 The usual time is 10.30PM in Indonesia. That's too late for some of us :)
 » 9 years ago, # |   +31 Everything is unusual. Expecting an unusual increase in rating too :-)
 » 9 years ago, # |   -13 The other problems have relatively short statements.I love short statements.
 » 9 years ago, # |   -8 Seems a cool contest! "This contest is stranger than usual"
 » 9 years ago, # |   +5 I hope I am able to solve at least one! I'm not very good at these contests and this would be my third contest
 » 9 years ago, # |   +1 Hope that unusual solutions will uplift my rating unusual up. :)
•  » » 9 years ago, # ^ |   +8 Lol like someone already commented: http://codeforces.com/blog/entry/8402#comment-141506
•  » » » 9 years ago, # ^ |   0 Yes like that.
 » 9 years ago, # | ← Rev. 2 →   +13 It's nice to see many up coming contests already scheduled, this is going to be a very interesting week!
 » 9 years ago, # |   -16 It's just a test~~~~Codeforces is a test for me, too~~~~
 » 9 years ago, # |   +7 What is the scoring method? If it's static scoring, what are the scores for each problem?
•  » » 9 years ago, # ^ |   +4 It will be static. We will release the scores some time before the contest.
 » 9 years ago, # | ← Rev. 2 →   -21 the contest will not be usual, en...., but I hope the contest will fit our taste, good luck & have high rating for everyone~
 » 9 years ago, # | ← Rev. 2 →   +20 Does 'mikemon' stand for 'Mike — monster'?
•  » » 9 years ago, # ^ |   +33 Not intentionally :)...i thought "mi-ke-mon" sounds similar with "po-ke-mon" >:)
 » 9 years ago, # |   +11 A really unusual contest!!
 » 9 years ago, # |   -17 Is it possible that n can be equal 1 in Problem B div 2???
•  » » 9 years ago, # ^ |   0
•  » » 9 years ago, # ^ |   0 yes ... number of roads is 0
 » 9 years ago, # | ← Rev. 3 →   +2 Unusual number of hacks!
 » 9 years ago, # | ← Rev. 3 →   +8 I really like today's problems! But the number of hacks is a bit disappointing
 » 9 years ago, # |   -21 Just find the bug several seconds after the contest finished!!!!WTF
 » 9 years ago, # |   0 Как решать D? конструкция >>>>>>.vvvvvv ............. ^^^^^..<<<<<< получает только 85к
•  » » 9 years ago, # ^ | ← Rev. 4 →   +4 >>>>.>.V ^.<.<<<< Может бытьUPD: именно то, что написано ниже
•  » » » 9 years ago, # ^ |   +36 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>v ^<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< repeated 50 times. Initial active stone is at (99, 1).One cycle gives 66 sounds (33 at the top and 33 at the bottom), and there are 33 cycles (until “^” can freely move up, where it activates the next cycle and gives another sound.50 × (66 × 33 + 1) = 108950 sounds in total.
•  » » 9 years ago, # ^ |   -6 Думаю, что примерно так сработает, если <<<<<<< в конце около 50: >>>>>>>>>>>>>>v ^.<.<.<.<<<<<<< ^.<.<.<.<<<<<<< ^.<.<.<.<<<<<<< ^.<.<.<.<<<<<<< ^.<.<.<.<<<<<<< ^.<.<.<.<<<<<<< 
•  » » » 9 years ago, # ^ |   0 Вроде ряды ниже второго бесполезны тут
 » 9 years ago, # |   -19 Was it only me who noticed that 3 questions(!!) had something to do with matrices.
 » 9 years ago, # | ← Rev. 2 →   +34 Wonderful contest. I don't think the problems are as strange as I expected before, but Div 1 D is certainly strange (pretests are all tests, and it's not really a programming problem) and it is certainly my favorite.Also, in my room, only I submitted a hardcoded answer (for D)? Only I ripped off the first two cases from the sample cases (which then I regretted as it makes the second test case run for absurdly long)? :P
 » 9 years ago, # |   +21 Wonderful contest! All problems are special and enjoyable to solve. It's really amazing to discover solutions!
 » 9 years ago, # |   +43 Thank you for the contest! D was definitely memorable.Speaking about D, does anyone have a successful ring-based approach? I get a feeling there might be a solution but it'll be considerably harder than snake-based approach. My best try took about 85.8K.
 » 9 years ago, # |   0 this is my first time to join the codeforces contest and i feel really excited to beat the buzzer~....the questions were not too unusual....
 » 9 years ago, # |   -8 still slow…… sbcf…… I pressed "submit" when there were only 10 seconds left. After 20 seconds, Codeforces show me an error page...
•  » » 9 years ago, # ^ |   +17 But it seems like you didn't participated in this round :D
•  » » 9 years ago, # ^ |   0 sorry to hear that but= =..YM!
•  » » 9 years ago, # ^ |   +13 What does sbcf mean?
 » 9 years ago, # |   0 I had MLE wtf?http://codeforces.com/contest/330/submission/4121993
•  » » 9 years ago, # ^ |   +1 visited[i][j]=true; bad idea) Need in if() { visited[i][j]=true; }
•  » » 9 years ago, # ^ |   0 Looks like you can add vertices to the queue more than one time, because you don't check visited before adding. Try empty field 20x20 and look at the size of your queue.
•  » » 9 years ago, # ^ |   -8 Yeah, it's MLE.
 » 9 years ago, # |   +4 Found D1-B funny: despite the huge statement about mikemon breeders looking at the path beforehand, it is completely irrelevant for their optimal strategy anyway (they should all just run to the exit as soon as they can!)
•  » » 9 years ago, # ^ |   0 Exactly. That, I believe, is the crucial deduction; after that it's just implementing breadth-first search from the exit to see which breeders can reach the exit before or at the same time as we can.Additionally, even though we're not required to minimize the number of moves, the optimal strategy is indeed to minimize the number of moves to reach the exit.
 » 9 years ago, # |   +4 It was a very amusing contest , In problem D , I spent a very long time in the contest trying to figure how to get the shortest path from some nodes to a node avoiding high complexity, and I totally forgot that it's the same from the other side :D Changing the starting point of the BFS will make the code pass :'(
 » 9 years ago, # | ← Rev. 3 →   +8 very slow system test:|I solve problem D div2 2 minute after end of the contest:(((((
•  » » 9 years ago, # ^ |   +2 You aren't the one, i only figured a bug in my code of D div2 after the contest ended..
 » 9 years ago, # |   0 for problem div2 B Road Construction. in case 1 is WA for input 4 1 1 3 output 3 1 2 1 4 2 3 why is incorrect?
•  » » 9 years ago, # ^ |   +1 The distance between every two nodes should be at most 2 roads , in your solution the distance between 4 and 2 will be three roads.
•  » » 9 years ago, # ^ |   0 You need 3 roads to go to #3 from #4
•  » » 9 years ago, # ^ | ← Rev. 2 →   0 .
•  » » 9 years ago, # ^ |   0 because you would need three steps to go from 4 to 3
 » 9 years ago, # |   0 I don't know if I got the question wrong. some of the solutions are accepted but for the following test case they give wrong result.4 2 1 2 3 4For above test case they dont print anything but solution exists. 1 3 1 4 2 3 2 4
•  » » 9 years ago, # ^ | ← Rev. 2 →   0 Number of deleted edges (m) must be less than half of number of vercies (n).
•  » » » 9 years ago, # ^ |   0 thanx dude! I got it.
 » 9 years ago, # |   0 Can anyone point out the mistake in my solution http://codeforces.com/contest/330/submission/4121524 for Div2 D/Div1 B — Biridian Forest? I have used a bfs to compute distance of the exit from each point. I have stored the graph in 1-indexed arrays and put trees on the boundary so that the algorithm does not process invalid points.
•  » » 9 years ago, # ^ | ← Rev. 3 →   +5 I don't see where you check vis array when computing the answer. You may add to result points from which finish is unreachable.See the comment below for the example.
•  » » » 9 years ago, # ^ | ← Rev. 2 →   0 I check it here: for(int i=0;i<4;++i){ int newx=x+dx[i]; int newy=y+dy[i]; if(vis[newx][newy]||(inp[newx][newy]=='T')) continue; vis[newx][newy]=1; } I don't include a point if it is a tree. I have added trees along the boundary too. How can unreachable points go into the queue?EDIT: Got it. This mistake cost me a colour change :(
•  » » 9 years ago, # ^ |   +14 Try this case: 4 4 ETTT 0T9T 0TTT 000S 
•  » » » 9 years ago, # ^ |   +1 Thanks a lot. I got the same mistake as kira.
•  » » » 9 years ago, # ^ |   +1 Found it. Thanks
 » 9 years ago, # |   +54 It looks like someone throws the testing machine into water...more and more slowly...
 » 9 years ago, # |   +34 Proud to be Indonesian! too bad I competed on Div 1, my skill is not enough to "enjoy" all the problem, lucky I could solve 500 pts problem.Btw, I'm a big fan of fushar/Ashar Fuadi (yes, I said that). I never beat him on local contest, my team's best result was able to solve as much problem as fushar's, but beaten by time penalty. He's a very good problem solver/setter, and a humble person too. This year is my last year in university, so last year competition season was my last season. So good luck for you and your team fushar, hope you all will achieve World Final next year. And good luck for jonathanirvings too, Go Get Gold! And dolphinigle too! (too bad I don't know dolphinigle personally).
•  » » 9 years ago, # ^ |   +3 Well, thank you very much! ^ ^
 » 9 years ago, # | ← Rev. 5 →   +23 My solution for Div2-C is wrong and got AC.Input: 4 .EEE .EE. EEEE E... Output: 1 1 4 4 2 4 4 2 4 3 While the minimum number of spells is 4.
•  » » 9 years ago, # ^ | ← Rev. 2 →   -13 If I were you, I would not advertise it
•  » » 9 years ago, # ^ |   +16 Looks like I missed this test case.Originally the problem has more than 120 test cases, but to make system test faster we decide to reduce it to 60. It's likely that I accidentally removed the case that would've countered your solution.Sorry and thanks.
 » 9 years ago, # |   +33 Examples were explained very good and pictures were really nice and clear. Thanks for the contest.
 » 9 years ago, # |   +35 Really love this kind of contests. Thank you dolphinigle, fushar and jonathanirvings!I spend one hour to find a deterministic way to solve C, but it's too complicated to code. After some minutes of despair, I figured out if N is large then there will be lots of solutions, so I code a naive random algorithm and passed.After the contest I read the problem D, it's more interesting! If I read both C and D, I will definitely try D first. :)By the way, does "mikemon" in problem B refers "pokemon"?
•  » » 9 years ago, # ^ |   +8 Thank you! I'm really happy to hear people enjoying my contests :)...and for the other question, I replaced "po" with "mi" >:). You should read it "mi" "ke" "mon", not "mike" mon.
•  » » 9 years ago, # ^ |   +5 Actually my personal intended solution is the deterministic one, but we also let randomized solutions pass quite easily :)By the way, there exists a deterministic solution that is not very complicated (although there are too many tricky cases for this problem) in the editorial soon.Yes, this actually refers to Pokemon, but we were afraid of copyright infringement so we changed it to mikemon :P
•  » » » 9 years ago, # ^ |   +6 Here comes a deterministic solution.First check whether this graph has a connected component of size no less than 5, if so, we can use these vertex to construct a circle. It's easy if we connect vertex i with (i+2)%size and be careful when size%2 == 0.Otherwise if there exist two different connected component of same size 2,3 or 4, we can construct the circle easily by union them. You can also do this when you have four isolate vertex.Now we keep this circle in hand, then for all other connected component, if its size is large than 4, we just construct a new circle by themself, otherwise we can insert them to the circle we keep because the circle's size is no less than four.The only question now is how to deal with the situation that we can not build a circle first. If so, this graph can just contain at most 3+2+3+4=12 vertex, then we can do a simple search algorithm for that.I come up with this idea durning the contest and spend more than half an hour to code it but finally fail, it's really a huge work for poor me. I feel very depressed when I see so many random solution pass the system test >_<. Here is my accept code, it's a little bit ugly... http://codeforces.com/contest/329/submission/4123108But indeed, it's a really nice problem, thanks for your work. :)
•  » » » 9 years ago, # ^ |   0 Do we have some guarantees of the accuracy of the randomized one. Actually I use a deterministic solution employ divide and conquer of time complexity of O(nlogn) and deal with a tricky case of circle_length=3.
•  » » 9 years ago, # ^ |   +5 Thank you. I'm really happy to hear that. Actually I only wrote Div-2 problem, so I couldn't "entertain" Div-1 users in this contest. (Well, maybe next time :))
 » 9 years ago, # |   +10 Though I got -49, The contest was really good and encouraging for all, specially for beginner. :)
 » 9 years ago, # |   +1 can anyone please tell me why my solution of Div 2-B is giving WA on test 29 as it is giving correct ans on ideone as well as on my system also... my solution-- http://codeforces.com/contest/330/submission/4116737 http://ideone.com/Wet1Tt
•  » » 9 years ago, # ^ |   0 You didn't initialize your visited array with falses
•  » » » 9 years ago, # ^ |   0 But then how it passed 28 test cases?
•  » » » » 9 years ago, # ^ |   0 it was ur good luck :)garbage values were false by default!
•  » » 9 years ago, # ^ |   0 take visited array global.
 » 9 years ago, # |   +2 The contest was really good . . . .
 » 9 years ago, # |   0 how can I see why my submission to "Purification" (div1-A) problem gives compilation error?
•  » » 9 years ago, # ^ |   0 Ok, I see, I forgot #include Anyway, how to use "custom test" to see that?
•  » » 9 years ago, # ^ |   0 I mean I forgot "include cstdlib". I don't know how to use "custom test" to see that.
•  » » 9 years ago, # ^ | ← Rev. 3 →   +1 If you click on compilation error you will see what's the cause of CE. Edited : Sorry! Didn't see your last comment.
•  » » 9 years ago, # ^ |   0 It gives "exit was not declared in this scope" on my computer.
•  » » 9 years ago, # ^ | ← Rev. 2 →   +1 You should be able to click on the "Compilation error"?But anyway, you declared i four times, in each for loop. That gives the compilation error (redeclaration of variable).EDIT: Weird, I tested redeclaration and got compilation error, but when I copied your code instead, it gave the "exit was not declared" error as above. So the reason I gave above might be incorrect.
•  » » » 9 years ago, # ^ | ← Rev. 2 →   0 That is not the reason. i is considered to be declared in the loop, so it is not a redeclaration.
•  » » 9 years ago, # ^ |   +1 In custom test you will see your compilation error on output section.
•  » » » 9 years ago, # ^ |   0 I got the message "Error: Form elements must not have name or id of "submit"." I don't understand this message.
•  » » » » 9 years ago, # ^ |   0 You just check the rows.You should check the columns too.
 » 9 years ago, # | ← Rev. 2 →   0 Anyone can say me what is wrong with my submission in problem B here:http://codeforces.com/contest/330/submission/4121515The checker simply says that : wrong answer You cannot constract bad roads.Which bad road did i constract? How can i see it. How can i see whole input, answer and output for the wrong test?
•  » » 9 years ago, # ^ |   0 It's not possible
•  » » 9 years ago, # ^ | ← Rev. 2 →   0 You have connected nodes 2 and 65 that are not allowed to be connected.
•  » » 9 years ago, # ^ |   +5 you connect 2 with 65.
 » 9 years ago, # |   +2 Nice contest! Thanks!
 » 9 years ago, # |   +5 (Y) (Y)I didn't manage to participate, but my friends are saying it was lots of fun. I hope problem setters make more of this kind :)
 » 9 years ago, # |   0 Very interesting contest! Like Problem D in Div-2 the most! I always enjoy solving the problems that seem complicated and require the contestants to think in a clever way. BTW, can someone give me a hint for E in Div-2? It has puzzled me for a while.
 » 9 years ago, # |   +2 [Div2:B]After the contest, I suddenly tend to realize the importance of the constraint m < n/2, which ascertains the existence of a central junction which could be connected to all the remaining cities. My Question is: What if we relax the condition m < n/2. Let m be any number. For example (A test case): 6 7 1 3 1 4 1 5 2 6 3 4 3 5 4 5 Here there is no central junction but there is still a solution which is: 8 1 2 1 6 3 2 3 6 4 2 4 6 5 2 5 6 What would be the algorithm in this case?
•  » » 9 years ago, # ^ | ← Rev. 3 →   0 Sorry, that was a bad idea.If the solution exists, it would certainly be a complete bipartite graph, but I don't know the algorithm for dividing the vertices between the two sides.
 » 9 years ago, # |   0 hey well done guys, it was an interesting contest! the only thing i would like to suggest for future contests is that u increase the possibility of hacking by excluding a few corner cases (not all, mind you! :P ) from the pretests!!
 » 9 years ago, # |   +9 Could anyone please tell me why this code behaves differently on Codeforces and ideone (also my laptop, if that's a valid standard for anyone)? I get wrong answer on pretest 12, but it works correctly on the aforementioned platforms. Thank you in advance.
•  » » 9 years ago, # ^ |   +8 Visual Studio Debug Mode: Expression: map/set iterator not incrementable. You are removing some elements from the set in another level of recursion, and when you go back the iterator still points to the removed element.Check this code (same error): http://ideone.com/nzrPXb
•  » » » 9 years ago, # ^ |   +8 Thank you :)
 » 9 years ago, # |   -22 today's contest was a great contest, OMG!! um loving codeforces. Coderforces why you are so lovely and sweet?? :)
 » 9 years ago, # |   -24 codeforces i love you
•  » » 9 years ago, # ^ |   +22 Want to get minus? -_-
 » 9 years ago, # |   -24 codeforces is better than topcoder in all ways.. and its the best in the world
•  » » 9 years ago, # ^ |   -14 মাইনাস খাওার ভেরা উঠছে তর?
 » 9 years ago, # | ← Rev. 3 →   +3 I haven't see in the table submissions if they don't have AC. It's true only for div2 table viewing friends result
•  » » 9 years ago, # ^ |   -14 you better working on your grammar side.
•  » » » 9 years ago, # ^ | ← Rev. 2 →   0 You too.
 » 9 years ago, # |   0 Guys, thanks for this contest! Now waiting for tutorial)
 » 9 years ago, # |   0 Hey, that was a good contest. I regret missing it.By the way, in Div2 B the constraint m < n / 2 made it pretty simple.How would you solve it without this constraint?
 » 9 years ago, # |   +3 Some solutions to Div1-C work as follows: choose a random cycle on the N nodes and see if it works (some edges in the cycle may be invalid and we can ignore those).Why does this work? What's the worst case probability that a randomly chosen cycles isn't valid? One bad case seems to be when every node in the input graph has degree 2. In this case, every edge in our random cycle must be a valid edge.
•  » » 9 years ago, # ^ |   +10 This is one of the intended solutions -- we set the time limit so high that even python solutions will pass using this method.A rough approximation I used is by evaluating ((n — 2) / (n))**n. On n=100,000, it is 0.135. I think the actual number shouldn't differ too much from this (like how Derangement Probability does not differ too much from ((n-1)/n)**n).
 » 9 years ago, # |   +7 Nice (Ad-hoc) Contest. Tutorials please . :)
•  » » 9 years ago, # ^ |   +9 Here it is! http://codeforces.com/blog/entry/8417
 » 9 years ago, # |   0 Problem C:can anyone explain how the case no 10 can be purified ? , the answer that is given cannot purify cell no (5,7) & (5,8). my answer is -1 and it gave wrong ans. :(
•  » » 9 years ago, # ^ |   0 in edition according to editorial as it has 5th row and 8th column completely full with E it can't be purified , am i understood wrong? :( PS — it's test ( not pretest ) i am talking about.
•  » » » 9 years ago, # ^ |   +1 The correct answer of tenth test case is -1.So what goes wrong? It is YOUR code gives a solution, which is invalid, not jury's.
•  » » » » 9 years ago, # ^ | ← Rev. 5 →   0 sorry , i just wanted to know why wrong and not who's wrong ; and i believe jury's are much much better than me and i'm not being disrespectful; :) editorial says: "If there exist a row consisting of entirely "E" cells and a column consisting of entirely "E" cells, then the answer is -1. This is since the cell with that row and that column cannot be purifed." test 10 input: 17EE...E.EE.EE..E..E.....EE..E..E..EEEEE.EEEE..E..E.E.E.E.EEE.EEEEE...EEEEEEEEEEEEEEEEEEE.E.EEEEE.E.......E.EE.EEE.E....E.E..E..E...EE.E.EEEEE.EEE.E.EEEE.....E...EEEEEEE.E...E.E.EE..E.EE..E.E..E..E.EEE......E.....E..EEE.EE.EE.E...E.EEEE.EE....EEEEEEE.E..E.EEEEE.EEEEEE....E...EEEEEEE....EEEEthe 5th row and 8th column is entirely of Eso , why the answer is not -1 occured to me.hope i got a explanation not what's correct answer
•  » » » » » 9 years ago, # ^ |   0 The answer is -1, while your output is not.
•  » » » » » » 9 years ago, # ^ |   0 (sigh) it's the answer and i know that but how , please can u explain a bit elaborately :(
•  » » » » » » » 9 years ago, # ^ | ← Rev. 2 →   +26 But you have already explained it — as long as fifth row and eighth column both contain only 'E', answer is -1, because you can't purify (5, 8) anyhow. What else do you want to know further?Notice how judge's verdict is located:
•  » » » » » » » » 9 years ago, # ^ |   0 oops , got a bad eye , sorrry
•  » » » » » » » » » 9 years ago, # ^ |   0 This often happens with me XD
 » 8 years ago, # |   0 Div.1 Problem B: In the first sample, I can move 1 right — 4 up — 1 left without any battles. So why the answer is 3?