2019-11-05 16:02:45 C++

競プロ用C++テンプレート

Copy Copied! Full
#include <bits/stdc++.h> using namespace std; typedef long long ll; // #define int long long #define REP(i, n) for (int i = 0; i < (n); i++) #define REPS(i, r, n) for (int i = (r); i < (n); i++) #define REPR(i, n) for(int i = (n); i >= 0; i--) // from n to 0 #define REPRS(i, r, n) for(int i = (n); i >= (r); i--) // from n to r #define COUTB(x) cout << (x) << "\n" #define COUTS(x) cout << (x) << " " #define PB push_back #define ALL(obj) (obj).begin(), (obj).end() #define MOD 1000000007 #define PI (acos(-1)) bool IsPrime(int); /***** MAIN *****/ signed main() { cout << "\n"; return 0; } /***** MAIN *****/ bool IsPrime(int a) { if(a <= 1) return false; if(a == 2) return true; if(a%2 == 0) return false; for(int i = 3; i*i <= a; i+=2) { if(a%i==0) return false; } return true; }
競プロ用C++テンプレート
RECOMMEND