Skip to content

Instantly share code, notes, and snippets.

View ititorit's full-sized avatar

Nguyễn Minh Tuấn ititorit

View GitHub Profile
@ititorit
ititorit / LIS.cpp
Created September 20, 2016 22:23
SPOJ LIS
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for(int i = a; i <= b; i++)
#define FORD(i, a, b) for(int i = a; i < b; i++)
#define REP(i, a, b) for(int i = a; i >= b; i--)
#define REPD(i, a, b) for(int i = a; i > b; i--)
#define DEBUG(x) { cout << #x << " = " << x << endl; }
@ititorit
ititorit / ROUD1APROA.cpp
Last active September 20, 2016 22:22
SPOJ ROUND 1A - Số gần nguyên tố
#include <bits/stdc++.h>
#define _for(i,a,b) for(int i=(a),_b_=(b),_d_=(a<b?1:-1);i!=_b_;i+=_d_)
#define FOR(i,a,b) for(int i = a; i <= b; i++)
#define _it(i,v) for (typeof((v).begin()) i = (v).begin(); i != (v).end(); ++i)
#define _all(v) v.begin(), v.end()
#define DEBUG(x) { cout << #x << " = " << x << endl; }
#define sqr(x) ((x)*(x))