Skip to content

Instantly share code, notes, and snippets.

@kiritofeng
kiritofeng / BIT.cpp
Last active April 12, 2019 04:09
Wesley's Code Templates!
template <class T, const bool ONE_INDEXED, const int ...Args> struct FenwickTree {
T val;
void init() { val = 0; }
void update(T v) { val += v; }
T rsq() { return val; }
};
template <class T, const bool ONE_INDEXED, const int MAXN, const int ...Ns> struct FenwickTree <T, ONE_INDEXED, MAXN, Ns...> {
FenwickTree<T, ONE_INDEXED, Ns...> BIT[MAXN];
void init() { for (int i = 0; i < MAXN; i++) BIT[i].init(); }
#!/usr/bin/perl -p
s/\bEMAIL_THROTTLING\b/DMOJ_EMAIL_THROTTLING/g;
s/\bREJUDGE_SUBMISSION_LIMIT\b/DMOJ_SUBMISSIONS_REJUDGE_LIMIT/g;
s/\bCOMMENT_VOTE_HIDE_THRESHOLD\b/DMOJ_COMMENT_VOTE_HIDE_THRESHOLD/g;
s/\bMAX_USER_ORGANIZATION_COUNT\b/DMOJ_USER_MAX_ORGANIZATION_COUNT/g;
s/\bPP_STEP\b/DMOJ_PP_STEP/g;
s/\bPP_ENTRIES\b/DMOJ_PP_ENTRIES/g;
s/\bPP_BONUS_FUNCTION\b/DMOJ_PP_BONUS_FUNCTION/g;
s/\bPROBLEM_PDF_CACHE\b/DMOJ_PDF_PROBLEM_CACHE/g;
s/\bPROBLEM_PDF_INTERNAL\b/DMOJ_PDF_PROBLEM_INTERNAL/g;

Keybase proof

I hereby claim:

  • I am kiritofeng on github.
  • I am kiritofeng (https://keybase.io/kiritofeng) on keybase.
  • I have a public key ASCzLyo2gvmlvEQnHGJgC5022TRyeIbp4vIA5eu8Ri7Bhwo

To claim this, I am signing this object:

@kiritofeng
kiritofeng / info.sh
Created January 18, 2018 03:17
A script to print system information.
#!/usr/bin/env bash
#
# Created by Dylan Araps, modified by Roger Fu
# Copyright (c) 2016-2017 Dylan Araps
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the 'Software'), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@kiritofeng
kiritofeng / docs_todo.md
Last active April 29, 2019 19:08
DMOJ ToDo