Hello Codeforces!
Noon is thrilled to invite you to participate in the first-ever Noon Cake Programming Contest (NCPC)!
Noon is building the future of e-commerce for the Middle East, and we are powered by a world-class engineering team. We're passionate about problem-solving and competitive programming, and we want to celebrate that with the community.

Our problem-setting team includes several ICPC World Finalists and IOI Medalists who have crafted an exciting set of challenges for you. We can't wait for you to try them!
The contest will be held in two phases:
Phase 1: Qualification Round
This round is open to everyone, all around the world! It's your chance to test your skills against a high-quality problem set and have fun.
Date: 2026-01-31
Time: 12:35 EGY (UTC+2)
Duration: 4 hours
Who: Everyone!
Registration: form
Phase 2: Onsite Finals
Based on the results of the Qualification Round, the top 100-200 participants from Egypt will be invited to compete in our exclusive Onsite Finals.
Date: 2026-02-07
Location: TBD
Who: Top 100-200 Egyptian participants from the Qualification Round.
Prizes & Opportunities (Onsite Finals) This is where it gets really exciting. Finalists who compete onsite will be eligible for:
Monetary Prizes: Significant cash prizes for the top-ranking winners and NCPC prizes.
Awesome Swag: All onsite finalists will receive Noon swag.
Career Opportunities at Noon: This is more than just a contest. Top performers in the final round will have a unique, fast-tracked opportunity to interview for full-time positions and internships with Noon's elite engineering team. Come build with us!
We've poured a lot of effort into making this a memorable contest and hope you enjoy the problems. Good luck, and have fun! — The Noon Team








Auto comment: topic has been updated by TripleM5da (previous revision, new revision, compare).
Is there a deadline for the form before 31/1 ?
how long should we stay planted to the seat :)
is the contest cancelled or what??
anything?
Highly recommended
update the Date to be 2026 instead of 2025
wr're in 2025 now :0
Auto comment: topic has been updated by TripleM5da (previous revision, new revision, compare).
Auto comment: topic has been updated by TripleM5da (previous revision, new revision, compare).
Can you release a chart for Tshirt sizes
Is it for students only or anyone can participate?
Who: Everyone!
there’s a deadline for submitting the form before 2026-01-31?
Is there any entry fees?
Excited!!
Can School students participate as well?
yup
Now, there is a reason for training
Is there a deadline for the registration form?
The actual contest
I tried to fill out the form, but it seems to have closed earlier than expected. You mentioned it would remain open until the contest time, so I hope you could open it again.
I had to close it 10 hours before the contest so that I'd go to sleep and have everyone synced by then since the contest db isn't the form and domserver's APIs are a bit annoying.
I didnot recieve an email ?? can you help me know if my subbmission was sent to the form ahmed.moh3011@gmail.com
What about Syrian participants :(
مش عايزين حد يعمل شاي وقهوة؟
معندكوش شغل للتينز
Very Very Excited!!
So only Egyptians will be filtered for the finals?
reminder!
Does it mean that only Egyptians are eligible for Onsite Finals?
Why is the form not accepting applications anymore? Thought the deadline for applying was 31/1, which is the date of "the actual contest."
Was cleaning up some stuff, reopened it but I am gonna close it sometime by 30/1 so that I am able to onboard everyone and send emails
Could you please confirm when the onboarding email will be sent for those who filled the form yesterday and today so we can access the contest?
will send it in a bit
emirates supports Zionism.....
How many problems should we expect ?
Hey
I am receiving "Access Denied" when entering the url of the contest. What should I do?
I'm super sorry for what I'm saying, but while time I thought that I filled the registration form and I have just recognized that I didn't. Please, can you extend the form exactly one more minute for me? The opportunity is super interesting to me and I hope not to miss it.
Thank you
I think I did the same brother lets hope that the server still down so we have time to handle this (without anyone being harmed due to this postponing ofcourse)
Hello, what are the rules regarding templates/googling? I assume (and hope) that AI is not allowed.
why top 100-200 egyptian participants why not all over world?
We can't see the problems or submit, All we got is :
upstream connect error or disconnect/reset before headers. retried and the latest reset reason: remote connection failure, transport failure reason: delayed connect error: Connection refused
i thought only i got that error and started to curse my clg isp
any updates ?
No, still down
Website down?
The platform is not working with me
the website isn't working
The website is down.
Error: upstream connect error or disconnect/reset before headers. retried and the latest reset reason: remote connection failure, transport failure reason: delayed connect error: Connection refused
upstream connect error or disconnect/reset before headers. retried and the latest reset reason: remote connection failure, transport failure reason: delayed connect error: Connection refused , is site down or is it only me who's facing this?
you are not alone
Hi, the site is down.
upstream connect error or disconnect/reset before headers. retried and the latest reset reason: remote connection failure, transport failure reason: delayed connect error: Connection refused
Why not just use Codeforces?
is it canceled ?
is there any updates ?
IT STARTED TO WORK
it isnt allowing login
it doesn't for me !!!!!!!!
will it be postponed ?
Website is down again
the website isn't websitinggg
I can't submit anything until now!!!!!!!
Thanks for not sending an email for me
are you guys able to submit?like its showing pending from last 10 mins
it was a wonderful contest!
thank you for making this cool contest, I had fun solving those problems ^_^
My solutions for problems A-H
The ace problem
I converted every character to be lower, then printed the first character from the first name, and printed the second name, then the suffix "@noon.com"
I will start with the first digit, and try to either make it not equal to 0, or make it not equal to 1 along with the next digit
(so, either changing the current digit to any positive digit, or if I can, I will change the current digit to 1 and change add 1 to the next digit)
I got 4 RTE and 3 WA on this problem :(
the answer is the summation of all the circles areas divided by the area of the plane (n * n)
I'm not sure why this solution didn't work, print the minimum of (count of the letter n in $$$s$$$ — 1) and (count of the letter o in $$$s$$$ divided by 2)
I had to simulate the result and print the occurrences of "noon"
I used DSU to solve this one
for each edge, unite both of its nodes in the DSU, if they are united before, the answer is "Yes", if no two nodes got united more than once, the answer is "No"
we can observe that any fence of length more than 4 can be painted without no restrictions, length 3 as well can be painted
so, we paint first the paint-able fences, then we will take the lengths of the remaining fences of the same color, the condition that must hold is that for any consecutive white fences, the lengths of the colors of these fences must be even in the start and in the end, and it can be true if there is still no odd length fences between them, or only one odd fence (which is always of length 1)
4 2 4 1 2 4 4 is good (the numbers are the lengths of each color, something like WWWWBBWWWWBWWBBBBWWWW)
but 4 1 2 4 1 2 is bad
check this condition and find the answer from it
first, check if there is a valid matching of the brackets or no
you can sort the array $$$a$$$ and the array $$$b$$$, then check for each index if $$$a_i \lt b_i$$$ or no
if the condition is invalid at some index, print 0
otherwise, make a new array that has both the indices from $$$a$$$ and $$$b$$$, sort this array, and then we will make two variables, one for the answer and the other for how many open brackets we have
res = 1, open = 0
then, for each element in c, if the current element is an open bracket, increase the value of the variable 'open' and multiply the result variable with it
if the current element is a close bracket, decrease the value of the variable 'open'
finally, print the variable 'res' (make sure to take the module in each operation)
if two numbers have the same value, we can convert them to 0 in one operation
if the number is 0, we don't need any operation
if two numbers are not the same, we need two operations to convert them to 0
with these cases, we can find the answer for any range
first, I convert the numbers using coordinate compression
then, I ran MO's algorithm on the queries, and for each range I will find all the occurrences of each number, I can make (occ / 2) operations of the first case, and if the number of occurrences is odd, one element will be left
the left numbers can be converted to 0 in (count the number of left numbers + if this number is odd) operations (rem + (rem & 1) operations))
I'm not sure how problem $$$I$$$ is solvable, but does it need DP to find the optimal removing steps?
for problem $$$J$$$, I think it is solvable with lazy segment tree, also, the operation of $$$\sqrt(x)$$$ takes up to 5 operations only to make the number 1, so I believe this was one of the observations of the solution
I've got this solution in brute force, and I was trying to convert it to lazy segment tree but the time finished before that :(
For problem D, try the string “n”. Your solution gives -1.
I think you meant the string s = "o", since count(n) now would be -1 and that would be min.
you can solve this by just adding max(0,min(count(n)-1, count(o)/2))
Salam! can you send problems?
Your solution to problem E is incorrect. Consider the following graph:
You will output $$$\texttt{YES}$$$, but the answer is $$$\texttt{NO}$$$.
I appreciate the work done on the contest, but there are clearly some problems.. I hope they work on them the next time. Better testing was needed.
What is a better solution than the obvious n^2 one? My N^2 dummy solution was to run bfs for the N nodes, and it passed.
What could be a better solution for larger input?
[Deleted]
For your idea in problem J
here the code ( get acc bcs the weak test ) : Here
the problem you can't do it, that if i give you every time the range have a mex of the number of operation get to it ( ex : 3op 1op 4op 2op 3op ... ) so u can't apply lazy for that range and u will go to every node update so it will be (Q * (N/2)) whitc is (Q*N) TLE
It is hard to do DP on the problem as it is, so we need to simplify it first. To do so, we can binary search on answer. It is much easier to calculate the minimum cost to divide the tree into a forest, with each smaller tree having a diameter no larger than $$$mx$$$.
My solution is based on the fact that if you get the farthest node from any arbitrary node of the tree, it will be one of the endpoints of the diameter. So, I have $$$dp[i][x]$$$, which represents the minimum cost to divide the subtree of node $$$i$$$ into a forest with all trees having diameter no larger than some fixed global value $$$mx$$$ and with $$$x$$$ being the farthest node from the root of the new tree that would contain $$$i$$$, and $$$x = 0$$$ is a special case meaning that $$$i$$$ is the root of its new tree and the farthest node isn't decided yet.
The transitions are simple: for each child $$$c$$$ of node $$$i$$$, you either cut the edge connecting $$$i$$$ to $$$c$$$ or not. If you decide to keep it, then you need to ensure that the distance between $$$c$$$ and $$$x$$$ is still no larger than $$$mx$$$, and that it's not farther from the root than node $$$x$$$.
Have a lazy segment tree with each node containing three pieces of information: $$$sums$$$ — an array containing all possible sums that can be achieved by applying operations to each node, $$$ptr$$$ — a pointer denoting the current sum value of the node, and $$$lazy$$$ — the number of operations that need to be applied to this node ($$$+k$$$ means apply the square root operation $$$k$$$ times and $$$-k$$$ means undo the operation $$$k$$$ times).
To propagate the lazy changes to a certain node, we will just add $$$lazy$$$ to $$$ptr$$$ and reset it.
The merge is a bit tricky. Let $$$ptr_l$$$ and $$$ptr_r$$$ be the values of $$$ptr$$$ for the left and right children of some node, respectively. WLOG, assume $$$ptr_l \gt ptr_r$$$. We will need to discard the first $$$ptr_l - ptr_r$$$ elements of $$$sums_l$$$ since the problem statement guarantees that this node will have at most $$$ptr_r$$$ undo operations applied to it, then merge the $$$sums_l$$$ and $$$sums_r$$$ trivially to obtain the node's $$$sums$$$ and set $$$ptr = ptr_r$$$. The other case is symmetrical.
Your idea for J is really great
The following way of taking input in B gets wrong answer:
however, the following gets AC:
I hope you look into the test cases for B and make sure that they are valid (no leading zeros and such).
same for me , it destroyed me
Is it possible to rejudge the submissions of B if that's really the case? There might be people who didn't get it by the end of the contest and have the same issue. (I was inputting it as a string too, but I don't know if it's the only issue in my code).
When will the final standings be revealed?
it is revealed now on the same standing
will there be a mirror for the contest so we can practice the problems?
When will the qualified participants for the onsite competition be announced?
emails have been sent
Yes, I checked my email and found a email from Noon.
Thank you.
any idea how many were chosen for the finals?
the announcement said 100 — 200 but it didn't specify :(
I have an idea.
I’d like to create a list of all participants who will compete in the onsite contest.
May I ask for your permission? TripleM5da
we picked top 100 skipping cheaters.
My experience with problem D in the NCPC Finals was very bad because of the constraints!
The problem is interactive where you are given $$$n$$$, and query ask is printing an array of indexes of at most size $$$2n$$$ and the judge response with single integer. You can ask at most $$$2000$$$ query per test, $$$1 \leq n \leq 200$$$ and sum of $$$n$$$ over all testcases will not exceed $$$2000$$$ with time limit $$$2$$$ seconds
Taking the almost-worst interaction scenario:
Lets count the number of printed integers only: let the printed array have an average $$$2$$$ characters.
Now we have $$$10 \times 200 \times 2000 = 4 \times 10^6$$$ integers printed. Also this goes by neglecting many other stuff. That will easily take $$$2$$$ seconds
Printing $$$4 \times 10^6$$$ integers is very bad and heavy intense on the writing/reading time during the interaction also we have the judge interactor time and the contestant solution time to execute.
This hit me a $$$350$$$ penalty and $$$80$$$ minutes gone on fixing a correct code that TLE because it prints much output while still obey the interaction constraints that take much time to notice that and optimizing the query.
Here is a screenshot of a cpp code simulating the interaction in the most optimized way
(Note that the optimized query is about $$$\frac{n}{3}$$$ printed interges on average)
However, good problem ideas.