### NALP's blog

By NALP, 8 years ago, translation,

Hi!

A few hours later you're lucky to participate in Codeforces Round #147 for Div.2 participants, but traditionally the others can take part out of the competition. It has been prepared by me (NALP), Igor Kudryashov (KudryashovIA), Pavlik Holkin (HolkinPV), Gerald Agapov (Gerald), Mary Belova (Delinur) and Mike Mirzayanov (MikeMirzayanov).

Traditionally I wish good luck, accepted solutions and successful hacking attempts for you!

The standart scoring system will be used: 500-1000-1500-2000-2500

UPD: The contest has ended, congratulations to the winners:

• +92

 » 8 years ago, # |   -16 :-W
 » 8 years ago, # | ← Rev. 3 →   +3 Gerald always gives a hand to prepare the problems in recent contests :D
 » 8 years ago, # | ← Rev. 3 →   +60 sorry for posting here but,My contribution is -69,I do not know what to do :(
•  » » 8 years ago, # ^ |   +8 Just be yourself, dude. Don't get upset about any negative numbers :)
•  » » 8 years ago, # ^ |   +63 choose picture of a pretty girl for your account !
•  » » » 8 years ago, # ^ |   0 And why don't you do so?
•  » » » » 8 years ago, # ^ |   +23 cause i don't care .
•  » » 8 years ago, # ^ |   +3 Rejoice?
•  » » 8 years ago, # ^ |   +1 Oh, Poor man, No one can stop me click +1 。。
 » 8 years ago, # |   +4 Have a good contest everyone! :)
 » 8 years ago, # |   +5 What advantages does the stardand scoring system have over the dynamic one?
•  » » 8 years ago, # ^ |   +8 I prefer dynamic one :D
 » 8 years ago, # | ← Rev. 2 →   +9 seems, there is huge change for me to be hacked today.... :P
•  » » 8 years ago, # ^ |   +1 I want to be in your room in this case.
•  » » » 8 years ago, # ^ |   0 yes..... after a long time.... none of my solution (A, C) hacked.... :D
•  » » » » 8 years ago, # ^ |   0 Expert :P
•  » » 8 years ago, # ^ |   0 Me too, so we can hack each other :) Let hack and find who is the better =]]
 » 8 years ago, # |   +11 Thanks for the good contest
 » 8 years ago, # | ← Rev. 2 →   0 check out my output here http://ideone.com/aCIGH7when i run it as a custom test here i get this output instead 6 2 2 1 1 3 1 1 2 1 2 1 3 1 1 2 1 1 3 2 2 2 1 3 1 if I change the 2d arrays to maps instead i get the desired output. Any idea why this happens?
•  » » 8 years ago, # ^ |   0 array nums is very small. we can have up to 2500 numbers.
•  » » » 8 years ago, # ^ |   0 fine i understand that it will get a runtime error, but for the given inputwhich is 3 3 2 1 4 3 5 6 1 2 isnt it supposed to work and produce the correct answer (like on ideone)?
 » 8 years ago, # |   +22 Wow , very fast judging :D
 » 8 years ago, # |   +12 System test is really fast !!!
•  » » 8 years ago, # ^ |   +6 But rating update so slow!!!
 » 8 years ago, # |   +13 Wow, what a fast judge!
 » 8 years ago, # |   +35 Really enjoyed the contest. And it also helped me identify a bug in our ACM team's notebook. Many thanks to the author :D
 » 8 years ago, # |   +8 i am from China i am sorry i can't use English well i only wrote A problem and C problem The B problem can make a right answer and check with read by computer i don‘t know how to do D AND E who can help me
•  » » 8 years ago, # ^ |   +4 Problem D was difficult to understand even for those who know English. Can someone explain Problem D with an example.
•  » » » 8 years ago, # ^ |   0 I think the question had it well explained. The reason for not putting a bit complicated example is that it would be too easy to guess the answer, rather than getting the information from the problem itself :)
•  » » » » 8 years ago, # ^ |   +4 Yes, the description was quite clear. The main thing here to understand is the the minimum weight will always be 2. Now just try to think of a way to connect the nodes.Problem E is Standard Min Cost Max Flow problem.
 » 8 years ago, # |   0 Today is my unlucky day I save my solution for problem C in file B.cpp but I upload C.cpp to judge
•  » » 8 years ago, # ^ |   -7 i did the same mistake in a round last month..... :(
•  » » 8 years ago, # ^ |   0 I always use the same file to code, after pass the pretest I clear the code and only use my macro.
 » 8 years ago, # |   +3 I don't knw why I am getting "Idleness limit exceeded on test 8"....... for Problem B. Seems mysterious for me..... plz help...http://www.codeforces.com/contest/237/submission/2434517
•  » » 8 years ago, # ^ | ← Rev. 2 →   +5 Maybe its because the declaration co place[mo]; where mo is only 101. But it should be 100² + 1 because the number s can be at most 100²
•  » » » 8 years ago, # ^ | ← Rev. 5 →   0 Oh thx..... now it is accepted...... I thought I would get RTE for these.... anyway good experience without any penalties...... thx again....
•  » » » 8 years ago, # ^ | ← Rev. 4 →   +5 There is no reason to vote negative at this comment, he has the good answer. place[i] is used for store the position on the array of the cell who has number i on it. So, 1<=i<=s, 1<=s<=n*max(ci), 1<=n<=50 and 1<=ci<=50.Edit: oups, too late: the comment has received new positives votes before I post my comment
•  » » » » 8 years ago, # ^ | ← Rev. 2 →   -6 You are right cup_of_tea....... this definately help me in future contest.... Thx god it was not rated for me... gdisastery really deserves positive feedback... But I cannot vote twice... maybe I have to try from different ID..... :D
 » 8 years ago, # |   +1 Omg, really fast judge!
 » 8 years ago, # |   +1 I am facing a strange problem in the practice session . My solution for problem C is returning -1 for the first test case when i submit my .cpp file but it returns the correct value ( 3 ) when running in my pc.
•  » » 8 years ago, # ^ |   0 Try Custom Test :-)
•  » » 8 years ago, # ^ |   +2 Did you set all the variables to zero?
 » 8 years ago, # |   -21 I'm looking to be on top10 contributors, could you help me ? =/
•  » » 8 years ago, # ^ |   0 Post funny comments with memes (or not) will not suffice for become top contributor. If you really want to progress, you should make interesting posts on your blog, or give interesting answers.Anyway, Good Luck!
•  » » » 8 years ago, # ^ |   0 I'm kidding man.
•  » » » » 8 years ago, # ^ |   +5 No one could find it out, even when looking at kiddy-kiddy Po on your ava:)
 » 8 years ago, # |   -12 Is it rated?
•  » » 8 years ago, # ^ | ← Rev. 2 →   +5 Why not? There was no mistakes on statements/examples, the server was stable, the contest has not an odd name, so I will be very surprised if it isn't rated...
•  » » 8 years ago, # ^ |   +1 i think yes
•  » » 8 years ago, # ^ | ← Rev. 2 →   -6 All contests are rated!
•  » » » 8 years ago, # ^ |   -14 I think it's not rated yet!!
•  » » » » 8 years ago, # ^ |   +6 Be patient
 » 8 years ago, # | ← Rev. 2 →   +7 Testing is fast — very good.Rating update is slow — not very good.Just joking
 » 8 years ago, # |   0 Sucks that I kept getting WA on C because I put == as opposed to >=. On the bright side, you can do C in linear time as opposed to using a binary search.
•  » » 8 years ago, # ^ |   +8 Really? Remember that the sieve of Eratosthenes is O(n log log n) ;)
•  » » » 8 years ago, # ^ |   +9 In fact sieve of Eratosthenes can be done in O(n) Linear_sieve
•  » » » 8 years ago, # ^ |   0 Yeah I wasn't taking into account the sieve at the beginning.I saw a lot of binary searches and I thought maybe my algorithm wrong. Good thing that wasn't the case.
 » 8 years ago, # |   +2 Judging was too fast but rating dont provide yet...I thing something is going WA...:D
•  » » 8 years ago, # ^ |   +1 it's so slow...
•  » » » 8 years ago, # ^ |   0 yap...But i just get d rating...:)
 » 8 years ago, # |   +4 Here is a screencast of me solving this round: youtube To watch comfortably (and see clear text), choose 1080p and watch full-screen on a 1920x1080 resolution or higher. I will also provide a file in 1680x1050 for download later if you prefer.
•  » » 8 years ago, # ^ |   0 Good, very useful video! thanks
•  » » 8 years ago, # ^ |   0 Can you upload your "Hightail" program? It may be useful
•  » » » 8 years ago, # ^ |   +15 It's not yet ready to be called even pre-alpha or something (most of the buttons just outright don't work), but if you're interested: github IF you want to help with development, that would be very very welcome. There is a ready list of tasks (issues) on the github page.
•  » » 8 years ago, # ^ | ← Rev. 2 →   0 And the file download is ready.
•  » » 8 years ago, # ^ |   +8 Dude, just keep doing it! I think it would be great to have some alternative on Egor Youtube channel.
 » 8 years ago, # |   +17 Here are the cheaters! wangyedong CHFB_oXbT 389804652 jionghehe Their E Codes are the same!
•  » » 8 years ago, # ^ |   +28 Registered: 22 minutes ago And you're registered just to say that they're cheaters ?
•  » » 8 years ago, # ^ | ← Rev. 2 →   +28 They pretend to be Japanese, But their function names are in Chinese :(.
 » 8 years ago, # |   +8 waiting for editorial! thanks already
 » 8 years ago, # |   0 in problem E. Build String , we should write min cost flow algorithm , but what will be in the role of nodes ? From which node to which are we finding flow ?
•  » » 8 years ago, # ^ | ← Rev. 3 →   +7 As I see it, you need n+26+2 nodes: a node for each given string, a node for each distinct letter in t and source and sink. The edges will be:a) source -> string i, with capacity ai and cost i (no more than ai characters can be erased from the i-th string and each operation costs i).b) string i -> letter c, with capacity [the number of times c occurs in the i-th string] and cost 0 (to erase at most as many letters as there are in the i-th string).c) letter c -> sink, with capacity [the number of times c occurs in t] and cost 0 (we shouldn't erase more c-s than there are in t overall).
•  » » » 8 years ago, # ^ | ← Rev. 2 →   0 thanks , i found out now . Firstly i thought flow was going from each string to the main source. :)
 » 8 years ago, # |   -6 Problem E is Standard Min Cost Max Flow problem. China's NOIP don't test it, I think i need not do it now; i also want to know what the problem 4 mear
 » 8 years ago, # |   0 We are waiting for the editorial.
 » 8 years ago, # |   0 In the problem C I am using binary search to find the minimum value of l.prime[i] stores the number of prime numbers upto i.I am using the following code to return true or false.bool check(int l) { for(int x=a;x<=b-l+1;x++) { if(prime[x+l-1]-prime[x-1]>=k) return true; }return false; } and I am getting the wrong answer. Please tell what is wrong in my approach.
•  » » 8 years ago, # ^ |   +3 It should be this :  bool check(int l) { for(int x=a;x<=b-l+1;x++) { if(prime[x+l-1]-prime[x-1]
 » 8 years ago, # |   0 @problem setter : Editorial ??
 » 8 years ago, # | ← Rev. 2 →   0 Hi NALP,is there any editorial for this round?UPD:Could anyone tell me how to solve prob D T-decomposition?
»
8 years ago, # |
-15

can anbody plzz tell me wats wrong with the following code..its giving wrong ans on pretext 10

# include

using namespace std;

# define MAX 11111

int a[MAX][2]; int main() { int t; cin>>t; for(int i=0;i<t;i++) cin>>a[i][0]>>a[i][1]; int cash=1; int maxcash=1; for(int i=0;i<(t-1);i++) { if(a[i+1][0]==a[i][0]) { if(a[i+1][1]==a[i][1]) cash++; else { if(maxcash<cash) maxcash=cash; cash=1; } } else { if(maxcash<cash) maxcash=cash; cash=1; } } if(maxcash<cash) maxcash=cash; cout<<maxcash<<endl; return 0; }

•  » » 8 years ago, # ^ | ← Rev. 2 →   +3 You are not getting Wrong Answer but Run Time Error. Increase the size of your array : change #define MAX 11111 to #define MAX 111111`.