Skip to content

Instantly share code, notes, and snippets.

@minhducsun2002
minhducsun2002 / shortener_backlog.mapping
Last active July 19, 2018 14:53
Shortened link directory for cipherallies.me
source = https://github.com/minhducsun2002/minhducsun2002.github.io
google = https://google.com.vn
shsgs = http://shsgs.simpleguy.tech
@minhducsun2002
minhducsun2002 / lcs-fix.cpp
Last active June 21, 2018 03:58
Fix for LCS code
#include <bits/stdc++.h>
using namespace std;
typedef long long int llint;
typedef long int ullint;
const long long int MAX_STRING_SIZE_A = 1000;
const long long int MAX_STRING_SIZE_B = 1000;
llint arr[MAX_STRING_SIZE_A][MAX_STRING_SIZE_B];
#include <bits/stdc++.h>
#define MOD 1000000007
#define pb push_back
#define bw(i,r,l) for (int i=r-1;i>=l;i--)
#define fw(i,l,r) for (int i=l;i<r;i++)
using namespace std;
typedef pair<int,int> ii;
string s,t; int dp[101][101];
ii r[101][101];
void get(int i,int j) {
#include <stdio.h>
#include <vector>
#include <queue>
using namespace std;
const int oo = 1000111000;
vector< pair <int, int> > a[2309];
int n, m;
@minhducsun2002
minhducsun2002 / GNU C++.sublime-build
Last active July 23, 2018 08:44
Sublime Text build system for GNU/Linux
{
// Sublime Text build system for GNU/Linux
"cmd": ["g++ \"${file}\" -o \"${file_path}\/${file_base_name}\" && echo \"Target binary is at \"\"${file_path}\/${file_base_name}\""],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
// "selector": "source.c, source.c++, source.cpp",
"selector": "source.c",
"shell": true,
"variants":
@minhducsun2002
minhducsun2002 / template.cpp
Last active July 23, 2018 08:47
C++ template for I/O from file
#include <bits/stdc++.h>
using namespace std;
#ifdef ENG
string filename = "hash2";
string input_ext = "inp", output_ext = "out", debug_ext = "debugging";
string input_filename = filename + '.' + input_ext,
output_filename = filename + '.' + output_ext,
debug_filename = filename + '.' + debug_ext;
#endif
36508, 55438, 54144, 46780, 60202
gcc filename.c -o filename
@minhducsun2002
minhducsun2002 / Timus_1423.cpp
Created August 8, 2018 10:14
Solution for Timus Online Judge, problem 1423 ('String Tale')
#include <bits/stdc++.h>
using namespace std;
// migrated from https://ideone.com/P4Yq6X
typedef int32_t llint;
// https://github.com/minhducsun2002/Algorithms-Implementations/blob/master/String/String%20Matching/KnuthMorrisPratt.cpp
void partial_match_compute (string pattern, vector <llint>& table)
{
llint length = 0;
table.front() = 0;
@minhducsun2002
minhducsun2002 / debian.config
Last active August 9, 2018 10:43
My personal kernel configuration.
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 4.17.13-zen1 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"