模板
知非与非
1900·Lemon:}
展开
-
线段树1.0 求区间sum
哇第一次手写线段树好激动好激动好激动! #include #include #include #include #include using namespace std; int a[20000+5]; struct node { int l, r, sum; }tree[20000*4]; int ans; int built(int root, int l, int r原创 2017-07-28 13:59:53 · 204 阅读 · 0 评论 -
二分2.0(double)
The main road in Bytecity is a straight line from south to north. Conveniently, there are coordinates measured in meters from the southernmost building in north direction. At some points on the road原创 2017-07-27 21:14:43 · 397 阅读 · 0 评论 -
二分1.0
#include #include #include using namespace std; int main() { int t; scanf("%d", &t); while(t--) { int n, m;//二分m scanf("%d%d", &n, &m); int i, j, x, znum = 0; int flag[m+5]; memset(flag原创 2017-07-27 20:20:27 · 134 阅读 · 0 评论