Hello CodeForces Community! We’re excited to announce the June Long Challenge 2018. We hope to see you all join us in these ten intense days of coding challenges. Joining me on the problem setting panel are:

- Problem Tester: mgch (Misha Chorniy)
- Problem Authors: justadlet (Adlet Zeineken), mraron(Noszaly Aron), (Jitender Sheora), (Phuc Hong), Nots0fast (Rehijm Memmedli), teja349 (D Teja Vardhan Reddy), pieguy (David Stolp), TianyiQ (Tianyi Qiu), Barichek (Ihor Barenblat)
- Problem Editorialist: likecs (Bhuvnesh Jain)
- Statement Verifier:Xellos (Jakub Safin)
- Russian Translator: CherryTree (Sergey Kulik)
- Mandarin Translator: huzecong (Hu Zecong)
Vietnamese Translator: VNOI Team

### Contest Details:

**Time:**1st June 2018 (1500 hrs) to 11th June 2018 (1500 hrs). (Indian Standard Time — +5:30 GMT) — Check your timezone.

**Contest link:** https://www.codechef.com/JUNE18

**Registration:** You just need to have a CodeChef handle to participate. For all those, who are interested and do not have a CodeChef handle, are requested to register in order to participate.

**Prizes:** Top 10 global and top 20 Indian winners get 300 Laddus each, with which the winners can claim cool CodeChef goodies. Know more here: https://discuss.codechef.com/questions/51999/how-do-i-win-a-codechef-goodie (For those who have not yet got their previous winning, please send an email to winners@codechef.com). First to solve each problem individually: 100 laddus (For problems common to both Divisions, only one user will get laddus for that problem).

Good Luck!

Hope to see you participating!!

Happy Programming!!

Has ranking system changed for codechef long challenge ? What I am seeing is different ranking system in this June long challenge. Div1 has ACM style ranking whereas Div2 has as usual score based ranking. Until last long challenge both divisions had score based ranking. ) )

UPD:Now it is fixed. Both the rankings are now score based .Its should be Jitender Sheoran, his handle on cf is Sheoran_Jitu.

Can anybody tell me how to solve two flowers.

Please check out the editorials.

I have solved using dsu approach

give link plzz

The editorials for the following problems are out:

Naive Chef

Binary Shuffle

Sheokand and string

Vision

Two Flowers

Work ways

Expected Buildings

Binary Board

Archie and Tree

WarehouseMan

Plus Equation — Initial version

Hope you liked the problem set. In case of any doubts/suggestion in the editorials, please post in the comments.

Update:Since there is problem in linking of solutions from codechef side, you can view the editorialist solution hereCould you please explain the Two flowers solutions, didn't understand from the editorial? Thanks

Can you briefly explain what part is not clear to you and what all have you tried as part of the solution?

I didn't understand the dsu part. During the contest I also tried similar approach but with sets and it didn't pass the last subtask (here). What i did is that i group the connected components in one (val, ind) and then build a graph with edges to all the adjacent cells and then perform a dfs and each time I visit an edge I remove it from the graph.

I know similar solution is there in the editorial but I am unable to grasp it. if possible can you please explain that part a little bit. Thanks!

After forming the components, I didn't understand the DSU part.

Thanks for quick rating updates!!

Any hints for Plus Equation?

Any ideas on Plus Equation?

Short note on the solution by the author:

Sub 1 only: Simple DFS + pruning can get AC, or using hash carefully.

Full Solution Hint: We try to find each term in the solution, from the largest to the smallest. When one term is selected, we check that if the remaining digits are enough to create a sum required.

I will add the detailed explanation by tomorrow. In the meantime, here is the author's solution.

ACgo and Akinorew, The initial version for the editorial is out. You can check it out here

How to use Euler tour tree to replace HLD in ARCTR?

You can see jtnydv25 solution for help.

Can someone share his approach / intution on solving Ways to Work Problem ?

the greedy approach described in editorial is an easy way to solve this. You can refer to that and if you have already then tell me which portion is not clear to you.

pk842, Can u give me brief explaination for this part. I didn't get it from editorial ?

SpoilerWe may see that for optimal answer, the sequence d1,(d2−1),⋯,(dn−n+1), looks like the following for large N:

[zero or more numbers greater than 1] [bunch of ones] [zeros or more numbers greater than 1]

sorry but I also didn't undestand this proof. I am talking about the editorialist approach. Factorize C and choose the last term greedily i.e. first try the least factor for the last number(chef's deadline) and check whether this can form a valid sequence if it can then we get our answer else continue with the next greater factor.

Is there a

provedcorrect solution for PLUSEQ? See https://discuss.codechef.com/questions/129447/pluseq-editorial/129453.