codepasta's blog

By codepasta, 4 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)$$$).
  • Vote: I like it
  • -5
  • Vote: I do not like it

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

Unordered maps and sets are vulnerable to collision attacks. I wouldn't recommend that macro

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

    Ok, I will mention that in my blog. You can comment out that macro from the template

»
4 months ago, # |
  Vote: I like it +52 Vote: I do not like it

Brother's plan is to first distribute this template then hack everyone.

Lol

»
4 months ago, # |
  Vote: I like it +13 Vote: I do not like it

It is unclear, why should one make macro for

std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);

because there is no need to type these lines more than once.
Also, #pragma GCC optimize("O0") is even harmful, because O0 is the weakest level of optimization, while the highest is O3 or even Ofast (note: almost alwaysO2 suffices — it is enabled on Codeforces by default)

»
4 months ago, # |
  Vote: I like it +69 Vote: I do not like it

return 1; — this tells the operating system the program has high priority 1, instead of normal 0. this will make judging faster.

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

Just being online everyday won't change anything, you have to take action to help.