### phantom11's blog

By phantom11, 10 months ago,

My roommates and me are planning a house party. Because of covid, the Dutch rules says that we can have a party as long as social distancing is maintained — each individual has to be at least 1.5m away from each other. This brings me to a cool real life problem — what is the minimum area required to fit N people such that each one maintains social distancing with everyone else. N > 2, since we are already 3 roommates :)

My guessed solution is to make everyone stand on the vertices of equilateral triangle, and then join these triangles to form hexagonal lattice (just like a cellular network). Hence the answer would be (N — 2) * area of equilateral triangle of side 1.5m. Is this correct?

If yes, a follow up question would be : What if I wanted to minimise the distance between the farthest people as well? Would I try to fit these triangles inside a square?

Will be nice to hear out solutions to both these problems, for any number of people (N).

• +83

By phantom11, history, 13 months ago,

During the system test phase of Codecraft' 20, I observed many submissions failing around the 100th test case or so. To me, this seems like waste of processing power, to let the codes run till 100 submission and then figure out its failing.

Isn't it possible to sort the test cases by: - decreasing order of number of non-ac submissions - in case of tie, increasing order of average time spent in judging it.

There could be an evaluator thread (for example), which does this after every 100 submissions or so (or something better)?

Is this something too difficult to achieve with the current codeforces infrastructure? One possible difficulty I can imagine is the scenario to show test cases to users. Are there more issues?

• +238

By phantom11, 6 years ago,

Hello All,

I invite you to participate in monthly medium contest of HackerEarth — November Rain (this time). There will be 5 problems in total and you will have 2.5 hours to solve them. The problems are comparable to Div-2 difficulty, though you won't find any cake walk problem. All you need is a HackerEarth account to participate in the contest.

Date & Time
Prizes — Top 3 winners to get HackerEarth T-shirts!

The problems have been prepared by me, and I thank the testers and editorialist for their contribution.

Problem Testers — Bidhan(4 problems), akashdeep(1 problem).
Problem Editorialist — ashish1610

• +5

By phantom11, 7 years ago,

There are so many blogs coming up on codeforces everyday and we sometimes loose the blog which we are following which have got new comments. One of my friends, xorfire wanted something like this in his recent blog yesterday, in which I have also commented my idea, and so I decided to write a script to automate the procedure. Firstly thanks to xorfire for coming up with this idea.

You can download the zipped folder from here. Extract it to some folder name of your choice. Inside it you will find many files which are actually dependencies, but you need to open just notification.exe file. I will describe the the functionality now.

• Username / Password fields -> Update them once in the beginning or whenever you want to change your username password. You do not need to write it every time.

• Add Favorite Blog -> Add the complete URL of the blog you want to follow. Example -> "http://codeforces.com/blog/entry/12727" (quotes for clarity). You can add as many as you want one by one.

• Manage stored blogs -> If you want to delete some blogs, click this button and it will show your complete list in a new window. There will be delete option beneath every URL. You can delete any number of them, and then close the popped up window.

• Run Notifier -> This is the main thing. It will search all your favorite blogs and notify you for those which have new comments. It takes around 10 second for each blog (depends on your internet) . So run it and forget it for a minute (I assume you will not have more than 6-7 fav blogs, otherwise it will take more time). A new window will open where you will find the blogs which have new comments. These are click-able links and on clicking will redirect you to the concerned blogs.

I have made this in 8-9 hours and have given absolutely no time to beautify it. Also it was my first time to use GUI in python. So you may find it ugly, but it works well and that is what is important. Also I have made it for personal use of everyone. So don't try to be smart and do unnecessary things to hack it like writing some blogs which do not exist at all (It might fail & I don't mind it). I made it for the welfare and personal use of the community and also in quick time, so use it in the right spirit. There are no security measures , (your username and password are stored in a file in the same directory) , so do not use it in public systems. I have tested in on Windows 7 and Windows XP and it works fine on both.

I hope you all will like it!!!

• +14

By phantom11, 7 years ago,

UPDATE : Version 2.0
Rewrote whole code (frontend + parser) from scratch. Here are the changes made(in order of importance in my view) :
- Fixed bugs in parser.
- Div 2 Rounds Unofficial find their place in the standings. (this and this. You can now see Div 2 standings of ONLY Officials, ONLY UnOfficals, as well as both.
- Now have a about us page too. :)
- Much neater and a modular code.

Very often we are interested in knowing our position in our country for a contest. Unfortunately, Codeforces does not provide this feature. An ugly way to do it is to make friends with all your country people. But ofcourse that is ugly, and programmers are supposed to be smart.

So I decided to write a scraper and do it on my own. When I graduated this year, and had some time in my pocket, franky and I made this feature. Now that the script is ready, you can find all the contest's country wise standings here.

EDIT: I forgot to mention that those who have not filled in their countries here on codeforces, come under "Alien" in the country-wise standings. I request these people to fill in their correct nationality.

• +160

By phantom11, 7 years ago,

I saw no blog on TCO Round 1A in codeforces.

So here are the information :

EDIT : UPDATED INFORMATION

• Start time of the contest
• Registrations begins 3 hours prior to start time and closes 5 minutes before.
• Top 750 from this round will advance to round 2. There will 2 more rounds like this 1B and 1C.
• Registrations are limited to first 2500 participants only.

Lets discuss problems here once the contest is completely finished.

UPDATE — The editorial of this round has been released. link

• +12

By phantom11, 8 years ago,

TOP CAREER Virtual Study Abroad Fair -2013 Spring-” From Jan.23-Mar.31!

http://vf.topcareer.jp/?referrer=2712

Register and Participate from the URL above and win a great prize such as flight tickets to/from Japan, hotel coupons, online shopping cards, etc.!

You can also win an opportunity of internship offer from Fourth Valley Concierge Corporation, after you pass the screening process.

*Prize winners are chosen randomly from registered participants.

Participate in an online fair where you can find information about scholarship, admission, and etc.), virtually visit schools all around the world, and directly chat with schools’ representatives without actually flying all the way.

Join anytime (24hrs/day!), anywhere!

[Fair Information]

Name: TOP CAREER Virtual Study Abroad Fair -2013 spring-

Date: January 23, 2013 (Wed) – March 31, 2013 (Fri)

• +6

By phantom11, 8 years ago,

Firstly a very happy new year to all coders here :) Hope this year brings lots of Accepted to you.

I have written this blog to help people who ask questions regarding how to change the handle. If you decide to change the handle, (and you thought twice about it, because it is irreversible and can be done only once) , this blog might help you.

This is a new year gift from codeforces and only valid for the first ten days.

Follow the mouse pointer and you are done!!!

• +13

By phantom11, 8 years ago,

This is to remind you that the USACO December 2012 Contest is going to take place from tomorrow.The duration of the contest is 4 days.You can appear in the maximum of any of the 4 hour window during the contest.

Link to Contest Page .(to be updated before the contest starts )

You can use this blog space to discuss problems NOT during the contest but ONLY after the contest is complete.

UPD -> [Results]

• +27

By phantom11, 8 years ago,

I am going to participate in the IIT, Kharagpur regional finals next week. Due to my semester exams , I could not devote much time to programming in the last 2 weeks. So I seek your help and advice.

How to go for it from now. Should I keep solving problems like I did for the whole year , or learn some new algorithms and practice them , or sit for 5 hours in an ICPC like environment and take practice tests ?? I personally want to learn new algorithms but I dont know if I am too late now.Your take ??

Also I have to make a 25 side reference material. I dont want to waste my time building it from scratch .So if any one has it ready , please share it with me .I promise not to duplicate it (in case you dont want it too , you can send me a message here .)I will make suitable edits to make it good for myself so it not wastes time.

• +3

By phantom11, 8 years ago,

I was trying to solve the Problem H of the last contest.[problem link]

But I keep on getting Memory Limit Exceeded.Please some one tell me why this is happening .I am bringing here 3 codes. One from which I have learnt which gets accepted and the other two are mine. Please tell me why I get MLE in both cases and why 'B' got passed in test case 5 by making small change in 'A' (only change is made during the last for loop where printing is done) .

case A ->[Link] fails on test case 5

case B ->[Link] fails on test 15

Please clear my concepts so that I dont face these issues in future.Thank You

• -9

By phantom11, 8 years ago,

Topcoder SRM 559 is going to be held on Tuesday , 30th October 2012 at 21:00 EDT (your timezone)

The registration starts 3 hours prior to the match in the arena and is restricted to the first 2500 contestants .

You can discuss about the SRM here once it is over.(and also on the topcoder forum here).

Also , there is going to be a test round 2 from 2 hours from now in the arena (your timezone)

• +25

By phantom11, 8 years ago,

Hi friends, During my practice I face this problem regularly. Some of the SRM's (and I practice on old SRM's) does not open for practice .It keeps on loading and loading , until I have to close it manually. For eg. SRM 355Div2,SRM 356Div 2 although SRM 354Div 2 opens up quickly. Is this problem that only I face?? How to get through it ?? Any other alternatives ??

This has also happened a lot in previous SRM's . But today I got really frustated and thought of asking help from you

• -3

By phantom11, 9 years ago,

Here is the topcoder account of the founder and CEO of Facebook.[Link] .(courtesy red_coder ) .So all those rated above him, you cannot imagine how much potential you have . So never lose hope :)

• +34

By phantom11, 9 years ago,

• As usual I was training myself @topcoder problems but I was not able to enter the practice rooms although I was able to login into the chat arena.Is anyone facing the same problem/What is the solution then??.I posted in the topcoder forums but got no replies[link]..So I thought of posting it here in codeforces which I feel has more active community.
• I was solving the USACO problem Mother's Milk[link].I solved it but I am getting TLE in the test case 20 10 9 which passes in my system in 2ms .I checked the number of times the recursive function is executed and it is only 24 for that case..Link to code..Please tell me why this is happeneing??

UPD: I had also reported the problem to the USACO team and after a few e-mail exchanges they came to the conclusion that the java grader was broken.They have fixed it now.And the above solution passes now :)

UPD2: Contacted service@topcoder.com and mystic_tc fixed the issue.Thanks to him :)

• +6

By phantom11, 9 years ago,

After this round my rating increased and I was back to blue with a rating of 1568 I think.. But in my profile it is showing the old rating of 1470 although they made me blue .. Is this only with me .??Or is this a bug in the system?? You can see the screenshot here

EDIT : I think it is with all ..They have shifted back to the old ratings for unknown reasons but forgot to change the color back..First time with less than 1500 and blue ;)

• -6

By phantom11, 9 years ago,

I am organising a multiplayer event where each player has a rating (new player is assigned a rating of 1500) ..I want to have a good formula for calculating the new ratings after a competition..I searched the net and found the Elo rating system.This is what I have worked out thus far from the internet resources..:

From The ELo formula let P(B,A[i]) refer to the probablity that B defeats A[i] for all i.
Then total[B]=summation of all P(B,A[i]) for all i's
Let n=number of participants..
Then Expected Rank[B]=n-total[B]
new rating=old rating+ k* (ExpectedRank[B] - ActualRank[B])

Now the issues:

1)I want to know what value of k should be employed .

2)I want to have a regualrity factor also so that a player who is consistently performing well and if some day performs badly his rating does not go too down .ie.ratings dont change drastically on good /bad performance in one match..

3)If this is not the best method to calclate ratigs in a multiplayer competition then which one should be used??Please give details , formulas also

Please help me out .Statistics is not my subject yet I need to get this thing done to complete my project

• -24

By phantom11, 9 years ago,

The TopCoder Open 2013 registrations have begun.. The final will be held in Washington DC next year. You can register yourselves here.The logo and website designing competitions is going to start soon..

Also I take this blog to remind you of the SRM 548 whose registeration closes 15 mins from now..So those who have not registered please do it ASAP.

• -15

By phantom11, 9 years ago,

Wishing Sir Alan Turing , the father of Computer Science and Artificial Intelligence a very happy birthday... And what a doodle in this warm occassion ..

• +1

By phantom11, 9 years ago,

Got a very inspirational quote today which I wish to share with all my fellow coders:

"**Darkness is just the absence of light , it is not that light does not exist.**

Similarly a problem is just an absence of an idea , it is not that its solution does not exist."

• -20

By phantom11, 9 years ago,

Hi!!I am not able to go to the handle option in the settings tab...I want to check that out Just for curiosity ,but its blocked by the system admin since a week or so...Or perhaps they have forgotten to unblock it....Anyone else facing the same problem??

• -4

By phantom11, 9 years ago,

I was the lucky one to win the T-shirt of the lucky draw of SRM-528.I contacted topcoder services team and they told me that they had released it on 6th Jan 2012 and that the t-shirt would come to me within 10 weeks.But I have not received it till now...Could anyone tell me as to :

1) how will it reach me??(eg- registered post,courier ,or some contracted person etc.)

2)How do I claim for it??(For eg it comes through post then I have to show some docket number or some other document to claim it directly from the post office )Then how do I claim it??

I am an Indian Citizen...Apart from this ,I am also due for the NASA USPTO challenge T-shirt and the Accenture Mobile Survey T-shirt from topcoder...I wrote this in the topcoder forum but got no reply and I dont want to lose my special gifts ...Someone Please help???

• -18

By phantom11, 9 years ago,

I submitted this code and the verdict was TLE. I just removed my printing statement which ran O(len(a)) times and it was accepted .Code . Strange behaviour and very strict time constarints. Could anyone explain why such thing happened...

• -8

By phantom11, 9 years ago,

This is a gentle reminder to all coders that SRM 537 is going to happen on the coming Saturday i.e. 17th March.This round is sponsered by CITI ,so there is a total purse of 5000 USD.So gear up and get ready for the challenge.You can find the round details and timings here. You can get the exact prize divisions and a bit of discussion on the SRM on vexorian blog here.

A couple of SRM's back ,the registeration limit of 2500 members was reached some 5 minutes before the closing time.So dont be late or else you may miss a chance to grab some money. Good Luck and Best wishes to all :-)

• +12

By phantom11, 9 years ago,

I cant understand whats the problem with test case 66(n=10^5 k=1).It gives TLE. During the contest I submitted this code and it gives TLE in 66. After the contest when I saw the test case ,I put a condition of checking if k=1 for immediate passing ,just to see if it worked,and it again gave TLE(code). I used BufferedReader to check if its because of large inputs,but again TLE(code). And its not only me but many who got TLE in 66 using java(see this page). Please tell me where is it going wrong because in test case 65 also n=10^5,k=1 so it cant be a sorting issue or a input issue...But immediately after reading inputs and sorting I am displaying the result for k=1.Then why is it passing for 65 and failing for 66.