nchn27's blog

By nchn27, history, 7 weeks ago, In English

We have an array of (10^5?) integers and we have to count the number of subsequences of length 3 that are also arithmetic progressions. I believe they also have to be in the right order.

I googled so hard but I forget the problem name and solution. The problem should be on CodeForces. I vaguely remember a cool solution involving hashing?

Can anyone please help me find the problem / solution

Read more »

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

By nchn27, history, 13 months ago, In English

In use, multiset seems more versatile than priority queue due to the fact that you can remove things other than the first element. In C++, when would priority_queue be used instead of multiset?

Read more »

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

By nchn27, history, 14 months ago, In English

Hi,

We all know Mike works very hard and had to deal with technical issues recently, so what I say is just suggestions for things to do in the future.

  1. On mobile I like to zoom in REALLY big and drag the screen left or right as I read but this often causes the sidebars to appear which interferes with reading. Personally, I would prefer if the sidebars were activated by touch (two buttons in each corner?).

  2. Double-click to view submission doesn't work well? If it does work, it isn't super easy to do.

  3. The new code renderer makes code start off screen now, and probably should be fixed. Also, viewing code on landscape would be helpful too.

Thanks and no pressure.

Read more »

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

By nchn27, history, 14 months ago, In English

The goal is to create a topological sorting except some vertices need to have specific indices in the final ordering. Is there a nice, fast way to do this?

Read more »

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

By nchn27, history, 15 months ago, In English

You are given a DAG with N nodes and Q queries asking if node b can be reached from node a. Can this problem be solved for the likes of N = 10^5 and Q = 10^5?

Also I think if we are given a general directed graph, the problem can be turned into one on a DAG if we do SCC's?

Read more »

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

By nchn27, history, 16 months ago, In English

A common team-building activity goes like this:

There are N people, each holding hands with two other distinct random people.

How many expected cycles are there? Is there a name for this problem? Can anybody link related math or computer science resources?

Read more »

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

By nchn27, history, 16 months ago, In English

William Lin has reached the front page, and people talking about William Lin have reached the front page. From any perspective, this man is clearly a charismatic yet powerful figure that deserves the respect he gets.

Tonight we (probably) find out if our favorite Taiwanese-American who has no alts on CodeForces will represent the country that took him into their arms when Taiwan did not.

Tmw, you are an inspiring programmer who has jumped over all the hurdles, demonstrated amazing programming prowess, and made it far in America's team selection process. Good luck to you, tmw!

EDIT: Today, May 30th 2019, at 9:00 pm EST, it was announced that William Lin (aka Tzuyu Chou) would represent the USA IOI team. Congratulations to our favorite K-pop indulger!

Read more »

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

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

Recently, a blog with the same title as my blog right here was taken down.

^^^ EDIT: The blog is back up. This is no longer a dead link VVV

Dead link: https://codeforces.com/blog/entry/22616

For the people looking up "Codeforces Segment Tree Problems" on Google, here is an archived version of the webpage, before it was taken down:

https://web.archive.org/web/20180430005706/http://codeforces.com/blog/entry/22616

Read more »

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