競技プログラミング用テンプレ
#include <iostream> #include <cstdio> #include <iomanip> #include <vector> #include <map> #include <set> #include <queue> #include <bitset> #include <stack> #include <utility> #include <numeric> #include <algorithm> #include <functional> #include <cctype> #include <complex> #include <string> #include <sstream> #define all(c) c.begin(),c.end() #define rall(c) c.rbegin(),c.rend() #define rep(i,n) for(unsigned int i=0;i<(n);i++) #define tr(it,container) for(typeof(container.begin()) it = container.begin(); \ it != container.end(); ++it) typedef long long ll; const int dx[] = {1,0,-1,0}; const int dy[] = {0,-1,0,1}; const double EPS = 1e-9; const int days[] = {31,28,31,30,31,30,31,31,30,31,30,31}; const int daysleap[] = {31,29,31,30,31,30,31,31,30,31,30,31}; using namespace std; int main() { return 0; }
2012/12/31更新
なんかコメントとかで書いといたほうがいいんだろうか。
マクロの解説とかは
http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=standardTemplateLibrary
がすごい参考になった。
おまけ。なんか最大値とか。
#include <iostream> #include <limits> #include <iomanip> using namespace std; int main(){ cout << "Short" << endl; cout << " Max: " << numeric_limits<short>::max() << endl; cout << " Min: " << numeric_limits<short>::min() << endl; cout << "Int" << endl; cout << " Max: " << numeric_limits<int>::max() << endl; cout << " Min: " << numeric_limits<int>::min() << endl; cout << "Long Long" << endl; cout << " Max: " << numeric_limits<long long>::max() << endl; cout << " Min: " << numeric_limits<long long>::min() << endl; cout << "Float" << endl; cout << " Max: " << numeric_limits<float>::max() << endl; cout << " Min: " << numeric_limits<float>::min() << endl; cout << "Double" << endl; cout << " Max: " << numeric_limits<double>::max() << endl; cout << " Min: " << numeric_limits<double>::min() << endl; return 0; }