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 / MeetingRooms.cpp
Created October 12, 2016 07:25
Meeting Rooms ACM/ICPC 2016
// Link Contest: https://drive.google.com/file/d/0BwNqLoGeu3p0ajFCMjZFRW1rVjA/view?pli=1
// Author : Nguyen Minh Tuan
// lang : C/C++
#include <algorithm>
#include <functional>
#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
@ititorit
ititorit / BCPOW.cpp
Created October 11, 2016 08:49
BCPOW SPOJ
// contest: http://www.spoj.com/PTIT/problems/BCPOW/
// author : Nguyen Minh Tuan
// lang : C/C++
// Lưu ý: Mình ở đây sử dụng Big Int để làm bài này nên nếu bạn nào có thuật toán tốt hơn thì có thể sửa lại...
#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()
@ititorit
ititorit / BCINCSEQ.cpp
Created October 11, 2016 07:26
BCINCSEQ SPOJ
// contest: http://www.spoj.com/PTIT/problems/BCINCSEQ/
// author : Nguyen Minh Tuan
// lang : C/C++
// algo : Dynamic Programming
#include <algorithm>
#include <functional>
#include <iostream>
#include <stdlib.h>
#include <string.h>
@ititorit
ititorit / P153SUMC.cpp
Created October 11, 2016 06:05
P153SUMC spoj
// contest: http://www.spoj.com/PTIT/problems/P153SUMC
// author : Nguyen Minh Tuan
// lang : C/C++
// problem very very excited...
#include <algorithm>
#include <functional>
#include <iostream>
#include <stdlib.h>
#include <string.h>
@ititorit
ititorit / SUMSQR1.cpp
Created October 8, 2016 02:44
SUMSQR1 - Tổng bình phương SPOJ
// contest: http://www.spoj.com/PTIT/problems/SUMSQR1/
// author : Nguyen Minh Tuan
// lang : C/C++
#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 FORD(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()
@ititorit
ititorit / SUMDIV.cpp
Created October 8, 2016 02:36
SUMDIV spoj
// contest: http://www.spoj.com/PTIT/problems/SUMDIV/
// author : Nguyen Minh Tuan
// lang : C/C++
#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 FORD(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)
@ititorit
ititorit / YOUNGCLA.cpp
Created October 8, 2016 02:05
YOUNGCLA - Birthdates spoj
// contest: http://www.spoj.com/PTIT/problems/YOUNGCLA/
// author : Nguyen Minh Tuan (ititorit)
// lang : C/C++
#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 FORD(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()
@ititorit
ititorit / BCPERMU.cpp
Created October 7, 2016 06:54
BCPERMU SPOJ
#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 FORD(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))
@ititorit
ititorit / PTIT127G.cpp
Created October 3, 2016 10:25
PTIT127G SPOJ
// contest: http://www.spoj.com/PTIT/problems/PTIT127G/
// author : Nguyen Minh Tuan
// lang : C/C++
#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 FORD(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)
@ititorit
ititorit / PTIT135I.cpp
Last active September 30, 2016 16:02
PTIT135I SPOJ
// contest: http://www.spoj.com/PTIT/problems/PTIT135I/
// author : Nguyen Minh Tuan(ititorit)
// lang : C/C++
#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 FORD(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)