stevenkplus's blog

By stevenkplus, history, 4 years ago, In English

Hi Codeforces Community! As I'm sure many of you know, I'm very excited to stream a lot of educational competitive programming content in 2021. It's incredible to me that this feature only rolled out 3 months ago (https://mirror.codeforces.com/blog/entry/83939), and there's already so much traction within the community (with multiple streams happening from various users every week, and thousands of viewers). However, I've been considering broadening the subject matter of my streams and wanted to poll the community.

Here's my situation: I like to stream programming content that isn't strictly algorithmic -- for example, I maintain an open source project (down for across -- an online crossword game) in my free time and sometimes stream myself working on that as well. Are these kinds of streams interesting to anyone in codeforces?

Personally, I think software engineering is a different, but related, skill that many competitive programmers would be interested in. In fact, I think becoming a better software developer has actually helped my performance in contests by forcing me to slow down a bit and think through my plan before starting to type. And on the flip side, many people training on codeforces are looking to have a career in tech. However, I also want to be conscious of the community and not use codeforces to advertise unrelated personal endeavors if it's deemed off-topic. So please let me know what you think! (MikeMirzayanov I would love your input here too)

Full text and comments »

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

By stevenkplus, history, 4 years ago, In English

Hey Codeforces community!

I'm interested in making educational content for competitive programming on my twitch and youtube channel. I've noticed that "topic streams" are fashionable these days and wanted to poll for potential topics to cover!

Some topics that I've been considering are: - Basic Dynamic Programming - Shortest Path algorithms - Basic Data Structures (STL's BBSTs) - Basic Combinatorics (Counting & Probability) - Basic mathematical reasoning (logic, greedy, invariants)

Which of these topics would you all be most interested to learn about? Feel free to comment with new suggestions as well!

Another video and/or stream format I'm considering is taking an existing online resource (e.g. https://usaco.guide/) and doing video walkthroughs of the content. The idea here is that the internet has plenty of great resources already, and I could probably help make them more easily discoverable & digestible by explaining them in detail. Thoughts?

Full text and comments »

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

By stevenkplus, history, 4 years ago, In English

Scoreboard

Dear Errichto,

In case you are unaware, you beat me by 3 seconds of penalty on Facebook Hacker Cup Round 3. Upon deep reflection, I decided that I will not accept this lying down. In order to avenge this notorious defeat, I am challenging you to a 1v1 duel.

Rules:

  1. Duel will be held as a lockout competition and will be televised live
  2. Lockout problems will be chosen by a neutral problem setter
  3. Loser must change their main to honor the winner. See below for details
// your template if you lose
#define stevenkplus main
int stevenkplus() {
  // your code here
}

Update: We're doing it this Saturday! https://www.timeanddate.com/worldclock/fixedtime.html?msg=Errichto+vs+Stevenkplus&iso=20200926T11&p1=224&ah=1 Will be broadcast live at https://www.twitch.tv/ecnerwala, 11am Pacific Time.

Full text and comments »

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

By stevenkplus, history, 4 years ago, In English

(EDIT: I no longer require pity because it turns out my solution was much more wrong than I thought, and my "fixed" solution would've failed too)

I had a 1 character bug on https://mirror.codeforces.com/contest/1396/problem/E in contest, and was just a tiny bit too slow to fix it. So now I'm sharing my story in hopes of collecting pity and contribution. See if you can find the bug faster than I did :)

The submission I made: (timestamp 1:56:00) https://mirror.codeforces.com/contest/1396/my

I found the fix & saved it at 2:00:01...

~/codeforces/666div1 ls -lT e.cpp
-rw-r--r--  1 stevenhao  staff  4107 Aug 30 09:35:01 2020 e.cpp

Here is the code, before the fix:

// ============= Solution ============= //
int main() {
   int n;
   ll k;
   cin >> n >> k;
   vector<vector<int>> ed(n + 1);
   for (int i = 0; i < n - 1; ++i) {
      int a, b;
      cin >> a >> b;
      --a, --b;
      ed[a].push_back(b);
      ed[b].push_back(a);
   }

   vector<int> subtreesize(n, 1);
   auto go1 = yc([&](auto dfs, int cur, int prv = -1) -> void {
      for (int nxt: ed[cur]) {
         if (nxt == prv) continue;
         dfs(nxt, cur);
         subtreesize[cur] += subtreesize[nxt];
      }
   });

   go1(0);
   for (int i: subtreesize) {
      k -= i % 2;
   }
   if (k % 2 == 1) {
      cout << "NO\n";
      return 0;
   }

   vector<pii> matches;

   ed[n++].push_back(0); // new root
   vector<vector<int>> buffers(n);
   pp(k);
   auto go2 = yc([&](auto dfs, int cur, int prv = -1) -> vector<int>& {
      pp(cur, k);
      vector<int> &res = buffers[cur];
      res.push_back(cur);
      for (int nxt: ed[cur]) {
         if (nxt == prv) continue;
         vector<int> &bb = dfs(nxt, cur);
         k -= sz(bb) / 2 * 2;
         while (sz(bb) >= 2 && k < 0) {
            matches.push_back(pii(bb[sz(bb) - 2], bb[sz(bb) - 1]));
            bb.pop_back();
            bb.pop_back();
            k += 2;
         }
         if (sz(res) < sz(bb)) {
            swap(res, bb);
         }
         for (int i: bb) {
            res.push_back(i);
         }
      }
      return res;
   });

   vector<int> final_output = go2(n - 1);
   if (k > 0) {
      cout << "NO\n";
   } else {
      pp(k);
      cout << "YES\n";
      for (pii p: matches) {
         cout << p.fi + 1 << " " << p.se + 1 << "\n";
      }
   }
}
The bug I found was...

Full text and comments »

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

By stevenkplus, history, 5 years ago, In English

I should be going live in a few minutes, and intend to stream for about an hour or so. Please hop on if you're interested! I will be trying to solve Leetcode problems as fast as possible.

https://www.twitch.tv/stevenkplus

Full text and comments »

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

By stevenkplus, history, 7 years ago, In English

Hey all! scott_wu (http://mirror.codeforces.com/profile/scott_wu) and I will be doing a livestream tonight at 20:00 UTC-7

Please tune in at https://www.twitch.tv/ttocs45 to watch us discuss and speed-solve problems from a past div 2 contest! We'll also be taking questions in the chat :)

Full text and comments »

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

By stevenkplus, 10 years ago, In English

Hi all, there will be a contest run by Addepar at https://www.hackerrank.com/addepar on June 27 starting 4pm PDT.

Prizes are listed on the website and include free iPad Minis for the top 5 contestants. According to the problem setter scott_wu, they'll "have lots of tough algorithmic challenges, and winners will receive sexy prizes."

Don't miss it!

Full text and comments »

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