### Daniar's blog

By Daniar, history, 2 years ago, ,

Hello CodeForces :D

I would like to invite you all to participate on Damascus-CPC 2018 contest on GYM. The contest was originally held in Syria, Damascus for Damascus University on May, 8, 2018.

Problem Setters && Testers :

Daniar Jarrous Daniar , Maala Mhrez XR_Maala , Joud Zouzou JoudZouzou , Fudail Hasan fudail225

Hussain Karra Fallah Tomah4wk , Farouk Hjabo fresher96 , Anas Kastatntin kastarino , Hussain Hussain sqr_hussain

Zain Alabedeen Ali ZieiN , Hasan Jaddouh kingofnumbers , Marsil Zakkour Marcil , Noman Jessri Noman.jessri and Mohammad Asaad .

Contest Details:

• Time : May, 26, 2018 (12:00 hrs) (GMT+3). You can check your local time here.

• Contest Length : 5 hours.

• Number of Problems: 12 problems.

The contest difficulty should be similar to a Div2 Codeforces round.

I recommend participating as a team because it is a standard ACM-ICPC contest.

Hope you like the problems. Any feedback after the contest is appreciated!

Good luck and have fun !!

UPD : here is the Editorial

• +65

 » 2 years ago, # |   +9 have fun :D
 » 2 years ago, # |   -8 number of problemseters equals number of problems, it is (1 * 1);
•  » » 2 years ago, # ^ |   +11 How did you know the number of problemsetters?
•  » » » 2 years ago, # ^ |   0 ok, it was (Problem Setters && Testers ) :)
•  » » » » 2 years ago, # ^ |   +8 But there are 13 testers and setters
•  » » » » » 2 years ago, # ^ |   +8 thanks, any other bugs ..
 » 2 years ago, # |   0 how to solve K?
•  » » 2 years ago, # ^ |   +5 find a cycle with simple dfs. Since there are n edges, there exists exactly 1 cycle. For query u,v, find closest vertices in the cycle for each u,v.(say p,q respectively) If p and q are distinct, answer is dist(p,u)+dist(q,v)+(min_dist(p,q) in the cycle) If p and q are same, calculate distance with lca. I missed this part and took much time :(
•  » » » 2 years ago, # ^ |   0 How can we find the closest vertices to each u,v for each query? Should a simple djikstra be efficient enough?
•  » » » » 2 years ago, # ^ |   0 First, find every vertice in the cycle(in 1). Then start bfs from each vertice in the cycle.
•  » » » » » 2 years ago, # ^ |   0 Ah i see.. thank you so much
•  » » » 2 years ago, # ^ |   +3 That was the official solution but there is an easy one mentioned in the editorial , you can take a look at it now.
•  » » » 2 years ago, # ^ |   0 Could you please share your code?
•  » » » » 2 years ago, # ^ |   +1 Sure, https://ideone.com/ACAF2R :) It works on C++17
 » 2 years ago, # |   0 How to solve C? I am checking if A[i] == B[n-i-1] && A[n-i-1] == B[i], then steps are odd, else if A[i] == B[i] && A[n-i-1] == B[n-i-1] then steps are even. Incrementing steps accordingly. This does not seem to work. Thanks
•  » » 2 years ago, # ^ |   +3 Editorial is published
 » 2 years ago, # |   +3 Auto comment: topic has been updated by Daniar (previous revision, new revision, compare).
 » 2 years ago, # |   0 Can I view the test data? I wish to see why my B is incorrect :(
•  » » 2 years ago, # ^ |   0 Sorry, tests are hidden but it's just random edges mostly
 » 2 years ago, # |   +3 It was not interesting to solve any of the problems. I mean in official contest I would try to solve but here I have no intentions of upsolving any of the remaining problems. I hope damascus cpc will be more interesting in the future.
•  » » 2 years ago, # ^ |   -13 Maybe because you only solved the easy ones? :P
•  » » » 2 years ago, # ^ |   +13 Dude, G and I are idealess. thank you for your efforts preparing and all. but it is just not interesting. I think a negative opinion should be accepted.
•  » » » » 2 years ago, # ^ |   +6 Ofcourse it is accepted, but your first comment didn't contain any helpful feedback on what needs to be improved. Anyways I'm sorry you didn't like the problems.
•  » » 2 years ago, # ^ |   +10 Thank you for your opinion and we respect it, but I don't really agree with you.This problemset is prepared for a local university competition (most of the contestants are beginners i.e. green or even grey on codeforces ) and it's difficulty is similar to a Div-2 contest.If you managed to solve most of the problems easily without thinking a lot or making any effort that's because you are a Div-1 ranked contestant with a very well knowledge of the basics, but that doesn't make the problems "idealess" .I think problems D , E and H are interesting and very good for a 3 stars rated gym contest but you probably didn't read or give enough time to think about them.
•  » » » 2 years ago, # ^ |   0 Can you please summarize the DSU on Tree approach used in the code of problem L?? I tried to understand it but not able to get it further in the code.
 » 10 months ago, # |   0 http://codeforces.com/gym/101808/problem/F and http://codeforces.com/gym/101808/problem/H are'nt available now. Could you please update? Thanks! Daniar
 » 10 months ago, # |   0 I have a hack data for problem G input: 1 2 5 100 10 20 output: 1 somebody's code output 2 but Accepted here is a wrong code: https://codeforces.com/gym/101808/submission/58792147
•  » » 10 months ago, # ^ |   0 Another data also can hack some Accepted codes input: 1 2 5 100 20 20 output: 1
 » 9 months ago, # |   +3 I tried cloning this contest to a mashup today, and in the mashup, all submissions to problem F get "Judgment failed" even though it works perfectly in the original gym contest. Maybe it's worth looking into, MikeMirzayanov?