Skip to content

Instantly share code, notes, and snippets.

{
"cmd": ["g++", "-std=c++11", "${file}", "-o", "${file_base_name}.exe", "&&", "start", "cmd", "/k" , "$file_base_name"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"shell": true,
"variants":
[
{
All times are in GMT+7, Hanoi.
================================
Generated 20:22, March 24th 2018
================================
86067916 -- 12:32, March 25th 2018
45856040 -- 16:46, March 25th 2018
32356708 -- 11:57, March 30th 2018
32455175 -- 20:41, March 30th 2018
23532432 -- 19:43, March 31th 2018
{
"cmd": ["g++", "-std=c++17", "${file}", "-lncurses", "-o", "${file_base_name}.exe", "&&", "start", "cmd", "/k" , "$file_base_name"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"shell": true,
"variants":
[
{
#include <bits/stdc++.h>
using namespace std;
typedef long long int llint;
llint minPrimeFactor[100000000];
void sieveGen(llint limit)
{
minPrimeFactor[1] = 1;
bool comp_ (pair <int, int> n, pair <int, int> m)
{
return (n.second < m.second);
}
@minhducsun2002
minhducsun2002 / Solution~.md
Last active April 27, 2018 07:39
Solution~

Gọi hàm next(film_id, shift)b là hàm trả về bộ phim thứ shift sau film_id.

Dễ dàng có được next(film_id, 1) với mỗi film_id.

Dễ dàng tính được next(film_id, 2^p) với mỗi F và p.

Công thức truy hồi: next(film_id, 2^p) = next( next(film_id, 2^p-1), 2^p-1)

@minhducsun2002
minhducsun2002 / lis.cpp
Last active May 5, 2018 00:45
LIS using Patience Sorting
#include <bits/stdc++.h>
using namespace std;
typedef long long int llint;
const long long int LLINT_MAX = LLONG_MAX;
const long long int LLINT_MIN = LLONG_MIN;
vector <vector <llint> > sort_to_piles (vector <llint> arr)
{
@minhducsun2002
minhducsun2002 / environmentsetup_allheaders.cpp
Last active August 2, 2018 01:03
Precompiled list of headers and definitions
#include <cstdlib>
#include <bitset>
#include <functional>
#include <utility>
#include <ctime>
#include <chrono>
#include <cstddef>
#include <initializer_list>
#include <tuple>
#include <new>
@minhducsun2002
minhducsun2002 / arithmetic.cpp
Last active May 10, 2018 06:54
Arithmetic operations
#include <bits/stdc++.h>
char to_char(int i)
{
switch (i)
{
case 0: return '0'; case 1: return '1'; case 2: return '2';
case 3: return '3'; case 4: return '4'; case 5: return '5';
case 6: return '6'; case 7: return '7'; case 8: return '8'; case 9: return '9';
}
https://drive.google.com/drive/folders/1grWydVRbM3GkiQGmwb4v0DbfhmtvZsay?usp=sharing