scott_wu's blog

By scott_wu, history, 4 weeks ago, In English

Hey all!

After seeing a few of these make the rounds, I've been inspired to do my own. I'll check in when I can over the next few days and answer any q's you might have. Ask me anything!

A little bit about me: I grew up in Louisiana and started competing in math and programming contests early on. I eventually competed on the US IOI team as well as the Harvard ICPC team and I'm now cofounder of a company called Lunchclub (we're hiring!)

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

»
4 weeks ago, # |
  Vote: I like it +42 Vote: I do not like it

How old are you?

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +76 Vote: I do not like it

    I'm 23 now! I started programming when I was 12 and first started competing seriously when I was 14.

    • »
      »
      »
      4 weeks ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      wow!

    • »
      »
      »
      4 weeks ago, # ^ |
      Rev. 2   Vote: I like it +21 Vote: I do not like it

      Tell me one simple thing please, I have been wondering this since I saw the video, when did you even read the First problem ?

      And I am not like just praising you for that, I am really asking this, as I struggle reading the problems fast enough ( And also, a lot of times still miss the crucial details of the problem ). Do you just read sample input output and make some pattern recognition out of it ? Or what ? Please explain the process, I will be thankful of you.

      Thanks in advance.

»
4 weeks ago, # |
  Vote: I like it +19 Vote: I do not like it

What's the best advice you will give to beginners like us to improve in CP?

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +68 Vote: I do not like it

    At the beginning, the most important thing to do is just to spend a lot of time on it! Solve problems, compete in rounds, read or watch editorials and don't worry too much about topics or difficulty calibration.

    Eventually that method starts to plateau, at which point you need to analyze specific topics deeply (e.g. segment trees, or swapping algorithms) and do focused practice on problems in the right difficulty range. But that isn't absolutely necessary until later, and there's no substitute for raw practice time especially early on.

    • »
      »
      »
      4 weeks ago, # ^ |
        Vote: I like it +20 Vote: I do not like it

      At what point do we have to learn the advanced topics in-depth(e.g. segment trees, or swapping algorithms)? After 2100?

      • »
        »
        »
        »
        4 weeks ago, # ^ |
          Vote: I like it +8 Vote: I do not like it

        I guess at 1700-1800 u should start advance topics

»
4 weeks ago, # |
  Vote: I like it +31 Vote: I do not like it

Biggest achievement in your life ?

»
4 weeks ago, # |
Rev. 2   Vote: I like it +5 Vote: I do not like it

How did you get into competitive programming and what made you want to pursue it ?

  • »
    »
    4 weeks ago, # ^ |
    Rev. 2   Vote: I like it +55 Vote: I do not like it

    I had done math contests from a young age (including a US middle school math contest called MATHCOUNTS) and I really enjoyed those. Later on, my brother neal started doing USACO, and he introduced me to programming contests.

    I was pretty much hooked as soon as I started competing. Overall I find programming contests to be a really fun mix of innovation (coming up with new algorithms or discrete math) and engineering (coding/debugging skill, practical understanding of systems/compilers, code optimization). I also really enjoy the strategy component of programming contests, which is very unique compared to e.g. math or physics olympiads.

»
4 weeks ago, # |
  Vote: I like it +19 Vote: I do not like it

How much practice have you done to get to where you are today and how did you avoid distractions?

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +47 Vote: I do not like it

    Not sure about an exact number but my total problems solved is probably somewhere in the thousands. :)

    There were definitely times when I was training seriously when it was tough to stay motivated. But the main reason I made it through those (and honestly, the main reason I still compete now) is because these contests have been a lot of fun for me. I love solving interesting problems, I've made a lot of great friends through contests, and I'm also an extremely competitive person, so programming contests have always felt like a natural choice.

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Any hobbies other than competitive programming?

»
4 weeks ago, # |
  Vote: I like it -24 Vote: I do not like it

Do you like math?

»
4 weeks ago, # |
  Vote: I like it -7 Vote: I do not like it

Do you play game ?

»
4 weeks ago, # |
  Vote: I like it +18 Vote: I do not like it

What CP goals do you still have?

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +200 Vote: I do not like it

    Truthfully, there's not too many goals I have left as an individual contestant. But one of my biggest dreams for competitive programming is to see it become an esport that people can follow and watch. I think tmwilliamlin168, Errichto, ecnerwala, and others have done really well growing their streams and I'm excited to see what develops in the future. Maybe some day we'll have TSM|tourist :)

    • »
      »
      »
      4 weeks ago, # ^ |
        Vote: I like it +5 Vote: I do not like it

      I think CP and Chess to be very similar sometimes (not becuase CF titles are similar to FIDE titles), I wish one day CP might have some Championship matches like chess and will be recognized much more at global level but main thing is count of viewers , everyone can get started with chess easily but not with CP without some educational background..

      • »
        »
        »
        »
        4 weeks ago, # ^ |
          Vote: I like it +17 Vote: I do not like it

        In chess 2 participants don't move simultaneously. Technically CP isn't 1v1, it's 2 participants vs same problemset. It's hard for viewers to grasp what's happening even in 1v1 CP streams.

        • »
          »
          »
          »
          »
          4 weeks ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          Chess is not about moves only as CP is not about typing and player think simultaneously ,players at top level know that the moves of his opponent are gonna come from known set of moves, but yeah it's different obviously but both are discrete in nature and I keep my self busy with these.

»
4 weeks ago, # |
  Vote: I like it +6 Vote: I do not like it

If you never stumbled upon competitive programming, would your current life be really different?

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +47 Vote: I do not like it

    Absolutely. I would say my career path, hobbies, and close friends would be completely different.

»
4 weeks ago, # |
Rev. 3   Vote: I like it -18 Vote: I do not like it

[DELETED]

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Dragon Ball or Naruto?

»
4 weeks ago, # |
  Vote: I like it +26 Vote: I do not like it

What kind of CP problems you like more: ICPC-style problems or IOI-style problems?

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +46 Vote: I do not like it

    I'd probably pick IOI-style problems (mix of topics that require a lot of cool innovations/observations), although I actually enjoy ICPC's contest format more, particularly the team format and the strategy around scoreboard.

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

What do you do in your spare time?

»
4 weeks ago, # |
  Vote: I like it +5 Vote: I do not like it

Any tips to avoid burning out and to continue enjoying cp?

»
4 weeks ago, # |
  Vote: I like it -37 Vote: I do not like it

why don't u join google ?

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    iirc he did internship at Google, but still, he decided to create his own company and it looks great

»
4 weeks ago, # |
  Vote: I like it -28 Vote: I do not like it

Tips to find a girlfriend as a competitive programmer?

»
4 weeks ago, # |
  Vote: I like it -19 Vote: I do not like it

Please share some good resources for CP.

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +2 Vote: I do not like it

    There are literally so many blogs answering the same question. Why did you put it here? It looks so stupid.

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

What is your next Goal?????

»
4 weeks ago, # |
  Vote: I like it +22 Vote: I do not like it

I see that Lunchclub is an AI company. How did you go from competitive programming to artificial intelligence?

  • »
    »
    4 weeks ago, # ^ |
    Rev. 2   Vote: I like it +34 Vote: I do not like it

    Good question! The short answer is that a lot of the work at early-stage startups overlaps with the same skillset needed for competitive programming. It sounds silly that solving algorithmic puzzles ends up being similar to solving real-world business problems (and they are very different problems), but a lot of the underlying skills carry over well, such as iterating quickly on code, familiarity with data/statistics, and being able to adapt and learn in response to new problems.

    AI is just one of the areas where those skills apply (and programming contests are certainly not the only way to develop these kinds of skills), but at this point the most common career path for US IOI contestants is actually joining/founding early-stage startups.

»
4 weeks ago, # |
  Vote: I like it +50 Vote: I do not like it

When can I stock up on lunchclub shares?

»
4 weeks ago, # |
Rev. 2   Vote: I like it +9 Vote: I do not like it

Why did you choose economics at Harvard instead of computer science?

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +21 Vote: I do not like it

    I had already done quite a bit of programming by then and wanted to learn more about other fields (quantitative finance, public policy etc.) I ended up dropping out anyway so it didn't turn out to matter too much :)

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

What was it like co-founding a company like Lunchclub?

»
4 weeks ago, # |
  Vote: I like it +137 Vote: I do not like it

I'm very close to being red right now, at this point it seems that I'm very "saturated", like I've learned most of the commonly known things and practiced a lot, so I don't understand how can I improve further.

Can you describe your journey from Red to Nutella?

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +50 Vote: I do not like it

    I just stopped participating for time being. Feeling that contests are just speed forces. Solve ABC (in 6 problems) or AB (in 5 problems) then just get stuck at that point. So I ask the same question.

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +93 Vote: I do not like it

    Interesting question. Many people start to plateau at the level you describe. For me the way to move forward was to focus on consistency and not allow any excuses for failure. If you miss the idea to use binary search in a problem, you need to learn exactly why binary search was applicable, and see what hints could motivate you to think of binary search in a future problem. If your segtree had a bug, you need to practice coding segtrees until you never make that bug again, etc. It’s one of the hardest parts of the journey for sure.

    • »
      »
      »
      4 weeks ago, # ^ |
        Vote: I like it +38 Vote: I do not like it

      Thanks for the advice, I'll surely apply that!

      Guess life isn't in the fast lane anymore :p

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +25 Vote: I do not like it

    I find that funny as I'm at my peak rating and I still feel like there's so much more to learn.

    • »
      »
      »
      4 weeks ago, # ^ |
        Vote: I like it +56 Vote: I do not like it

      I think it's just Dunning Kruger Effect... The more you know, the more you understand how much you don't know...

      The things you think you're weak at, I probably don't even know that they exist.

»
4 weeks ago, # |
  Vote: I like it +21 Vote: I do not like it

Why did you dropout from Harvard ? Harvard would have potentially got another gold at ICPC WF had you competed in your second ICPC WF.

»
4 weeks ago, # |
  Vote: I like it +3 Vote: I do not like it

How tall are you ??

»
4 weeks ago, # |
  Vote: I like it +152 Vote: I do not like it

When are we going to do a 1v1 lockout? Cause I can't wait to destroy you.

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

how can we keep calm after a horrible performance on a contest (and what do you do in these situations)?

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +6 Vote: I do not like it

    I'm really bad at that honestly. But IMO it's good to feel motivated to improve as long as it doesn't affect your mood for too long :)

»
4 weeks ago, # |
  Vote: I like it +3 Vote: I do not like it

How you spent your time on CP (in hours per day)?

(1. During university classes, 2. During semester exams, 3. During vacations)

»
4 weeks ago, # |
  Vote: I like it +5 Vote: I do not like it

Between patience and hardworking, which one is more crucial in programming ?

»
4 weeks ago, # |
  Vote: I like it +2 Vote: I do not like it

Why did you choose Entrepreneurship over a job?

»
4 weeks ago, # |
  Vote: I like it +8 Vote: I do not like it

Do you eat pineapple on pizza?

»
4 weeks ago, # |
  Vote: I like it +3 Vote: I do not like it

One of the your favorite easy problems?(At most DIV2C range)

»
4 weeks ago, # |
  Vote: I like it +3 Vote: I do not like it

What is the story behind Lunchclub ?

»
4 weeks ago, # |
  Vote: I like it +11 Vote: I do not like it

Do you play any video games?

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Looks like you took almost 1.5 years of break. Any reason?

»
4 weeks ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

How to practice solving math problems if there is no tutor? I mean is there any source for problems with their solutions(counting, probabilities, number theory .... )? and thanks for giving us the chance to ask you :)

»
4 weeks ago, # |
  Vote: I like it +9 Vote: I do not like it

Which contests do you like the most ? (Ex-Codejam, Hackercup, CF rounds,etc)

»
4 weeks ago, # |
  Vote: I like it +5 Vote: I do not like it

Do you play any video game? Quite interesting.

»
4 weeks ago, # |
  Vote: I like it +24 Vote: I do not like it

What is your silliest mistake in a live contest except overflow :)

  • »
    »
    4 weeks ago, # ^ |
    Rev. 2   Vote: I like it +8 Vote: I do not like it

    Hmm I tried to think of some but all the examples I could come up with were overflow...

»
4 weeks ago, # |
  Vote: I like it -68 Vote: I do not like it

sir I invite you to teach me and guide me to the right path to red. I know you have the capacity for that. Can i connect with you on linkedin for the time? plz

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it -33 Vote: I do not like it

    Sallo lodu why was i downvoted scott wu sir plz help. I am still grey, and I struggle with DIV2A.

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

How are you and your family?

»
4 weeks ago, # |
  Vote: I like it +19 Vote: I do not like it

Do you like monkeys?

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it -48 Vote: I do not like it

    sir I invite you to teach me and guide me to the right path to red since scott wu sir is not replying. I know you have the capacity for that. Can i connect with you on linkedin for the time? plz

    • »
      »
      »
      4 weeks ago, # ^ |
        Vote: I like it +9 Vote: I do not like it

      I can help guide you: in order to become red, yes, you must like monkeys.

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +23 Vote: I do not like it

    or Do monkeys like you?

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

If I try I can do better than you? What you think?

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    try brother, i wanna see

    • »
      »
      »
      4 weeks ago, # ^ |
        Vote: I like it -11 Vote: I do not like it

      thank you soooo much broooo...trust me I have inspired by see your comment!!!thanks again!!!

»
4 weeks ago, # |
  Vote: I like it +9 Vote: I do not like it

Ok, here we go:

  1. Cats or dogs?
  2. Tea or coffee?
  3. What music do you listen to?
»
4 weeks ago, # |
  Vote: I like it -10 Vote: I do not like it

How would you describe your IOI and ICPC experiences?

»
4 weeks ago, # |
  Vote: I like it +20 Vote: I do not like it

What is it like to have a sibling who's also such a great competitive programmer? It sounds pretty cool, two super intelligent siblings..

  • »
    »
    4 weeks ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    nvm

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +32 Vote: I do not like it

    It's pretty great honestly. There weren't too many people in my hometown who were interested in contests, so having my brother as a role model was really helpful for me.

»
4 weeks ago, # |
  Vote: I like it +45 Vote: I do not like it

How much do you bench?

»
4 weeks ago, # |
  Vote: I like it +16 Vote: I do not like it

What is your most disappointed moment in CP?

»
4 weeks ago, # |
  Vote: I like it +16 Vote: I do not like it

Have you ever considered pursuing an academic career?

»
4 weeks ago, # |
Rev. 2   Vote: I like it +5 Vote: I do not like it

how you got the idea for lunchclub?

»
4 weeks ago, # |
  Vote: I like it -8 Vote: I do not like it

I watched your commentary on Google Kickstart 2020 Round B. Excellent explanation but you tried explaining the special case of the last row in Problem D in https://youtu.be/AP74zQ0ZmRM?t=1269 But I didn't get it, can you please explain that part?

»
4 weeks ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

.

»
4 weeks ago, # |
  Vote: I like it +8 Vote: I do not like it

Do you think you are better than your brother ?

»
4 weeks ago, # |
  Vote: I like it -23 Vote: I do not like it

Can you lick your elbow?

»
4 weeks ago, # |
  Vote: I like it +40 Vote: I do not like it

What is your CF account's password ?

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it -21 Vote: I do not like it

    First 5 pages for the proof of Fermat's last theorem

    or maybe just 'password'

»
4 weeks ago, # |
  Vote: I like it +87 Vote: I do not like it

I'm assuming you're not doing a PhD at the moment (not sure if you've gone through a master degree either). What made you choose founding lunchlub over a more scientific career or even getting a job (I can see some advantages but I'm interested in your take on that).

Do you feel like you're making constant trade offs regarding theory/practice (as in you need to use something, need to read a bit about the theory behind, but end up doing so to a lesser extent than what you want, because you want to deliver the product asap)

I see you took a break from CP (presumably during the more intense university years). What made you come back to it (even before the pandemic) and how do you balance fun (CP included) with work (especially being your start up, i guess you don't have a fixed schedule)?

Is Lunchclub's internship open to people outside US, or that don't have the right to work in the US (I see it's remote, but still not sure)?

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +43 Vote: I do not like it

    Lot of great questions!

    Academia is an interesting path and it's probably the second-most common career choice out of my competitive programming friends. It has some cool positives (focus on deep unsolved problems, autonomy) but personally I've always loved to build things and I generally like quick feedback cycles, which academia lacks. Big tech companies are something of the opposite -- hands-on software work and clear progress, but less autonomy and more of a focus on "completing tasks" rather than "solving problems". So I've found that I learn most in a startup environment where there's a nice balance of both sides.

    I trained contests seriously for several years and wanted to take a break in 2016-17 to pursue other passions. Eventually I found that contests were too fun not to do so I'm back again. :) I can't train nearly as much as I used to (and usually only compete on occasional weekends now) but I actually think that spending a little time to stay sharp on contests has improved my overall work productivity, counterintuitively.

    Our internship and full-time positions are all open to fully remote options and you don't need to work in the US! We have great engineers all over the world and some of them are competitive programmers themselves :)

»
4 weeks ago, # |
  Vote: I like it +14 Vote: I do not like it

Do you think P=NP? Also, are we related?

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

How are you ?

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Have you ever dreamed about coding?

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Do you watch animes? If yes, which one is your favorite?

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

What qualities are you looking for in a person when you consider employing them at Lunchclub?

»
4 weeks ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

working in MNC -VS- own startup. Although its clear you are cofounder of Lunchclub, but wanted to know the reasons for your preference.

Also advice for young grads.

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

I know you did USACO as well as IOI, and did super well in them.

As an American senior going for USACO camp this year, how hard is it to make it? I've heard that it gets harder as your age increases (since they like younger folks) and I reckon a lot of the camp kids are master/red level on CF. What's your recommended way to prepare for USACO too? I've noticed USACO is more algorithm based while CF focuses more on AdHoc, so where would you recommend I go for problem sources?

Thanks for taking the time out of your day!

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +6 Vote: I do not like it

    It's tough but not impossible! I think CF is a great resource, as are Topcoder and AtCoder. USACO Training pages were also really helpful and how I first got started.

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Hi scott_wu, As you are an working professional now, how do you manage to keep up with participating in contest and doing Competitive Programming with your daily work, or what's your routine/schedule and if you could suggest some management tips?

I asked this because I am a student in almost after a year I would in a working person and I would not like to leave doing CP.

»
4 weeks ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Hi Scott! Thanks for doing AMA! I like that you have taken inspiration from ecnerwala and hopefully you will also inspire many more people!

Questions: What is the idea behind Lunchclub and where do you see it going in the future? What are some interesting things that you learned while cofounding and working at a startup? You mentioned that you dropped out of Harvard. Can you describe what was your experience there like and why did you eventually decide to drop out?

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    The goal of Lunchclub is to make relevant professional connections using data and ML. We got started in 2017 and have learned a lot since then, e.g. finding product/market fit, hacking on growth, improving quality with scale, adapting to COVID etc.

    I really enjoyed my time at Harvard -- it exposed me to more soft skills and generalist knowledge after spending most of my middle school and high school life focusing only on contests. Dropping out was less about leaving school and more about the opportunity I wanted to pursue :)

    • »
      »
      »
      4 weeks ago, # ^ |
        Vote: I like it -61 Vote: I do not like it

      helo sir what is wrong in this code it gets runtime error for Pashmak and Parmida problem

      include<bits/stdc++.h>

      include<stdio.h>

      using namespace std;

      define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

      define MAX 1000050

      define ll long long

      define ld long double

      define lli long long int

      define pb push_back

      define INF 1000000000000

      define mod 1000000007

      // trignometric function always give value in Radians only

      define PI acos(-1) //3.1415926535897932384626433832795028

      define dsin(degree) sin(degree*(PI/180.0))

      define dcos(degree) cos(degree*(PI/180.0))

      define dtan(degree) tan(degree*(PI/180.0))

      define rsin(radian) sin(radian)

      define rcos(radian) cos(radian)

      define rtan(radian) tan(radian)

      define mem0(a) memset(a,0,sizeof(a))

      define mem1(a) memset(a,-1,sizeof(a))

      define memf(a) memset(a,false,sizeof(a))

      define loop(i,n) for (lli i = 0; i < n; i++)

      define FOR(i,a,b) for (lli i = a; i < b; i++)

      define all(v) v.begin(),v.end()

      define rall(v) v.rbegin(),v.rend()

      define makeuniq(v) v.resize(unique(all(v)) — v.begin()); //only uniq element in vector after this

      define sz(x) int(x.size())

      define F first

      define S second

      define mii map<lli,lli>

      define pii pair<lli,lli>

      define vi vector

      define vvi vector

      define vpi vector

      define vbool vector

      define seti set

      define gcd(a,b) __gcd((a),(b))

      define lcm(a,b) (a/gcd(a,b))*b

      define abs(x) ((x < 0)?-(x):x)

      define endl '\n'

      template void print(Head&& head) { cout<<head<<endl; } template <typename Head, typename... Tail> void print(Head&& head, Tail... tail) { cout<<head<<" "; print(tail...); }

      define scanarr(a,n) for(lli i=0;i<n;i++) cin>>a[i];

      define scanvec(a,n) for(lli i=0;i<n;i++){ lli x ; cin>>x; a.pb(x);}

      define printarr(a,n) for(lli i=0;i<n;i++) cout<<a[i]<<" "; cout<<endl;

      define printvec(vec) for(auto xt : vec) cout<<xt<<" "; cout<<"\n";

      define FD(N) fixed<<setprecision(N)

      define deb(x) cout<<#x<<" "<<x<<endl;

      /* 1D vector — vi dp(n,value); 2D vector — vvi dp(n,vi(n,value)); */

      // chandan1,2 void chandan1(){int y=1;return;} void chandan2(){ loop(i,10){ lli x=1; } return(chandan1()); }

      //---------------------------------------------------BIT----------------------------------------------------------------------

      lli BIT[MAX], a[MAX], n , b[MAX]; void update(lli x , lli val) { while(x<MAX) { BIT[x] += val; x += (x&-x); } }

      lli query(lli x) { lli sum = 0; while(x>0) { sum += BIT[x]; x -= (x&-x); }

      return sum;

      }

      //--------------------------------------------------BIT------------------------------------------------------------------------

      void coordinate_compress(lli a[] , lli n) { lli temp[n];

      loop(i,n)
          temp[i] = a[i];
      
      sort(temp, temp + n); 
      
      loop(i,n)
          a[i] = lower_bound(temp, temp + n, a[i]) - temp + 1;

      }

      int main(){ fastio lli t=1; //cin>>t; chandan2(); while(t--) { cin>>n; FOR(i,1,n+1) { cin>>a[i]; } //coordinate_compress(a,n); lli fi[n+1]={0}; lli fj[n+1]={0};

      lli mp[MAX]={0};
      
      FOR(i,1,n+1)
      {
          mp[a[i]]++;
          fi[i] = mp[a[i]];
       //   cout<<fi[i]<<" ";
      }
      
      mem0(mp);
      
      for(lli i=n;i>=1;i--)
      {
          mp[a[i]]++;
          fj[i] = mp[a[i]];
         // cout<<fj[i]<<" ";
      }
      
      FOR(i,1,n+1)
      {
          update(fj[i] , 1);
      }
      
      lli ans = 0;
      
      FOR(i,1,n+1)
      {
          update(fj[i] , -1);
          ans += query(fi[i]-1);
      }
      
      print(ans);

      } return 0; }

»
4 weeks ago, # |
  Vote: I like it +20 Vote: I do not like it

Early bird or night owl ? scott_wu

»
4 weeks ago, # |
  Vote: I like it +1 Vote: I do not like it

What factored into you deciding not to participate as a competitor in ICPC in 2016-17 (or a subsequent year) after the 3rd place finish and gold medal in 2015-16? Was it to focus on Lunchclub as alluded to in a couple of other answers?

P.S. Kudos (and thank you) to you and the Harvard 2015-16 ICPC team (and also the MIT 2015-16 ICPC team) for medalling that year and opening up another World Finals allocation for the NENA regional for 2016-17!

»
4 weeks ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Disclaimer: i didn't find any hubs in my hometown and there is no clear info about lunchclub.
It's probably silly question, but what's the difference of lunchclub and telegram chats or discord or many many other online social networks?

»
4 weeks ago, # |
  Vote: I like it -9 Vote: I do not like it

Are you an atheist?

»
4 weeks ago, # |
  Vote: I like it +124 Vote: I do not like it

Which are you more likely to get wrong on the first shot: a div2B problem with a special case when n==1, or the orientation of a USB device you are trying to plug in?

»
4 weeks ago, # |
  Vote: I like it +2 Vote: I do not like it

How difficult are USACO problems in Codeforces rating?

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Which citizenship do you have? Also, do you play Among Us?

»
4 weeks ago, # |
  Vote: I like it +3 Vote: I do not like it

What is your IQ?

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Do you play Among Us?

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +10 Vote: I do not like it

    I haven't but I do enjoy a lot of similar games like Mafia and Werewolf. Maybe I should give it a try :)

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Who is the elder brother, neal or you ??

»
4 weeks ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

How can i improve my competing programming skill , i am a newbie

»
4 weeks ago, # |
  Vote: I like it +21 Vote: I do not like it

What would be your advice on how to imrove ad-hoc problem solving skills?

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Asks a Red. How comforting

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +64 Vote: I do not like it

    IMO most people don't try enough examples / small cases when solving problems. It takes time but is really important (samples often hide the true idea, and sometimes the pattern isn't obvious for N=2,3 and only becomes clear with higher N).

»
4 weeks ago, # |
  Vote: I like it +11 Vote: I do not like it

How many hours you sleep in a day?

»
4 weeks ago, # |
  Vote: I like it +8 Vote: I do not like it

Do you plan to make more YouTube videos?

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +7 Vote: I do not like it

    I do! It's been hard to find the time recently but I'm planning to stream and make more videos when I can.

    • »
      »
      »
      4 weeks ago, # ^ |
        Vote: I like it -16 Vote: I do not like it

      Could you please answer my question, about a youtube video of yours, which I asked HERE Please

      • »
        »
        »
        »
        4 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        I mean, we can hope and wonder that there are straightforward tips and tricks to improving recognition of problems and sifting through problem statement information, but the simple answer is that this guy has been solving problems like this and had the practice reading problems statements for many years. I suppose if you have spent a comparable amount of time it might be a genuine question, but I think most of the speed comes from his countless hours of practice.

        • »
          »
          »
          »
          »
          4 weeks ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          It's quite probable, that what you are saying is exactly the reason, why scott_wu is able to read the problems that fast and accurate, without missing the crucial details. But rather than assuming what's most probable, I thought it will be a bit better for us to listen from him itself. After all, this is an AMA session rightright, and the best we can take something out of this is to learn something from him!

          So that is why I asked this, let's hope scott_wu replies.

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Which K-pop groups do you listen to ?

»
4 weeks ago, # |
  Vote: I like it +3 Vote: I do not like it

Anything you are scared of ?

»
4 weeks ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

As an experienced question maker, if you find a program that passes the pretest in a certain contest you hold, its algorithm is wrong, but it can pass the system test data you prepared in advance. Will you temporarily add test data and let it fst?Why?

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +19 Vote: I do not like it

    A similar situation happened on CF some years ago. IMO a contest (including test data) is fixed as soon as the round starts, modulo clarifications / statement errors -- it's not the job of the problemsetters to try to hack solutions that come in (and it also adds a lot of subjectivity around which solutions get hacked).

    • »
      »
      »
      4 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      What about adding actual hacks which happened during the contest to the test set?

»
4 weeks ago, # |
  Vote: I like it +1 Vote: I do not like it

Hello there, Scott! What's the appropriate amount of time one should spend on some problem before giving up on doing it all by thyself & look at the tutorial instead! Had asked many about this, some said 15-20 mins max, some said a while, what's your take on it & what would be YOUR advice on it! TIA

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +48 Vote: I do not like it

    This is an interesting one. It seems like a lot of people recommend waiting and thinking more, but personally I look at editorials as soon as I get stuck. The key piece though is to make sure to connect to the motivation of the solution. "How could I make the insight that leads to discovering the solution?" is a separate question from "What is the solution?" and it's important to think about the former as well.

»
4 weeks ago, # |
  Vote: I like it -32 Vote: I do not like it

I am a beginner in the world of competitive programming, just solved a few problems in codeforces but now I am stuck completely and cannot move on, Can you help me to get rid of this problem?

»
4 weeks ago, # |
  Vote: I like it +44 Vote: I do not like it

What’s your favorite data structure?

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Is there something (algorithm/data structure/technique) you discovered independently? Gave this blog a search and can't find any comment.

»
4 weeks ago, # |
  Vote: I like it -13 Vote: I do not like it

Which one will you prefer centroid decomposition or Hld decomposition.

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +82 Vote: I do not like it

    i don't want to offend you but this is so gray

    • »
      »
      »
      4 weeks ago, # ^ |
        Vote: I like it -18 Vote: I do not like it

      I read that as gay lol

    • »
      »
      »
      4 weeks ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      Np ..I asked because I was trying to solve GERALD2 problem using centroid decomposition but was not able to do so. There is an obvious solution using HLD which is mentioned in its editorial. I dont know if there exists a solution with CD at all.

      Btw, I am not unexperienced. I am active on other CP sites. I just joined codeforces recently

»
4 weeks ago, # |
  Vote: I like it -8 Vote: I do not like it

Do You take bath daily?