codepasta's blog

By codepasta, 10 months ago, In English
#pragma GCC optimize("O0")
#include <iostream>
#include <bits/stdc++.h>
using namespace std;

#define int long long
#define endl "\n"
#define optimise() ios_base::sync_with_stdio(true); cin.tie(0); cout.tie(0);
#define debug (x) cout << "debugged variable:" << x << endl;
#define map unordered_map
#define set unordered_set

int32_t main() {
    return 1;
}

Explanation of template:

  • #pragma GCC optimize("O0") means using fast compiler options to optimize
  • #define int long long — uses long long by default instead of int, prevents overflows
  • #define optimise() optimises reading input/output
  • #define debug (x) is a debug function, use it like this: debug(my_variable).
  • #define map/set — uses more efficient unordered hashtable (insert/delete operation in $$$O(1)$$$) instead of regular search tree (which is $$$O(\log n)$$$).

Full text and comments »

  • Vote: I like it
  • -5
  • Vote: I do not like it

By codepasta, 17 months ago, In English

The comments with a big negative score (like this) are now displayed like all other comments. Remember the times when there was the text "This comment has been hidden because of negative feedback, click here to see it"? To be honest, that was sometimes annoying. I'm kinda glad they got rid of it.

Full text and comments »

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

By codepasta, 21 month(s) ago, In English

No, cancelling Google Code Jam and Topcoder contests will not kill CP. But CP is going to become increasingly isolated by more interesting programming challenges.

Think of AI and blockchain technology. Everyone is now talking about chatGPT and bitcoin and ethereum, so no-body will be interested anymoor in classic algortihms on CodeForce. The CP of the Future will consist entirely of AI and blockchain programming contests.

The top competitors will receive as prizes Nvidia graphics cards, so that they can mine more bitcoin, while weaker participants will receive unique monkey NFTs which they can trade in for t-shirts, pants, or Robux, or a subscription to NordVPN.

Because we have shorter attention spans, contests will not have 5 problems in 2 hours. They will have 3 problems in 20 minutes, so that we have more time to watch TikTok afeter the contest.

Thanks for coming to my tedtalk.

Yours analogically, Codepasta

Full text and comments »

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

By codepasta, 21 month(s) ago, In English

Don't believe me? See here: link

Full text and comments »

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

By codepasta, 21 month(s) ago, In English

The great and very smart user Marinush had the idea of giving ranks according to gender on Codeforces. Unfortunately, his blog was 100% clickbait and didn't really talk about CF ranks, so I am going to solve this problem.

Because social norms are 100% set in stone, girls are attracted to pink and boys to blue. So, let's look at each CF rank and see if it is for women or for men:

newbie -- this is neither pink, nor blue, so it is for all genders
pupil -- this is closer to blue, so it's for males
cyan -- similar to pupil
expert -- this is clearly blue, so for males
candidate master -- this is equally blue and pink, so it's for all genders
master-- yellow is closer to pink than to blue, so it is for females
grandmaster -- red is closer to pink, so it is for females
legendary grandmaster -- black & red is closer to pink, so it is for females

So, everything master and above is female, everything expert and below is male, and, for genderless aliens like me, there is newbie and candidate master.

I hope my solution has solved this burning question on codeforces!!!

Yours unsocially,
Codepasta

Full text and comments »

  • Vote: I like it
  • -44
  • Vote: I do not like it

By codepasta, 22 months ago, In English

Problem statement made by the author:

Given a list of N cities and the distances between M pairs of cities, what is the shortest possible route that visits each city exactly once and returns to the origin city? (N, M <= 2*10^5)

Intended solution by problem author: write a greedy or DP in $$$O(n^2)$$$

What actually happens during the contest: author discovers that this is actually an NP problem and cannot be solved for big N, M. Contest becomes unranted because of bad problem.

Conclusion: always check for impossible problems before the contest.

Full text and comments »

  • Vote: I like it
  • -19
  • Vote: I do not like it

By codepasta, history, 23 months ago, In English
  1. Planet Earth will complete 1 spin around the Sun.

  2. tourist will manage to remain LGM in 2023.

  3. Me publishing this blog

  4. MikeMirzayanov remains president of the Republic of Codeforces.

  5. chromate00 will not write a comment for 24 hours.

Honourable mention: AI reaches super-intelligence and we are all gonna die.

Full text and comments »

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

By codepasta, 23 months ago, In English

The Div3 round is on 18th December and it overlaps with the World Cup.

Solution: I suggest postponing the World Cup, maybe we can bribe the greedy Qatari officials with 100$ to delay the World Cup. If they don't accept, I suggest that we cyber-attack Qatari government websites to display only rainbow flags, because the rainbow is the symbol of the #1 biggest enemy in Qatar.

Full text and comments »

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

By codepasta, 23 months ago, In English

PHP version 1

PHP v2

PHP v3

PHP v4

PHP v5

PHP v6

PHP v7

PHP v8

HTML

If there is somehow a language which I have not included, let me know in the comments sektion!

Full text and comments »

  • Vote: I like it
  • -29
  • Vote: I do not like it

By codepasta, 2 years ago, In English

Hello, Codeforces!

Codeforces is great, but there are always things to improve. Here are my suggestions for the platform:

  • Codeforces changes sponsor to NordVPN
  • Every time you click on a problem, you have to watch a 30-second ad about NordVPN before being able to read the problem
  • Every contest from now on contains at least three geometry problems
  • People with anime profile pictures get more geometry problems than the rest
  • If you get more than three "WA on test 2" verdicts during a contest, you get permanently banned on Codeforces

If you have any other suggestions, please write them in the comments. Also make sure to like and subscribe and hit the notification bell!

Full text and comments »

  • Vote: I like it
  • -15
  • Vote: I do not like it

By codepasta, 2 years ago, In English

Hello, Codeforces! Today I am going to show you some suggestions for Codefroces logo. I think the current Codforces logo is too boring and it is not modern for 2022 standards. Therefore i would like to make a few ammendments to the Codefocres logo in order to improve it. Please Mike read this blog verry carefully.

Firstly, I think we should simplify the logo, because that's what every loved tech company does in 2022. I am going to use very powerfull Miscrosoft Word program to make these logos.

The text on the current Codeforcse logo is too complex, let's solve that:

Screenshot-2022-11-16-101532

This is much better and easier to read (already improvement by 69.42%). We can make the bars on the left more interesting using a Microsoft Wrod 3D modern automatic super chart, like this:

Screenshot-2022-11-16-101913

until now, i used the default microsoft font, but we can use comic sans for a cooler Coodforces logo:

Screenshot-2022-11-16-102056

Coddforces is sponsered by TON, and if Mike wants more money from sponsor , he shoould more the sponsor more visible in the logo, like this:

Screenshot-2022-11-16-102739

I think we should make Cofedorces more accesible and inclusive, so i translated the logo into Braille and deaf handsign characters:

Screenshot-2022-11-16-103326

1 ton is equal to 1000kg here in Europe, Asia, Africa, Australia, South America, Canada, Mexico and China. For our American freinds who do not know what a kilgramm or ton is, we should make the logo more acessible too:

Screenshot-2022-11-16-104211

As a last improvement ,if mike wants more moneyy from sponsors, he should choose a richer sponsor and update the logo accordingly:

Screenshot-2022-11-16-104432

Honourable mentions:

Screenshot-2022-11-16-102515

(has cool font and cool 3D chart)


Screenshot-2022-11-16-102347

(supports diversity and inclusivity)

Full text and comments »

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

By codepasta, 2 years ago, In English

Step 1. Register to codeforces Round

Step 2. When contest starts, go to the last problem

Step 3, Search a Chinese blog (EDIT: or Codeforces blog) with the solution to the problem on google, yandex and baidu

Step 4. Copy solution and submit


Step 5. PROFIT !!!!!! +3000 positive delta, 169% WORKING GUARANTEED


PRoblem?

Full text and comments »

  • Vote: I like it
  • -38
  • Vote: I do not like it

By codepasta, 4 years ago, In English

hello, codeforce!!!1!

i have a hard question for you, can you please helpp me????

question is: how to find if a number called n is even or odd???? my code is:

#include <iostream>

using namespace std;

int main()

{

int n;

cin >> n;

if (n == 1) cout << "ODD";

if (n == 2) cout << "EVEN";

if (n == 3) cout << "ODD";

if (n == 4) cout << "EVEN";

if (n == 5) cout << "ODD";
if (n == 6) cout << "EVEN";
if (n == 7) cout << "ODD";
if (n == 8) cout << "EVEN";
if (n == 9) cout << "ODD";
if (n == 10) cout << "EVEN";
if (n == 11) cout << "ODD";
if (n == 12) cout << "EVEN";
if (n == 13) cout << "ODD";
if (n == 14) cout << "EVEN";
if (n == 15) cout << "ODD";
}

it works for example, but gives wrong answer for n = 100000, what is wrong???? please helppp

Full text and comments »

  • Vote: I like it
  • -40
  • Vote: I do not like it

By codepasta, history, 4 years ago, In English

Hello, codeforces! I decided to start a youtube channel related to competitive programming, featuring videos about algorithms and explaining in-depth problem solutions. It is targeted towards people with 1400-2000 rating.

I have already posted the first video: Number theory, modular inverse, diophantic equations — course. Please, give my channel a try. I would like to hear your opinions and suggestions :)

Full text and comments »

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

By codepasta, 4 years ago, In English

helloo, codeforce!!!11!

problem statement is: given a and b, print a + b. a and b <= 1000000000

why is this problem giving ''time limit exceedded''?????

here is my submisssion:

#include <iostream>

using namespace std;

int main()

{

int a, b;

int i;

int answerr = 0;

cin >> a;

cin >> b; for (i = 1; i<=a; i = i + 1) answerr = answerr + 1; for (i = 1; i<=b; i = i + 1) answerr = answerr + 1; cout << answerr; return 0; }

pleasse helppp, thank you!!111!!

Full text and comments »

  • Vote: I like it
  • -51
  • Vote: I do not like it

By codepasta, history, 4 years ago, In English

i am new to codeforce....... i dont know anything about this platfrom ....... where is the help buttoon?????? please helpp

Full text and comments »

  • Vote: I like it
  • -25
  • Vote: I do not like it