### dreamoon_love_AA's blog

By dreamoon_love_AA, 8 years ago,

Hello, everyone! Codeforces Round #292 will be held at Feb/17/2015 19:30 MSK. We're looking forward to your participation!

The problems are from dreamoon_love_AA, and thanks Shik for some discussion. Also we want to thank Zlobober for helping me prepare the round, AlexFetisov and winger for testing this round , Delinur for translating the statement into Russian, and MikeMirzayanov for Codeforces and Polygon.

This is first time I provide all problems for a Codeforces round. I hope you'll find it interesting! Please read all problem statements and discover what the main character drazil do in those problems for he's really cute =)

Finally, I would like to ask sorry_dreamoon to participate this round. I believe everyone have the same curiosity as me about your behavior in Dreamoon's round =) May I have the honor of inviting you?

Update1 : Because problems of this round are hard to determine their difficulty, We will use Dynamic score for this round. Then the order of problems is from easy to hard by sense of me and testers.

Update2 : Due to technical reasons we have to move round on five minutes.

Update3 : Congratulation to our winners:

Div 1:

Also, special congrats on rng_58, who solved problem E in Div.1, which anyone else could not solve.

Div 2:

Between them, EarthQuito is the only person who solve all problems!

• +1116

| Write comment?
 » 8 years ago, # |   0 I think it will be great, I agree with sorry_dreamoon :) Best regards.. Ibahadir Altun ..
 » 8 years ago, # |   +16 I have a little doubt, dreamoon_love_AA is man or woman? :)
•  » » 8 years ago, # ^ |   +12 Is it matter?
•  » » » 8 years ago, # ^ |   0 No, but it is a question that I have for some time
•  » » » » 8 years ago, # ^ |   -15 Ok, I don't know :)
•  » » » » 8 years ago, # ^ |   +17 RIP english
•  » » 8 years ago, # ^ |   +1 he's a man :D
•  » » » 8 years ago, # ^ |   -11 I know of course :)
•  » » » 8 years ago, # ^ |   +11 i'm you :D
•  » » » » 8 years ago, # ^ |   -11 Me too! Me too :D
•  » » » » » 8 years ago, # ^ |   +2 We are all mokhlesane jenabe Haghani
•  » » 8 years ago, # ^ |   +262 I'm man, definitely >_<
•  » » » 8 years ago, # ^ |   -49 Don't take it personal please.. I'm sorry, I definitely know that you are a man.
•  » » » 8 years ago, # ^ |   +3 ok , definitely resolved
•  » » » » 8 years ago, # ^ |   -14 Yeah, definitely :)
•  » » » 8 years ago, # ^ |   +79 So sorry_dreamoon definitely woman :P
•  » » » » 8 years ago, # ^ |   -31 Or definitely gay :P
•  » » » 8 years ago, # ^ |   +11 a cute man,definitely! ↖(^ω^)↗
 » 8 years ago, # | ← Rev. 2 →   +11 "[user:???] for translating the statement..." , I think you mean Delinurand please pin this post in CodeForces home page so everyone can see it :) fixed, thanks :)
 » 8 years ago, # |   +87 Please allow tourist to change his handle to sorry_sorry_dreamoon for this round .
•  » » 8 years ago, # ^ |   +49 Am I the only one who thinks tourist is sorry-dreamoon himself??
•  » » 8 years ago, # ^ | ← Rev. 2 →   +84 Plot twist: sorry_dreamoon is already touristEDIT: Damn, I was not first :(
•  » » » 8 years ago, # ^ |   +8 But sorry_dreamoon's solutions were written in Java .
•  » » » » 8 years ago, # ^ | ← Rev. 3 →   +12 Pretty sure that since tourist is rated 3200+ with C++ he would easily still be 2700+ with Java, even if he does not know the language quite as well.
•  » » » » 8 years ago, # ^ |   0 I don't think it's very difficult for toursit to write solutions in different languages. For example in standings, he wrote code in delphi, and won 3rd place in Div 1. I don't know delphi, but it looks like Java is much closer to c++ than delphi.
•  » » » » » 8 years ago, # ^ |   +34 Trust me, when shifting from C++ to Java, you'll encounter many (from a competitive point of view) stupidities and need to find out how to skip them.For example, suppose you want to debug and throw return 0; somewhere in the middle of your code. C++ has no complaints; in Java, it won't even compile! Because you can't have leftover code after returns.Pair? There's none, write your own. Map? Which map? There are about 3 types. Vector? Possible, but ArrayList is a new version of Vector. Forget about using [] in vectors (or arraylists), you need to use access/modify functions. Which arguments are passed to functions by reference? Not to mention having to throw some exceptions.A lot of these things make sense from a development point of view (the absence of a Pair class does not), but are unnecessary in contests and definitely take some time to learn. Nobody would chug out a working code in Java on the first attempt.Also, implying nobody but tourist can beat dreamoon_love_AA.
•  » » » » » » 8 years ago, # ^ |   +26 Hm it is interesting. Currently I use Java and am trying to switch to c++, and am having a lot of difficulty. Writing working code in c++ for me is very difficult. Just goes to show I guess that it depends on which language you learn first, since for me Java is far more intuitive.
•  » » » » » » 8 years ago, # ^ | ← Rev. 2 →   +13 I think Xellos is sorry_dreamoon ;)
•  » » » » » » » 8 years ago, # ^ |   +124 I think you're throwing random guesses.
•  » » » » » » » » 8 years ago, # ^ | ← Rev. 2 →   0 May be. Anyways, best of luck for this Div 1 contest. I hope u will participate ;) :)
•  » » » » » » » » » 8 years ago, # ^ |   0 He has aready said that he thinks that dreamoon_love_AA is better that him...
•  » » » » » » » 8 years ago, # ^ |   +21 That would be incredibly hilarious given that thread: http://codeforces.com/blog/entry/15336#comment-202627 :D
•  » » » » » » 8 years ago, # ^ |   +35 Just say "I don't know Java"
•  » » » » 8 years ago, # ^ |   +1 so sorry_dreamoon is already petr :P
•  » » » » 8 years ago, # ^ | ← Rev. 5 →   0 tourist can program in Java. you can see it in this link: http://codeforces.com/contest/482/submission/8394627Do you think: 1-what does tourist do during the contest? 2-why does he register but don't Participate? 3-why is he online now,if he don't want to Participate in this contest. understanding it is easy: if he copy his code that submited with sorry_dreamoon's profile and submited it in onother profile (tourist) everybody understand that tourist is already sorry_dreamoon so he have to program in Java and C++ and it is a hard work!
•  » » » » » 8 years ago, # ^ | ← Rev. 2 →   -6 of course sorry_dreamoon can program in C++ because he hack Mohamed.Bassem and randan's solution and both of them program in C++ but sorry_dreamoon program in Java! Who is sorry_dreamoon? it can Specified in the future for next contests... . ;)
•  » » » » » » 8 years ago, # ^ |   +1 you don't need to know other programming languages to hack solutions of different participants
•  » » » » » » » 8 years ago, # ^ |   0 you're right but for certain you must know other programming languages(of course if you have many time.)
 » 8 years ago, # | ← Rev. 2 →   +13 Petr possibly be sorry_dreamoon , the program in java .
•  » » 8 years ago, # ^ |   +25 You possibly be sorry_dreamoon , the program in java .
•  » » » 8 years ago, # ^ |   +14 very good joke , I have not the level to beat the dreamoon_love_AA , I hope someday JOINING to their level.
 » 8 years ago, # |   +9 I wonder how sorry_dreamoon feels when reading all those comments considering whether he is tourist or Petr :P. My contribution to that investigation is that we can clearly exclude all participants from here: http://codeforces.com/contest/498/standings :D.
•  » » 8 years ago, # ^ | ← Rev. 2 →   +5 You aren't there!
•  » » » 8 years ago, # ^ |   0 Hah, yes I'm not. I said that we can exclude guys participating in #284, but if you will read comments, especially that one: http://codeforces.com/blog/entry/15336#comment-202611 you will learn that I can be excluded as well :). And all polish guys in generality :P.
•  » » 8 years ago, # ^ |   0 I think we can narrow down the list of suspects to 5 after today's contest!!
•  » » 8 years ago, # ^ | ← Rev. 2 →   +6 It's definitely not Petr. I don't think he has the time to play games like this because of work + He never considers pure Div.2 rounds. I'm almost 100% sure that it's either tourist or YuukaKazami because though the code is in Java, their style is so damn similar (one letter variable names etc.)
•  » » » 8 years ago, # ^ |   +1 Yea.. True. Not only that, both of them keep braces for single line if/else statements. Both of them have a single space after ; in loops. Both have same spacing for braces in general, single space then a brace. The only difference one could spot is the newline spacing between different modules in the programs, tourist does not use spaces/newlines at all, whereas WJMZBMR uses a single line to separate out different sections of the program(similar to what sorry_dreamoon did).... :D
•  » » 8 years ago, # ^ |   +6 Why not Egor ?
•  » » 8 years ago, # ^ |   0 what about niyaznigmatul or Egor ? They are in a group of five people ( Petr, Egor, niyaznigmatul, Illyakor, mmaxio) from top 30 who use java . Illyakor and maxio participated in div1 284.
•  » » » 8 years ago, # ^ | ← Rev. 2 →   +14 If it is a group of five users from top 30, I think the score of Codeforces Round #284 (Div. 2) may be higher. I think two or three users will be possible.Because 3 minutes(147 seconds) for div2B and 3 minutes(183 seconds) for div2C(div1A) is an amazing speed for reading statements and coding if it is single!
•  » » 8 years ago, # ^ |   -8 Let's ask Mike about him and his IP address. And then ban him for using second account!
 » 8 years ago, # |   0 nice today!!!!
 » 8 years ago, # |   +13 Would love to see dreamoon_love_AA and sorry_dreamoon compete in the next Div 1 contest. Lets see if he manages to beat him in a Div 1 round.
 » 8 years ago, # |   +17 I'm dreamoon' for math!!
 » 8 years ago, # |   0 how it would have looked when dreamoon was blue,hosting a div1 contest!
•  » » 8 years ago, # ^ |   +101 Like this.
 » 8 years ago, # | ← Rev. 2 →   +49 How about dreamoon_fan? He (She) is 3rd place in the CF Round #284 (Div.2) :D
•  » » 8 years ago, # ^ |   +11 maybe dreamoon_fan is I_love_Tanya_Romanova :D
•  » » » 8 years ago, # ^ |   +9 I don't think so. I_love_Tanya_Romanova participated in 284 div 1.
•  » » » 8 years ago, # ^ |   +53 I guess everybody can distinguish my ugly style of code:)
•  » » » » 8 years ago, # ^ |   0 Oh, come on, I think whoever he is, he is smart enough to adopt different style of coding for his fake account.
•  » » » » » 8 years ago, # ^ |   +30 Something likeI'll just put a song at the top of my solution, and they will think that they know who I am...
 » 8 years ago, # |   +11 Am I the only one who thinks YuukaKazami is sorry_dreamoon? :P
•  » » 8 years ago, # ^ |   0 They use different languages.
•  » » » 8 years ago, # ^ |   0 Yes, but I recall YuukaKazami has made a few submissions in Java too. Anyway, it was just a guess :P
•  » » 8 years ago, # ^ | ← Rev. 2 →   +1 How about ivan.metelsky. Seems he also uses Java 7 constantly :)/feeling like a real stalker
•  » » » 8 years ago, # ^ |   +2 I don't think ivan.metelsky is that jobless :DSame goes for Petr and personally, I think tourist doesn't really care.
•  » » » » 8 years ago, # ^ |   +23 Please rethink about your comment it might hurt YuukaKazami.
•  » » 8 years ago, # ^ |   0 It is impossible. He has no time for this...
•  » » » 8 years ago, # ^ | ← Rev. 2 →   0 I see. Previously, this link used to exist. And YuukaKazami seemed to be a fun loving guy from the comments there. So, I won't find it surprising if YuukaKazami turned out to be sorry_dreamoon. But again, that is just a hunch because I am unable to think of any other top rated guy who would do this :D
•  » » » » 8 years ago, # ^ |   +8 imho cgy4ever
•  » » » » » 8 years ago, # ^ |   0 You are right, even that is probable :)Oh well, sorry_dreamoon will not reveal himself unless MikeMirzayanov agrees to not block him for multi-accounting, which he won't. So, we are supposed to just keep guessing :P
•  » » » » 8 years ago, # ^ |   +13 Tonight YuukaKazami cgy4ever tourist I_love_Tanya_Romanova all registered div1.
•  » » » » » 8 years ago, # ^ |   +9 I think sorry_dreamoon is a team
•  » » » » » 8 years ago, # ^ |   +9 Only 1 participated :P
•  » » » » » 8 years ago, # ^ | ← Rev. 2 →   +7 Writing solutions in Java and then rewriting them in C++ was really hard...Jokes apart, it is an honor for me to see my nickname in this list along with such skilled competitors as YuukaKazami, cgy4ever, and tourist :)
•  » » » » » » 8 years ago, # ^ |   0 You are a skilled competitors too! You solved 3700+ problems in Codeforces and participate in 122 contests so that you are an experienced competitor. Your rating can show that you are one of top competitors.Therefore, you are a skilled competitor.
•  » » 8 years ago, # ^ | ← Rev. 2 →   +8 I'm pretty sure that sorry_dreamoon is Xellos. Or someone really close to him.
•  » » » 8 years ago, # ^ | ← Rev. 2 →   +34 But Xellos doesn't write neat code!I should prepare to get bashed by Xellos :D
•  » » » » 8 years ago, # ^ |   0 Yeah, it seems I am wrong, but still who khows :D
•  » » » » 8 years ago, # ^ |   +61 Don't worry, he'll just post some image.
•  » » » » » 8 years ago, # ^ |   +53 I don't have an on-topic one, so here's something random:
•  » » » » 8 years ago, # ^ |   +3
•  » » » » 8 years ago, # ^ | ← Rev. 2 →   0 What, it's just a few cases. What's so hard about copy-pasting and manually editing stuff? :D (Although I had to admit I took a huge gamble with that code.)UPD: Hmm, it's a 1000 point problem... so maybe it's not the one I thought it was when seeing the casework.
•  » » » » » 8 years ago, # ^ |   0 So you don't deny that sorry_dreamoon is your account? :D
•  » » » » » » 8 years ago, # ^ | ← Rev. 2 →   +5 I never did before. Well, not that I don't like to mislead, but no, it's not my account.I can't beat dreamoon_love_AA in Java, anyway.
•  » » » 8 years ago, # ^ |   +8 I don't think so. Based on rating, dreamoon_love_AA is better than Xellos. And sorry_dreamoon was very confident that he can beat dreamoon_love_AA (based on account name + comment on CF).
•  » » 8 years ago, # ^ |   +118 Not me >_>, I have already been banned once as I create multi-account to win a Div 1 Contest...
»
8 years ago, # |
-65

Hi!

I can't solve this зproblem. My code:

# include

using namespace std;

int main() { int a, b; cin >> a >> b; int ans = 0; for (int i = 0; i < a; i++) ans++; for (int i = 0; i < b; i++) ans++; cout << ans << endl; return 0; } Please help

•  » » 8 years ago, # ^ |   +69 holy mother of formatting.
•  » » 8 years ago, # ^ | ← Rev. 2 →   +22 This type of code (and God bless that styling) is one of the reasons robots + computers are going to declare war against human being someday.P.S: If it was a joke, please accept my haha.
 » 8 years ago, # |   +22 Tomorrow night is Chinese Spring Festival's Eve, which is the most important festival to Chinese people, just like Christmas Day to western people. The Chinese year of the Sheep (or goat || ram || lamb?..) is coming, I want to say "Happy Spring Festival" to every friend on Codeforces!
•  » » 8 years ago, # ^ |   +4 Wish you a happy Spring Festival :D
•  » » » 8 years ago, # ^ |   0 Thanks ;-)
•  » » 8 years ago, # ^ |   +8 Happy Spring Festival...I think many Chinese students are busy preparing for tomorrow's big dinner and visiting their relatives, so the number of contestants decrease a lot.
•  » » 8 years ago, # ^ |   +5 Wish everyone a happy Lunar New Year!
•  » » 8 years ago, # ^ |   +12 It is my first Spring Festival's Eve with coding~~~ Amazing night!
•  » » 8 years ago, # ^ |   +2 Happy Spring Festival!
•  » » 8 years ago, # ^ |   0 Happy Spring Festival
 » 8 years ago, # |   +3 My first DIV1 contest, look like it would be a severe fight for me tonight.
 » 8 years ago, # |   +26 Wish score distribution won't be DYNAMIC...
•  » » 8 years ago, # ^ |   +8 ...and the scoring is dynamic, just as we all had not hoped D:Because problems of this round are hard to determine their difficulty, We will use Dynamic score for this round. Then the order of problems is from easy to hard by sense of me and testers.
 » 8 years ago, # |   +1 GL & HF to everybody!
 » 8 years ago, # | ← Rev. 4 →   -37 its dreamoon_love_AA VS sorry_dreamoon Again :p
•  » » 8 years ago, # ^ |   0 You should change the names on the back of the clothes~
 » 8 years ago, # |   +6 3 hours before contest, good luck everybody, I'm definintely gonna be green after contest ends
 » 8 years ago, # | ← Rev. 3 →   0 Does peter50216 have any CF account?Update: Oops, he is peter50216 on CF, I didn't know that.
 » 8 years ago, # | ← Rev. 2 →   -11 deleted
•  » » 8 years ago, # ^ |   +14 too soon. No I seriously mean it, it's too soon.
 » 8 years ago, # | ← Rev. 2 →   +7 It will be amazing to see if dreamoon_fan participates or not :D
 » 8 years ago, # |   -7 hoping to get good rank in my 100th contest :)
 » 8 years ago, # | ← Rev. 3 →   0 Thank everyone this round was very interesting!!!
 » 8 years ago, # |   +14 Can you tell me what is the difference between dynamic scoring and the usual scoring, please? I'm sorry if you find my question stupid :)
•  » » 8 years ago, # ^ |   +12 you can check this out :Dynamic Score
•  » » » 8 years ago, # ^ |   +3 Got it, thanks!
•  » » 8 years ago, # ^ |   +11 I guess it means the score of problems is determined by the amount of participants who solved this problem
•  » » » 8 years ago, # ^ |   0 Yep, you are right!
 » 8 years ago, # | ← Rev. 2 →   +6 do you know what's the meaning of Dynamic score for me ??? yep you are right Div_2 again :D
 » 8 years ago, # |   -8 There's only one way to find out who sorry_dreamoon is and this will work only if he is not very careful. Someone who works at Codeforces can determine the IP address from where he is logging in and compare it with the IP addresses of all other users. By this comparison, we will either get one particular user who always logs in from the same IP address or we might get a few users who log in from the same IP address (maybe behind a university proxy?). Hopefully, there won't be many International Grandmasters in the list.This will work only if sorry_dreamoon is not very careful and doesn't use proxy servers (or Tor) to be anonymous on the internet (at least while logging into Codeforces with that handle).
•  » » 8 years ago, # ^ |   +48 may be MikeMirzayanov is sorry_dreamoon :)
 » 8 years ago, # | ← Rev. 2 →   0 Why does Div. 1 start 5 minutes later?UPD: Oh! Div. 2 also moved by 5 minutes.
 » 8 years ago, # |   0 Thank you very much!P.S. I just want +331 too =)
 » 8 years ago, # |   +6 I hope the 5 minute extend will be the only technical problem today, dreamoon_love_AA is an awesome coder and I hope we will be able to enjoy his problems without any difficulties :)
 » 8 years ago, # |   0 The comment removed because of Codeforces rules violation
 » 8 years ago, # |   +29 I think sorry_dreamoon is one of the ITMO guy (by looking at his style of code) and my wild guesses are mmaxio or qwerty787788
•  » » 8 years ago, # ^ | ← Rev. 2 →   +29 Yeah even I guess that it could be more of a chance being qwerty787788 looking into the style of his code, even now he didn't attend today's srm and was just active 4 hours ago and the style of his coding looks way similar and yeah he didn't attend srm 284 and was regular for all other srms other than 284 , so chance of sorry_dreamoon being qwerty787788 is high :D :D :D
 » 8 years ago, # |   +14 It would have been fun to the characters of the problems were dreamoon_love_AA and sorry_dreamoon
 » 8 years ago, # | ← Rev. 2 →   +14 Guys, ABHISHEK004 and pranjuldb are cheaters. They are from my room. I want you to take a look at their submissions for A after the contest!
 » 8 years ago, # |   +6 It's time to back to the old color.
 » 8 years ago, # | ← Rev. 3 →   +34 I think Haghani should change his handle to sorry_(sorry_dreamoon) :)
•  » » 8 years ago, # ^ | ← Rev. 4 →   0 may be not :D UPD: maybe yes :| 
 » 8 years ago, # |   0 What is wrong with pretest #1 on problem B div2? I can't believe my solution didn't pass it.
•  » » 8 years ago, # ^ |   0 Pretest #1 is the sample, the one which is in the task description
•  » » » 8 years ago, # ^ |   0 That's why I'm asking. My solution passed all sample tests on my computer. It's very strange...
•  » » » » 8 years ago, # ^ |   0 Maybe you used freopen or ifstream or you read from some files(most of coders use input and output files and than, when they submit, erase that part of program)Anyway, it could be also something like you used dome variables which weren't defined.I can't view your source yet.
•  » » » » 8 years ago, # ^ |   0
•  » » » » » 8 years ago, # ^ |   +1 Use "Custom invocation".
•  » » » » » 8 years ago, # ^ |   0 I don't know what to say.The only strange thing is taht you used reserve with n and m.I think it would be better to use sample vectors or to reserve something like n + 10
•  » » » » » » 8 years ago, # ^ | ← Rev. 2 →   0 The problem was that reserve() leaves the vector uninitialized. I should have used resize() which sets all values to 0. D'oh :-(.
 » 8 years ago, # |   0 what was the hacking test case for C(div2)/A(div1) ?
•  » » 8 years ago, # ^ | ← Rev. 2 →   +1 19Answer is 7332
•  » » » 8 years ago, # ^ |   0 I've hacked 2 solutions with 1 9, but my solution is wrong too((((
•  » » » » 8 years ago, # ^ | ← Rev. 2 →   0 I just missed your code. Was looking for this mistake, don't know how I overlooked it. I missed your A also. Hacked Thandkou's code for the same mistake. Shit.
•  » » » » » 8 years ago, # ^ | ← Rev. 2 →   0 What is the mistake? I mean, what did those people miss so their solutions can't pass this test?Maybe my last post as a purple coder this week :D
•  » » » » » » 8 years ago, # ^ |   0 In DIV 2 A they were checking (a + b) % 2 = s % 2 where a and b can be less than 0. In C they missed 9 case.
•  » » » » » » » 8 years ago, # ^ |   0 I don't know what I missed in B. WA on test 41 :(
•  » » » » » » » » 8 years ago, # ^ |   0 ashish1610 u hacked two div1A problem just 2-3 seconds before I could hack it.
•  » » » 8 years ago, # ^ |   0 what's the answer ?
•  » » » » 8 years ago, # ^ |   0 7332
•  » » 8 years ago, # ^ |   +1 Mostly just 4, 6, 8, and 9, in case people aren't careful enough with which digits should replace them. (4 is replaced by 322; 6 is replaced by 53; 8 is replaced by 7222; 9 is replaced by 7332. I think most people missed the 9 case.)
•  » » » 8 years ago, # ^ |   0 and you're right, sir! ;-(
•  » » » 8 years ago, # ^ |   0 most people missed the '9' case because it was hard to calculate out :(anyway problem set was great
 » 8 years ago, # |   +8 Good bye Div-1!
•  » » 8 years ago, # ^ |   0 You're not alone
•  » » » 8 years ago, # ^ |   0 Guys, can I join you, please? :D
•  » » » » 8 years ago, # ^ |   +6 No, you couldn't :P
•  » » » » » 8 years ago, # ^ |   +1 Hahahahah, what a luck!!! :DHowever, I think it is better for me to be Div2 until I become able to solve almost every Div2 D problem...
•  » » » » 8 years ago, # ^ |   +7 1700.... it's your fate not to join us... Deal with it!)
 » 8 years ago, # |   +12 sorry_dreamoon is no.1 in Div1!
•  » » 8 years ago, # ^ | ← Rev. 2 →   +1 I think he/she can pass system test safely!UPD: although he/she pass system test... It is surprising that so many FST on B, therefore, the score of B level up from 500 to 1000~~~ rank change!
•  » » 8 years ago, # ^ |   +6 Maybe he really is the Petr...
 » 8 years ago, # |   +2 My life is ruined. I took less number of days in problem B of div2. Was hoping to become candidate master. But now my rating will fall. :(
•  » » 8 years ago, # ^ |   0 Same here. Worst performance ever!
•  » » 8 years ago, # ^ |   0 Me too, I only calculate n*m days
 » 8 years ago, # |   0 Was D div 2 a bipartite matching problem?
•  » » 8 years ago, # ^ |   0 The constraint leads to topological sort, I guess.
•  » » 8 years ago, # ^ |   0 I don't think so.That's why they want to know if the solution is unique.If you used bipartite matching, it would took too much, and also, you are unable to see the uniqueness.
•  » » 8 years ago, # ^ |   +9 No! It could (hopefully, of course) be done greedily. If there is a free cell that is not adjacent to any other free cell, it cannot be done; If there is a free cell adjacent to exactly one free cell, we must place a domino on these two cells; If each free cell is adjacent to more than one free cell, then we can immediately stop (say there is exactly one correct tiling; of course no two dominoes can share a long edge, and it can be proven that there is a cycle in which consecutive dominoes touch each other, for example: <><>* ^**<> v***^ <><>v and then you can flip all these dominoes "one forward": ^<>^* v**v^ ^***v v<><> giving another good configuration).
•  » » » 8 years ago, # ^ | ← Rev. 5 →   0 This greedy in my implementation was hacked.UPD: I've got TLE with using set of free cells. Maybe there is way to know whether exists cell with single free cell nearby itself without setUPD: Using set of pairs was so lame idea. I've got AC using queue. Thanks to mnbvmar
•  » » » » 8 years ago, # ^ |   0 Your code is wrong then. I implemented the same algo and passed system test.
•  » » » » 8 years ago, # ^ | ← Rev. 3 →   +1 My code got Accepted. Maybe it was too slow (now I see some people getting TLE) or didn't consider some cases?// Edit: balalaika: you can use a queue/stack/whatever. When you take an element from such structure, we just check whether we haven't processed it before. It is conceptually similar to a priority queue-based implementation of Dijkstra's algorithm.
•  » » » » » 8 years ago, # ^ |   0 I used the same idea, I had luck , because my code passed in 1.996 seconds I use a priority_queue<> how implement with a queue or similar structure for avoid insert and delete operation in o(logn) my solution is O(n^2 * logn) I want implement O(n^2)
•  » » » » » » 8 years ago, # ^ |   0 Use queue of coords. Firstly push into queue all cells adjacent to exactly one free cell. Then while queue non-empty, you update table and if after that you've got another cell adjacent to exactly one free cell then you push this cell into queue.If queue is empty and you still have free cells then output "Not unique"Since queue::push() and queue::pop() perfomance for O(1) and each cell can be pushed no more than once you've got implement O(nm)
•  » » » » » » » 8 years ago, # ^ |   0 thank you !! that was overkill
 » 8 years ago, # |   +8 Has anybody solved D faster than O(N * Q * log(n))?
•  » » 8 years ago, # ^ | ← Rev. 2 →   +25 dreamoon_love_AA and me =)It is possible to solve this task in O(qnα(n) + nlogn).
•  » » » 8 years ago, # ^ |   +10 +1.
 » 8 years ago, # | ← Rev. 2 →   0 It seems that sorry_dreamoon's identification will remain a mystery
 » 8 years ago, # |   0 Problems were so so nice, that I was very upset then contest ended :(
 » 8 years ago, # |   +5 sorry_dreamoon became 1st again!!!
•  » » 8 years ago, # ^ |   +8 He is so confident that... Is he a tourist ?
•  » » 8 years ago, # ^ |   0 i'm so sorry man....
•  » » 8 years ago, # ^ |   0 2nd again= =... because of so many FST for B... the score of B change from 500 to 1000...
 » 8 years ago, # |   +19 Only champions league can make me happy after such a lose :(
•  » » 8 years ago, # ^ |   +5 In time zone of GMT +8, the game start at 3:45 am :( sleepless night again
•  » » » 8 years ago, # ^ |   0 Same here, but still not so bad as yours. GMT +5
 » 8 years ago, # |   0 I solved 3 problems in div2.. My best record :>of course, if I pass system test..
 » 8 years ago, # |   0 For Div2 participants, this round was a super hack round!!! Problem C was easy to hack!!
 » 8 years ago, # | ← Rev. 3 →   +9 sorry_dreamoon : Petr or mmaxio or ilyakor or qwerty787788 or RussiaMustDie who in top 100 and didnt participant #292 and coding java
•  » » 8 years ago, # ^ |   +5 Yeah even I guess that it could be more of a chance being qwerty787788 looking into the style of his code, even now he didn't attend today's srm and was just active 4 hours ago and the style of his coding looks way similar and yeah he didn't attend srm 284 and was regular for all other srms other than 284 , so chance of sorry_dreamoon being qwerty787788 is high :D :D :D
•  » » 8 years ago, # ^ |   0 and I think we can rule out Petr and RussiaMustDie the rest were active today :D
•  » » 8 years ago, # ^ |   0 i think mmaxio
•  » » 8 years ago, # ^ |   +1 mmaxio and ilyakor participated in #284.
•  » » » 8 years ago, # ^ |   +13 so then my guess is almost getting right it could be qwerty787788 :D :D
•  » » » 8 years ago, # ^ |   0 wow nice
•  » » 8 years ago, # ^ |   +1 You forgot Egor.
•  » » 8 years ago, # ^ |   0 or he is touristHe can code in java tooand He is good enough to beat dreamoon_love_AA
 » 8 years ago, # | ← Rev. 2 →   +1 The problem C (div.2) is excellent! Very interesting and pleasure:) Thank you very much!
 » 8 years ago, # |   0 Div1 B must have been quite tricky...I think over a third of people submitted and failed system test on it.
 » 8 years ago, # |   +1 Put the top 5 people in the announcement please :D
 » 8 years ago, # |   +131 Now we know its not tourist. cause he is not first. :P
 » 8 years ago, # |   0 I failed the system test of problem B in div2... What is the approach like?
•  » » 8 years ago, # ^ |   0 You need to traverse for some more no. of days.Traversing till n*m fails,but 2*n*m passes. It is possible that a girl becomes happy for some i~=m*n and then makes a boy happy sometime afterwards.
•  » » » 8 years ago, # ^ |   +1 Does 2*n*m passes guarantee that it will have correct result?
•  » » » » 8 years ago, # ^ |   +1 I don't have the proof,can someone else help out?
•  » » » » » 8 years ago, # ^ |   0 running till (max(n,m))^2 days worked for me...
•  » » » » » 8 years ago, # ^ |   +1 the value is (n+m-1)*n*m. the proof is pretty forward. for functions b(i)=i%n and g(i)=i%m, you have to loop n*m for all possible combinations of b(i) and g(i); as b(i+n*m)= (i+n*m)%n =i%m=b(i) and g(i+n*m)=(i+n*m)%m=i%m=g(i). Now If all combinations of b(i) and g(i) happens without a change in the state (happiness) then terminate. so worst case : 1 of n+m must change to happiness. assuming only 1 is happy at start, and is spreading to only 1 at a time of all possible combinations, so we need (n+m-1)*n*m .
•  » » » » 8 years ago, # ^ |   0 I think that just n*m + max(n, m) would be enough. I don't think I have a formal proof, but I tried it here, and it can be seen passing 41st and 43rd test, which were problematic: 9907232
•  » » » » 8 years ago, # ^ |   +1 Only guarantee is n*m*(n+m). No less is a guarantee.
 » 8 years ago, # |   +58 I will never use cin&cout without ios_base::sync_with_stdio(0);I will never use cin&cout without ios_base::sync_with_stdio(0);I will never use cin&cout without ios_base::sync_with_stdio(0);I will never use cin&cout without ios_base::sync_with_stdio(0);I will never use cin&cout without ios_base::sync_with_stdio(0);
•  » » 8 years ago, # ^ |   0 You can submit with MS C++ without ios_base::sync_with_stdio(0)
 » 8 years ago, # |   +3 Oh sorry_dreamoon is 2nd in final result..! Because of Dynamic scoring, A problem's score is changed...
•  » » 8 years ago, # ^ |   +1 Too many people failed in problem B so it changed from 500pts to 1000pts...What a sad story
 » 8 years ago, # |   +29 dynamic score just to make sure sorry_dreamoon doesn't win the round
 » 8 years ago, # |   0 Why isn't that enough to check up to lcm(n,m) in the div2 problem B?I saw a lot people solved the problem just by randomly picking large numbers like 1e6 or 1e7 etc. Why is that so?
•  » » 8 years ago, # ^ |   +1 Because it's easier to throw a big number that doesn't exceed the time limit than thinking about the exact upper limit.
•  » » 8 years ago, # ^ |   0 should be 2*lcm(n,m)...
•  » » » 8 years ago, # ^ | ← Rev. 2 →   +1 Can it be lcm(n,m)+max(n,m)?Upd : It must be max, not min. Thanks for pointing it out.
•  » » » » 8 years ago, # ^ |   +1 tested on some cases, should be lcm(m,n) + max(m,n)...
 » 8 years ago, # |   -9 firstly congrats to haghani secondly it will be a nice revenge if you change your handle to sorry_sorry_dreamoon :)
 » 8 years ago, # |   +37 Ooops... Seems like our little kid (Haghani) beated sorry_dreamoon ... !!
 » 8 years ago, # | ← Rev. 5 →   0 why did one of my solutions skipped during evaluation?
•  » » 8 years ago, # ^ |   0 Two reasons — 1- You did your coding in online ide and setting was public 2- You solve the problem as a team and somebody have same code as yours.
•  » » 8 years ago, # ^ |   0 may be you re-submitted the solution or submitted from another account before this.
 » 8 years ago, # |   +9 Finally,sorry_dreamoon is beated by dynamic score.....
 » 8 years ago, # |   0 Again I failed a problem (C) because of not declaring the array large enough, I though I was over with this kind of mistakes :(
 » 8 years ago, # |   +13 If it weren't for bugs in my library I would have been probably 16th and IGM ;__; (didn't manage to debug it during contest in D, already got it ACed, needed sth like 15 mins more).
•  » » 8 years ago, # ^ | ← Rev. 2 →   +9 This is the first time I see such code.. Could you share what that is? Is it centroid decomposition? Googling for "FastrigateTree" yields no result :(
•  » » » 8 years ago, # ^ |   +8 Hahaha, there is no such word as "fastrigate" :D. Few professors on UW used word "fastryga" for doing some easy searches of a tree during first semesters of our studies. That is very weird polish word, I don't even know what this means and not many people know (and it's nothing related to trees or algorithms) and since I maintain my library in English I created a verb "fastrigate" for doing all standard things on trees which came to my mind :). That includes finding a diameter and its middle-edge which was useful here (but can be done in a significantly easier way than in my code, because I do many other things there).
 » 8 years ago, # |   0 Can we solve problem B div2 using graphs.I tried solving it by naming nodes from 0 to n-1 and n to n+m-1, then established an undirected edge between all nodes that can possibly meet on same day.Then for all nodes that have initial happy value 1, I start a dfs and make happy values of all nodes that can be reached 1.But my solution failed system tests.Can somebody tell any flaw in this strategy?Please see my code for details.
•  » » 8 years ago, # ^ |   0 for(i=0; i
•  » » » 8 years ago, # ^ |   0 Ahh..That's stupid of me.What was i thinking.Changing j<(i+m) to j<100*(i+m) gets AC.Anyway, thanks.
•  » » 8 years ago, # ^ |   0 The idea is correct — I solved it using this way.Solution link
 » 8 years ago, # | ← Rev. 2 →   +23 Luckily became GrandMaster....Thanks all!!!
 » 8 years ago, # |   0 How to solve Div1 B ? Please help .. i thought about it a lot during the contest but not able to come up with an idea to solve this one.
•  » » 8 years ago, # ^ |   0 If you have an empty cell that has only one empty cell near it, then you are 'forced' to put a 1x2 tile there. Do this for all force cells (And look if new forced cells appear after, and put them as well). If after doing this process there are still empty cells, then there are multiple solutions.
•  » » » 8 years ago, # ^ |   0 firstly, we fill the forced cell. It may happen new forced cells are generated. right ? Then, we will again fill those cells. Then, no new force cells will be generated. why is it so ?
•  » » » » 8 years ago, # ^ |   0 No, after a while of doing that process there will be no more forces cells. (You keep putting the forces cells and putting the new ones in a queue).
 » 8 years ago, # |   0 My above code is generating correct answer on my system for given test case but its showing wrong here Plz help??
•  » » 8 years ago, # ^ |   0 In the '9' case you are adding two sevens.
•  » » » 8 years ago, # ^ |   0 I have to add two sevens , in that test case one seven will come from 8 right??
•  » » » » 8 years ago, # ^ | ← Rev. 2 →   0 9! = 72 * 7! = 6 * 6 * 2 * 7! = 3! * 3! * 2! * 7!
•  » » 8 years ago, # ^ |   +48
•  » » 8 years ago, # ^ |   0 in the case of '9' you just need a line ofarr[index++] = 7;
 » 8 years ago, # |   +41 in problem div1 C: Drazil is a monkey. He lives in a circular park. There are n trees around the park. am I the only one who first thought that it means trees which are special kind of graphs not the trees in our normal life? , funny how my default way in understanding the word "tree" became the trees which are special kind of graphs
 » 8 years ago, # | ← Rev. 3 →   +97
•  » » 8 years ago, # ^ |   +66 At least my rank was palindrome. -_-
•  » » » 8 years ago, # ^ |   -14 2200 is not palindrome! 2112 is.
•  » » » » 8 years ago, # ^ |   +26 assert(rank != rating);
•  » » » » » 8 years ago, # ^ |   +21 I can never distinguish between these two! Excuse me :D
 » 8 years ago, # |   0 I swear I will be in the top 5 one day QAQ.
 » 8 years ago, # |   +1 Where Is Rating?Everyone Feel bore.Follow Topcoder.
•  » » 8 years ago, # ^ |   +1 Contest 2 hours.1 hour system test + 2 hours update rating.
 » 8 years ago, # |   0 Can someone please tell me what's wrong with this solution of Div 2 B.I am getting wrong answer on 5th test.
•  » » 8 years ago, # ^ |   +1 In the for loop boy[temp]=1;
•  » » 8 years ago, # ^ | ← Rev. 2 →   +1 boy[i]=1;girl[i]=1; You should use temp, not i
•  » » » 8 years ago, # ^ |   +3 Thanks
 » 8 years ago, # |   +6 This is the first comment ever to break barrier of 500 upvotes and it already broke barrier of 800 http://codeforces.com/blog/entry/16446#comment-213065 :o!
•  » » 8 years ago, # ^ |   +24 You are wrong about first comment ever — this one got +500 few weeks ago.What an irony... This is how it looks — dreamoon_love_AA gets huge number of upvotes for his round announcement, and then sorry_dreamoon is just doing that sorry, dreamoon_love_AA... stuff once again — now by getting more upvotes for his comment than dreamoon_love_AA for announcement :)
•  » » » 8 years ago, # ^ |   +3 Oh, you're right. So it was first one to break (1000000000)2 barrier :D
•  » » 8 years ago, # ^ |   +2 so sad that he/she got that number of upvotes in his/her fake account not the real one :P
 » 8 years ago, # | ← Rev. 2 →   +11 So, here is my story: My solution for Div.1-B failed system testing — TLE on test 15, if I'm not mistaken. After contest I took my java code, changed Points to pair's, changed queue to C++'s, submitted — and got AC. So the question is — do I need to forget about using Java in competitions? UPD: To compare: C++ — 9905626 and Java — 9896943.
•  » » 8 years ago, # ^ | ← Rev. 2 →   0 На создание объектов в Java уходит больше времени, чем на создание записей в C++. Особенно это заметно когда создается много объектов.
•  » » 8 years ago, # ^ |   0 You just need to adapt by using as few objects as possible. For example, instead of Queue.add(new Point(x, y)) use Queue.add(x); Queue.add(y);.
•  » » » 8 years ago, # ^ |   0 PlayLikeNeverB4, As far as I know Java, the way you said to it, each time x and y will be wrapped into two Integer objects, cause you cannot make a generic queue with primitives. Enavik, Of course it takes more time to create objects in Java, but for this purpose TL for Java is twice the TL for C++. The thing is that I always thought that Codeforces is such a website, where I don't need to worry about small optimizations when my solution is correct... And I think that for this problem TL was really too strict — a lot of solutions failed systests due to TLE.
•  » » » » 8 years ago, # ^ |   0 Another thing is to use arrays. When you have an array (or queue) of pairs, just use int[N][2]. You can even sort them if you want.I used to have problems in the past because of the language, but that thought me to be more careful. When it's an important competition I stick to C++ though :)
•  » » » » » 8 years ago, # ^ |   0 Use EZ Collections!
•  » » » » 8 years ago, # ^ |   0 r this purpose TL for Java is twice the TL for C++. Sure?
 » 8 years ago, # |   +1 When will the editorial be put up?
 » 8 years ago, # |   +9 longer than 100 minutes and I 'm waiting for my rating updated -.-
 » 8 years ago, # |   +18 Good luck to tourist with reading his PMs, I guess there will be a lot of questions like "Are you sorry_dreamoon, plese tell me, I won't tell anyone else :)" :D :D :D
 » 8 years ago, # |   +68 sorry_dreamoon writes jokes in the head of each submission... 9885853 9893183 9895490 9898972
•  » » 8 years ago, # ^ |   0 First one of the jokes is very funny :D
•  » » 8 years ago, # ^ | ← Rev. 2 →   0 Sees the last one... Immediate Persona and League of Legends flashbacks. Them puns.
 » 8 years ago, # |   0 Nice contest, nice problems. Hacked for the first time in my life :)
 » 8 years ago, # |   +13 I think Div2 ranks are lost :D lets repeat the contest
 » 8 years ago, # | ← Rev. 2 →   +2 Thanks dreamoon_love_AA for nice contest I enjoyed the contest and most important thing that I gained +228 :D
 » 8 years ago, # |   0 I really enjoyed the contest today and reached Div1 again :)
 » 8 years ago, # | ← Rev. 2 →   0 Can someone explain me why in the final standings my rank is 340 but after the rating update it changed to 626? It's not even close to 340 :( Thanks!Edit: Nevermind, the issue was solved!
 » 8 years ago, # |   0 In problem A, if you print "yes" in case of "Yes" will it be accepted or not?? Somebody wrote "yes" and he got it accepted??
•  » » 8 years ago, # ^ |   +26 Why ask when you already know the answer? :)
 » 8 years ago, # |   0 I enjoyed participating a lot. However my submissions were judged incorrectly in pre-testing phase itself.See here: 9902412 9902094Can anyone tell me why this unexpected behavior occurred?How do I contact the organizers for correction?
•  » » 8 years ago, # ^ |   0 It' my mistake :'( You should get some message like "your output may contain invalid character". But When I write checker, I will output this message when read invalid character.you should not add '\0' to string.