confusedman's blog

By confusedman, history, 11 months ago, In English

UPDATE 2: It seems codeforces has added back AES, the original cf-tool will no longer work. The one posted here should work for parsing problem test cases though. (5th August 2020)

UPDATE 1: Since codeforces rolled back the AES update, the original cf-tool should work fine.

I have been using the codeforces cf-tool by xalanq quite extensively and was disappointed to learn that the new RCPC decryption update had completely broken the amazing tool.

So I thought it would be fixed soon by xalanq but it turns out that his last visit was 4 months ago.

There is a good possibility that he will not see these messages and there won't be an update to the tool... So I learnt Go and cloned his public repository, managing to add extra functionality that makes it possible to parse contests and test cases. This means that we can use cf parse <contest number> and cf test freely. However, it still isn't possible to login (hoping somebody can fix this?).

Anyway, here's the public repository: https://github.com/confusedman1/cf-tool

And here's the binary file release: https://github.com/confusedman1/cf-tool/releases/tag/v1.1

Tutorial

When you type in cf config, you should see the following:


0) login 1) add a template 2) delete a template 3) set default template 4) run "cf gen" after "cf parse" 5) set host domain 6) set proxy 7) set folders' name 8) add RCPC token

You have to choose option 8 and add your RCPC token before anything can work. The way you can obtain your RCPC token is by logging in to codeforces normally on the website, opening the developer console, and entering document.cookie. This should give you a very long string that contains something like this : ;RCPC=b82f94cccc963782ef928c71012df34e;. In this case, b82f94cccc963782ef928c71012df34e is the token you should enter after selecting option 8.

That's it, now you should be able to successfully parse contests/problems.

Thanks to xalanq for making cf-tool, prophet_ for identifying the AES issue and providing a foundation to fix it. Good luck to gevacrt, you are still active these days so I hope you can fix your tool!

Read more »

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

By confusedman, history, 12 months ago, In English

I recently started competitive programming and have been practicing a lot of Div2 contests. However, it seems that problems A-D (the ones I can solve after some time) are mostly constructive, greedy, implementation, ad-hoc or plain dfs/bfs.

I have been trying to search for contests/problems that involve a diversity of data structures and algorithms so that I can learn more techniques, which is arguably even more fun. It's okay if I can't solve them initially, but at least I hope to learn more from the editorials.

Could anybody recommend good OJs that have contests which can help me maximize my learning of classic algorithms and data structures?

P.S. — By classic algorithms/DS I mean dijkstra, bellman-ford, sparse tables, bridge finding, segment trees, BIT, more advanced dp etc.

EDIT: Cmon guys you know Div2 on codeforces isn't very diverse (these days atleast), why the downvotes?

Read more »

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

By confusedman, history, 12 months ago, In English

What happened to AtCoder regular contests? The last one was in 2018... Seems like they were merged with Beginner contests. If this is true, how does one practice problems in the (600, 1000] range?

Read more »

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

By confusedman, history, 12 months ago, In English

Found this HackerRank problem recently, very similar to the Div2 A problem in Educational Round 89 but a more general form.

It seems that these kinds of problems can be solved with something similar linear programming? at least for the Div2 A problem all we had to do was identify the constraints and output the minimum of them. Does anyone know exactly what topic these problems come under and how to find more like them?

Here's the statement for those who don't want to click the link:

HackerRank Problem Statement

Would appreciate if anyone can give ideas on how to solve specifically this problem and problems similar to it.

Read more »

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