Skip to content

Instantly share code, notes, and snippets.

@kaisugi
Last active October 6, 2021 01:01
Show Gist options
  • Save kaisugi/960a2609e7924bb0bba6496b0b5a150d to your computer and use it in GitHub Desktop.
Save kaisugi/960a2609e7924bb0bba6496b0b5a150d to your computer and use it in GitHub Desktop.
競プロ 環境構築

一応現時点で使っているものをメモしておく。

  • C++14 を想定
  • VSCode で C/C++ (ms-vscode.cpptools) と C++ Intellisense (austin.code-gnu-global) という拡張を入れる
  • VSCode の settings.json に以下を加える(これは不要?)
    "C_Cpp.updateChannel": "Insiders",
    "C_Cpp.default.compilerPath": "/usr/bin/g++",
    "C_Cpp.default.cppStandard": "c++14",
    "C_Cpp.default.intelliSenseMode": "gcc-x64",
    "C_Cpp.default.includePath": ["/usr/local/include"],
    "clang.cxxflags": [
        "-std=c++14"
    ],
CC = g++
CFLAGS = -Wall -std=c++17
pro: problem.cpp
$(CC) $(CFLAGS) -o pro -g problem.cpp
test:
./pro < test_input
comp:
(./pro < test_input) > tmp
diff tmp test_output
rm tmp
new:
cp template.cpp problem.cpp
clean:
rm pro
testpy:
python problem.py < test_input
comppy:
(python problem.py < test_input) > tmp
diff tmp test_output
rm tmp
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <vector>
#define Rep(i, n) for(int i=0;i<n;++i)
#define rep(i, n) for(int i=1;i<=n;++i)
#define ll long long int
#define ld long double
#define INF 1e9
#define LINF 1e18
#define MOD 1000000007
#define PI 3.14159265359
#define EPS 1e-10
#define BITMAX 30
#define All(a) (a).begin(), (a).end()
using namespace std;
using P = pair<ll, ll>;
// using P = pair<ld, ld>;
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
/**
* Usage:
*
* G[from].push_back(Edge(to, weight));
* using Graph = vector<vector<Edge>>;
*
*/
struct Edge {
int to;
ll weight;
Edge(int t, ll w) : to(t), weight(w) { }
};
/**
* Usage:
*
* chmin(old, new);
* chmax(old, new);
*
*/
template<class T> inline bool chmin(T& a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template<class T> inline bool chmax(T& a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template<typename T>
void printv(vector<T>& v) {
if (v.size() == 0) {
cout << "\n";
return;
}
Rep(i, v.size()) {
cout << v[i] << ((i + 1 < v.size()) ? ' ' : '\n');
}
}
int main () {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment