Skip to content

Instantly share code, notes, and snippets.

@GoBigorGoHome
GoBigorGoHome / main.cpp
Created July 11, 2018 18:26
CC July 18 Subway TLE solution
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define debug(x) cerr << #x <<": " << (x) << endl
//在每个函数的入口处执行一次,出口处执行一次。然后就可以快速得知是哪个地方段错误了
#define DEBUG printf("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__)
#ifdef LOCAL
@GoBigorGoHome
GoBigorGoHome / main.cpp
Last active July 13, 2018 13:58
CC July 18 Subway 重心分治的最后提交 1.99s
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define debug(x) cerr << #x <<": " << (x) << endl
//��个���������次�������次���就�以快�����个��段�误�
#define DEBUG printf("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__)
#ifdef LOCAL
@GoBigorGoHome
GoBigorGoHome / 【模板】树的点分治.cpp
Last active November 8, 2019 14:17
CodeChef July 18 SUBWAY
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define debug(x) cerr << #x <<": " << (x) << endl
#define DEBUG printf("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__)
#ifdef LOCAL
#define see(x) cout << #x << ": " << (x) << endl
@GoBigorGoHome
GoBigorGoHome / main.cpp
Created July 31, 2018 01:17
HDU 6319 从后往前维护滑动窗口最大值,可以算出窗口内从前往后最大值变化的次数。
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define debug(x) cerr << #x <<": " << (x) << endl
#define DEBUG printf("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__)
#ifdef LOCAL
@GoBigorGoHome
GoBigorGoHome / main.cpp
Created July 31, 2018 11:16
HDU 6327 Random Sequence 优化时间、空间的技巧
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define debug(x) cerr << #x <<": " << (x) << endl
#define DEBUG printf("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__)
#ifdef LOCAL
@GoBigorGoHome
GoBigorGoHome / install_opencv2_ubuntu.sh
Created September 19, 2018 04:49 — forked from arthurbeggs/install_opencv2_ubuntu.sh
Install OpenCV2 in Ubuntu
#!/bin/bash
################################################################################
### OpenCV2 Installation Script ###
################################################################################
# Source code at https://github.com/arthurbeggs/scripts #
################################################################################
# #
# Feel free to copy and modify this file. Giving me credit for it is your #
# choice, but please keep references to other people's work, which I don't #
@GoBigorGoHome
GoBigorGoHome / main.cpp
Last active November 8, 2019 13:59
hihoCoder #1100贪心:每次都选满足条件的disk中半径最大者。此贪心策略是错的,详见代码末尾注释中的反例。
#include <bits/stdc++.h>
using namespace std;
int main(){
#ifdef LOCAL
freopen("main.in", "r", stdin);
#endif
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int n,m, h, r;
@GoBigorGoHome
GoBigorGoHome / main.cpp
Created October 3, 2018 07:23
hihoCoder #1100 Disk Storage 正解。
#include <bits/stdc++.h>
using namespace std;
#define rf(i, cont) for (auto &i: cont) //range-for
#define SZ(x) (int)(x).size()
#define rep(n) for (int _ = 0; _ < (int)n; ++_)
#define all(x) x.begin(), x.end()
@GoBigorGoHome
GoBigorGoHome / main.cpp
Created October 3, 2018 07:53
hihoCoder 1100 Disk Storage update
#include <bits/stdc++.h>
using namespace std;
#define rf(i, cont) for (auto &i: cont) //range-for
#define SZ(x) (int)(x).size()
#define rep(n) for (int _ = 0; _ < (int)n; ++_)
#define all(x) x.begin(), x.end()
#include <bits/stdc++.h>
using namespace std;
#define rf(i, cont) for (auto &i: cont) //range-for
#define SZ(x) (int)(x).size()
#define rep(n) for (int _ = 0; _ < (int)n; ++_)
#define all(x) x.begin(), x.end()