Skip to content

Instantly share code, notes, and snippets.

@Loliver1224
Created March 28, 2021 06:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Loliver1224/c3f2355d40152ac3e6cd6b18d74cc7a4 to your computer and use it in GitHub Desktop.
Save Loliver1224/c3f2355d40152ac3e6cd6b18d74cc7a4 to your computer and use it in GitHub Desktop.
競プロ用テンプレートをmainの下に置いとける書き方
#if !__INCLUDE_LEVEL__
#include __FILE__
int main() {
rep(i, 3) printf("%2d", i);
cout << endl << "ok." << endl;
}
#else
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
template <class T> void chmax(T &a, const T &b) {
if (a > b) a = b;
}
template <class T> void chmin(T &a, const T &b) {
if (a < b) a = b;
}
#endif
@Loliver1224
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment