kingofnumbers's blog

By kingofnumbers, history, 7 weeks ago, In English,

Hello everybody,

Errichto has been inaccessible for a month now, not replying anyone on FB nor hangouts even though he become online sometimes (maybe he is not actually online?), he is also no logging into his account on CF.

The fact that he is a contest admin in codechef and he is no longer administrating the contests suggests that there's a strong reasons for his absence from the internet for this long period.

if anyone know about his circumstances please let us know, we hope he is fine!

Read more »

 
 
 
 
  • Vote: I like it  
  • +338
  • Vote: I do not like it  

By kingofnumbers, history, 2 months ago, In English,

Hello CodeForces community,

SnackDown 2017 Pre-Elimination Rounds have finally concluded. We saw over 12K teams joining us for the Pre-Elimination Rounds, out of which 3403 teams (who were in top 1000 ranks of each of the Pre-Elimination Rounds) have been qualified for the Elimination Round.

Now, while we prepare to step into the Elimination Round, I would like to introduce the problem setting panel for the contest.

Problem setters: arjunarul (Arjun Arul), kingofnumbers (Hasan Jaddouh),Deadwing (Hussain Kara Fallah), nssprogrammer (Snighda Chandan), Fedosik (Fedor Korobeinkov), mgch (Misha Chorniy), fudail225 (Fudail Hasan)

Problem testers: kingofnumbers (Hasan Jaddouh), mgch (Misha Chorniy), Fedosik (Fedor Korobeinkov), Alex_2oo8 (Alexey Zayakin)

Translators: Mandarin : huzecong (Hu Zecong), Russian : CherryTree (Sergey Kulik), Vietnamese : VNOI team.

Contest Admin: PraveenDhinwa (Praveen Dhinwa)

I thank each and everyone of them for their contribution in preparing the problem set.

Given below are the details of the contest

Additionally, we are also conducting a replay round of the Elimination Round for the rest of the community. It will take place at https://www.codechef.com/SNEL17RP and the top three winners of the contest will win cool SnackDown 2017 t-shirts. I would take this opportunity to invite the entire community to come and join us for the Replay of SnackDown 2017 Elimination Round.

Details of the SnackDown 2017 Elimination Round Replay:

Accepted Languages: https://www.codechef.com/wiki/list-compilers

Note: The Elimination Round will follow ACM ICPC style ranklist.

We hope you will enjoy the problems and we welcome your feedback in the comments below.

Good Luck!

Read more »

 
 
 
 
  • Vote: I like it  
  • +100
  • Vote: I do not like it  

By kingofnumbers, history, 2 months ago, In English,

Hello CodeForces Community! I would like to take this opportunity to extend this invitation for CodeChef May Cook-Off. As usual it is scheduled for the second last Sunday of the month.

Joining me on the problem setting panel, we have:

You will be provided by 5 problems of various difficulties to solve during 2 hours and 30 minutes, I have found the problemset very interesting and I recommend coders of various skills to participate especially GrandMasters, please feel free to provide your feedback in the comments section after the contest, I hope you will enjoy solving the problem set.

You can find the rest of the details about the contest below.

Time: Sunday, 21st May, 2017 at 21:30 HRS (IST) (Indian Standard Time — +5:30 GMT) — Check your timezone.

Details: https://www.codechef.com/COOK82

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 performers in Global and Indian category will get CodeChef laddus, with which the winners can claim cool CodeChef goodies. Know more here: https://www.codechef.com/laddu. (For those who have not yet got their previous winning, please send an email to winners@codechef.com)

Good Luck! Hope to see you participating!!

Read more »

 
 
 
 
  • Vote: I like it  
  • +58
  • Vote: I do not like it  

By kingofnumbers, history, 2 months ago, In English,

Hello everyone!

I would like to invite you to participate in Hackerearth May Circuits 2017. It's a long contest that will start on May 19, 2017, 09:00 PM IST (check your timezone). Contest will run for 9 days.

The problemset consists of 7 traditional algorithmic tasks of various difficulties and 1 approximate problem. For traditional algorithmic tasks, you will receive points for every test case your solution passes — so you can get some points with partial solutions as well. For the approximation task, your score depends on the best solution in the contest so far. Check contest page for more details about in-contest schedule and rules.

I'm the tester of the problemset — thanks to architrai, Arterm, harshil and imamit for preparing these tasks. Editorials will be provided to you by saatwik27

As usual, there will be some nice prizes for the top five competitors:

  • $100 Amazon gift card + HE t-shirt.
  • $75 Amazon gift card + HE t-shirt.
  • $50 Amazon gift card + HE t-shirt.
  • HE t-shirt.
  • HE t-shirt.

Good luck to everyone, and I hope to see you at the contest :)

Read more »

 
 
 
 
  • Vote: I like it  
  • +65
  • Vote: I do not like it  

By kingofnumbers, 5 months ago, In English,

Surprise surprise, people!

Read more »

 
 
 
 
  • Vote: I like it  
  • +90
  • Vote: I do not like it  

By kingofnumbers, history, 5 months ago, In English,

Hello CodeForces Community! I would like to take this opportunity to extend this invitation for CodeChef February Cook-Off. As usual it is scheduled for the second last Sunday of the month.

Joining me on the problem setting panel, we have:

  • Problem setter and Editorialist: kingofnumbers (Hasan Jaddouh)

  • Contest Admin:PraveenDhinwa (Praveen Dhinwa)

  • Tester: Errichto (Kamil Debowski)

  • Language Verifier : arjunarul (Arjun Arul)

  • Russian Translator : CherryTree (Sergey Kulik)

  • Mandarin Translator: huzecong (Hu Zecong)

  • Vietnamese Translator: VNOI Team

I hope you will enjoy solving the problem set. Please feel free to provide your feedbacks in the comments section after the contest. You can find the rest of the details about the contest below.

Time: 19th February 2017 (2130 hrs) to 20th February 2017 (0000 hrs). (Indian Standard Time — +5:30 GMT) — Check your timezone.

Details: https://www.codechef.com/COOK79

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 performers in Global and Indian category will get CodeChef laddus, with which the winners can claim cool CodeChef goodies. Know more here: https://www.codechef.com/laddu. (For those who have not yet got their previous winning, please send an email to winners@codechef.com)

Good Luck! Hope to see you participating!!

Read more »

 
 
 
 
  • Vote: I like it  
  • +83
  • Vote: I do not like it  

By kingofnumbers, history, 7 months ago, In English,

Hello CodeForces Community!

After a series of four ICPC regionals in India (Amritapuri, Chennai, Kharagpur, Kolkata), the top teams from the respective regionals have been shortlisted and they will now compete at the final leg of the ACM ICPC Asia India regionals — ACM ICPC India Final 2016. Over 90 top teams have geared for the Final which makes it an exciting battle to watch. My best wishes to all the teams who are competing tomorrow.

Further, I would like to invite you all to the parallel mirror contest which will be take place at ACM-ICPC Asia — India Final Onsite Mirror Contest.

For those who are preparing for the ICPC onsite regionals this would serve as an ideal platform to practice as it would simulate the real onsite contest.

Contest Details

Time: 30th December 2016 (1100 hrs) to 30th December 2016 (1600 hrs). (Indian Standard Time — +5:30 GMT) — Check your timezone.

Contest link: https://www.codechef.com/INF16MOS

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

Good Luck! Hope to see you participating!!

Note: The mirror contest will run in parallel to the main contest with an hour delay.

Read more »

 
 
 
 
  • Vote: I like it  
  • +77
  • Vote: I do not like it  

By kingofnumbers, history, 10 months ago, In English,

note: this is just sarcastic blog

Here are the steps to follow in order to perform well in codeforces contests:

1- Have a fast internet connection: codeforces servers might be heavily loaded and be down, but during the down period the server might be up for short moments, and if you have fast connection you can catch theses moments and get chance to open the problems or submit your solution, also when you finsh coding a solution in the last minute you need fast connection to quickly submit

2- read all the old problems on codeforces: admins nowadays allow problems to be repeated or to be very similar to some old problem (or at least they don't take care to avoid that), so if you read all problems on codeforces (you don't have to solve them) you can know that a problem is repeated and copy/paste one of the solutions of the old problem, you might take some time to find the old problem but it can still be less time than to solve it.

3- practice your googling skills: sometimes the problem might be very classical and it can be found on google, sometimes it can be easily found and sometimes you need to try different wording to find it so you need to practice how to search on google.

4- don't forget about oeis.org: if the problem have a single integer in input you might find the solution in oeis.org

5- keep watching blogs and comments during the contest: admins nowadays don't remove comments and blogs (or at least they don't watch them) which spoil the solution of a problem, so if you keep watching the comments and blogs during the contest you might get a solution for free

6- try out brute force solutions before the contest end: it is very often that a contest contains at least one problem which allow brute force solution either because of genernous time limit or because of weak test data

7- get used to C++ if you are not: the time limit on codeforces is the same for all languages, so if you use fast language you will have advantage over the slow languages, specially when you try to write brute force solution as mentioned in previous step

8- keep with you templates of famous data structures and algorithms: sometimes a problem on codeforces is very easy to find the correct approach, but it just needs some well-known DS which takes a lot of time to implement so if you have it beforehand you might only need to do some trivial modifications before you are ready to submit

9- also you can practice your problem solving skills, but this is not very important step compared with all the steps above

Read more »

 
 
 
 
  • Vote: I like it  
  • +226
  • Vote: I do not like it  

By kingofnumbers, 13 months ago, In English,

Hello Programmers!

I would like to invite you to participate in June Cook-off, it will start at Sunday, 26th June, 2016 at 21:30 HRS (IST), and will last for 2.5 hours, The contest will have 5 algorithmic problems of varying difficulties. the link to contest here.

  • Problem Setter: kingofnumbers (Hasan Jaddouh)
  • Problem Tester: mgch (Misha Chorniy)
  • Editorialist: pushkarmishra (Pushkar Mishra)
  • Mandarin Translator: huzecong (Hu Zecong)
  • Russian Translator: Antoniuk (Vasyl Antoniuk)
  • Vietnamese Translator: VNOI Team
  • Contest Admin: PraveenDhinwa (Praveen Dhinwa)

Top 10 international and top 10 Indians will get CodeChef laddu, find more about them here.

Feel free to discuss the problems after the contest, I hope you will find the problems interesting, looking forward to see you in the contest.

Read more »

 
 
 
 
  • Vote: I like it  
  • +64
  • Vote: I do not like it  

By kingofnumbers, history, 15 months ago, In English,

Hi,

This is to remind you that Google Code Jam Round 1B will be tomorrow at this time, Top 1000 will advance to 2nd round.

let's discuss the problems after the contest.

Good luck.

Read more »

 
 
 
 
  • Vote: I like it  
  • +78
  • Vote: I do not like it  

By kingofnumbers, 15 months ago, In English,

Hello,

I would like to seek help about the following problem because I find it helpful in many problems in CP:

You are given a circle and a function which takes a point on the circumference of that circle and returns a real number, you know that there's one point A on that circle which gives minimum returned value of that function and one point B which gives maximum returned value of that function, and you know that the function is increasing on the paths from point A to point B (from both direction).

You don't know where are points A and B, but you know they exist. you can call the function on whichever point you want and get the value of it, one call cost O(1) time complexity, you should find points A and B within a fixed allowed small error EPS in best complexity possible (perhaps O(log(accuracy)) ?? )

assume you don't know the exact formula of that function, and it's preferable that you don't compare the value of two points which are at distance EPS from each other because in practice sometimes it's hard to choose correct EPS.

as I mentioned before this problem can exist in many problems in CP so it's useful to know how to solve it.

thanks

Read more »

 
 
 
 
  • Vote: I like it  
  • +55
  • Vote: I do not like it  

By kingofnumbers, history, 20 months ago, In English,

Did you notice that votes in all very old comments are disappeared (all comments now have 0 votes)?

is it a problem in the website or it's done intentionally ?

UPD: it's fixed now

Read more »

 
 
 
 
  • Vote: I like it  
  • +38
  • Vote: I do not like it  

By kingofnumbers, 21 month(s) ago, In English,

Hello!

I invite you to participate in the next code monk contest which will be about topic "Dynamic Programming II", if you are interested in learning new techniques of dynamic programming, then this is the right contest for you, the contest will have four problems related to dynamic programming, each one is solved by different dp technique, and the contest length is 3 hours and will start tomorrow Wednesday 11 Nov 2015, 03:30 PM UTC here's the link of contest.

I am(kingofnumbers) the problem setter, I_love_Tanya_Romanova is the tester of the contest, and editorials for the problems will be provided to you by Sokolov.

we hope you enjoy the contest and benefit from it.

looking forward to see you at the contest, good luck.

Read more »

 
 
 
 
  • Vote: I like it  
  • +42
  • Vote: I do not like it  

By kingofnumbers, 21 month(s) ago, In English,

Hello!

This is to remind you about second round of Croatian open competition in informatics will be held tomorrow Saturday 07.11.2015. 14:00 GMT/UTC

link for the contest: COCI

let's discuss the problems after the contest ends.

Good luck and have fun!

UPD: results are out!

Read more »

 
 
 
 
  • Vote: I like it  
  • +68
  • Vote: I do not like it  

By kingofnumbers, history, 21 month(s) ago, In English,

What is the next number of the sequence 1,3,5,7,... ?

when you have an answer check whether it's correct or not here

moral of story that all answers are correct for some polynomial function so such questions which majorly used in IQ tests are non sense

Read more »

 
 
 
 
  • Vote: I like it  
  • +26
  • Vote: I do not like it  

By kingofnumbers, 22 months ago, In English,

Hello

I was trying to solve problem H in this gym contest , the problem shortly states:

given a connected graph you are required to add one edge so that the number of bridges in the graph is minimized, an edge is called bridge if and only if removing it makes the graph disconnected.

the solution is very simple , find bridges in O(n+m) then change every connected component of non-bridge edges into one node , then you will have a tree consisting of bridge edges only , then find the length of diameter of tree and subtract it from the number of bridges and this is the final answer

this algorithm is O(n+m) time and memory but when I coded it , it gave me Memory limit exceeded which is very strange since all arrays which I allocated can't be more than 256MB , here's my code which took MLE.

then I tried to code it without using structs or pointers but I used vectors, and it got AC with only 16MB memory , link to my AC code , as you can see there's big difference in memory and I have no idea what is happening.

I wrote a code that calculate the sum of number of nodes and the number of edges in all test cases of input file and the result was: sum of nodes=639884 , sum of edges=678426

any help explaining the MLE would be appreciated.

Read more »

 
 
 
 
  • Vote: I like it  
  • +27
  • Vote: I do not like it  

By kingofnumbers, 23 months ago, In English,

If you want to understand recursion then follow the link

Read more »

 
 
 
 
  • Vote: I like it  
  • +3
  • Vote: I do not like it  

By kingofnumbers, 23 months ago, In English,

Hello problem solvers!

I'm glad to invite you to participate in HackerEarth September Easy Challenge. it will start on September , 1st at 16:00 UTC, link of the contest: September Easy Challenge

There will be 6 algorithmic problems of varying difficulties (from easy to medium) and you will be given 3 hours to solve them, each problem is worth 100 points and partial points is allowed (you will be given points of each test case you pass). Top 5 beginners will receive HackerEarth T-shirts.

Problems are set by subway, Tested by Me kingofnumbers and the editorialist is ikbal

we did our best to prepare the contest so we hope you enjoy it and benefit from it.

looking forward to see you on the contest , Good luck!

Read more »

 
 
 
 
  • Vote: I like it  
  • +24
  • Vote: I do not like it  

By kingofnumbers, history, 2 years ago, In English,

hello guys

I was trying to solve problem EAGLE1 in spoj OJ

the problem gives you a weighted tree and ask you for each node , find farthest node from it

this is very standard dp problem but my code strangely always take runtime error , although I tried different coding styles.

I thought maybe there's something wrong with test cases but I tried to write code that check the validity of test case before processing it but it showed that nothing wrong with the test cases

I'm seeking for help to explain what's happening , here's my code

thank you in advance

Read more »

 
 
 
 
  • Vote: I like it  
  • +5
  • Vote: I do not like it  

By kingofnumbers, history, 2 years ago, In English,

Hello

I have a question that come to my mind but I'm not able to solve it:

Given N , you know there's an array of N integers but you don't know integers of the array , you only know N.

you want to find minimum integer of this array, in order to do that you can ask questions of form: L R

it means what's the maximum number among all integers from index L to R (inclusive)

you will know the index and the value of the maximum integer

in case we can ask O(N) questions then we can query every integer alone and get the minimum one

but is there's any way to know the minimum integer of this array using less than O(N) questions ?

if there's no way how to prove that formally?

Read more »

 
 
 
 
  • Vote: I like it  
  • +22
  • Vote: I do not like it  

By kingofnumbers, history, 2 years ago, In English,

sometimes during a contest when I think a problem have tricky test case(s) I go to my room and start searching for solutions which doesn't handle those tricky cases but sometimes after I read about more than 15 codes I still can't find even single solution which doesn't handle one of these tricky cases then I start to think: am I unlucky because I am in a room where all its contestants are very careful for tricky cases?

but then after the contest I discover that all such test cases exist in the pretest so if a solution didn't handle one of them it will not pass the pretests, so I just realized that I wasted my time while reading the solutions.

that's why I want to suggest a new feature in codeforces round rules that makes us able to submit solutions to a problem even after locking it so we can submit solutions that doesn't handle those tricky cases so if it passed then we know those tricky cases doesn't exist in the pretests , ofcourse those submissions doesn't affect our points and only last solution submitted before locking is judged in the system testing.

Read more »

 
 
 
 
  • Vote: I like it  
  • +78
  • Vote: I do not like it  

By kingofnumbers, 2 years ago, In English,

I want help to explain the behavior of this code

this code reads an undirected graph then store list of the edges in list vector, then in the adj vector I store adjacency list of the graph where I actually store pointers to the edges from list vector

but as you can see there's some random big numbers appear in the output but I don't know how, maybe I am making some undefined behavior some where? , any help would be appreciated.

Read more »

 
 
 
 
  • Vote: I like it  
  • +5
  • Vote: I do not like it  

By kingofnumbers, 3 years ago, In English,

look at my chart in my profile my rating goes like this

where:

c=number of contests I participate

r=my rating

last three contests which I did , each one of them I thought I can reach red in that contest but my rating end up raised but without reaching red

Read more »

 
 
 
 
  • Vote: I like it  
  • +26
  • Vote: I do not like it  

By kingofnumbers, 3 years ago, In English,

Hello,

Syrian Collegiate Programming Contest 2014 (SCPC) was held as a multisite contest in both Damascus and Latakia between 21st and 23rd of September , I think it's the first ACM contest which take place in two sites in two different cities!

Forty four teams from eleven universities participated in the contest beside three other unofficial teams

I've uploaded the contest to GYM and I invite you to participate in this contest which I choosed this time for it , I hope I chose the time which suits as many coders as possible.

most problems may be easy for yellow and red coders but at least one problem will interest you.

it's the first time that I upload a contest to GYM so I hope everything is technically ok!

if you have coach rights please don't enter the contest before it starts.

By the way, today is the third day of Eid al-adha festival so Happy feast to all Muslims :D

UPD: Contest is finished , thanks for participation and Cogratulations to winners.

problem H is a traditional dynamic programming but allowing negative values tricked a lot of contestants because they didn't initialize the corner values of dp to -INF (i.e dp[i][0]=-INF and dp[0][i]=-INF)

problem I is very simple implementation problem the fault of many participants is not considering the case when there's no 5 different letters in the song.

Read more »

 
 
 
 
  • Vote: I like it  
  • +43
  • Vote: I do not like it  

By kingofnumbers, 3 years ago, In English,

Hello

I would like to know about what is the criteria of choosing the team that will represent your country in IOI and what is the criteria of training students, is programming is studied in high schools in your country and details about this stuff.

I'll start by talking about Olympiad system in Syria:

in Syria there's one organization that is responsible for all science Olympiad (maths, informatics , chemistry , physics , biology) all events for all subjects happens in the same time.

each year there's mainly three events

1- Central national Olympiad (in January of every year):

this is the first step to enter the Olympiad world each student in first year of high school should choose only one subject to participate in, then they do elimination exams, so that the top 5 of every state in Syria is chosen to to participate in "Central national Olympiad", since programming is not teached in high schools the majority of students don't know programming thus, the exams are paper-wise which have many question ans puzzles which needs way of thinking similar to the one in competitive programming , after the top 5 is chosen from each state they are given some lessons about programming to get ready for "Central national Olympiad" that is held in Damascus (capital of Syria) , students have only one month to learn programming before "Central national Olympiad" , only top 10 will be members of "national team" students that fail of being in "national team" in first year of high school have no other chance to join it.

2- Selection contest (in march of every year):

only "national team" members are invited to this contest where top 4 in this contest are chosen to represent Syria in IOI

3- training camp (in June of every year):

all "national team" members are invited to this camp where they stay in Damascus for about 20 days to get training

What about your country?

sorry for my poor English

Read more »

 
 
 
 
  • Vote: I like it  
  • +19
  • Vote: I do not like it