随笔分类 - 寒假写题历程
摘要:题有在写,但是没兴致贴了……反正就是水吧orz 过几天继续回学校受虐,趁着还在家,好好享受度假。 又是个碌碌无为的假期啊。
阅读全文
摘要:水题放送,写得依旧丑: 1 #include <cstdio> 2 #include <cstring> 3 #include <cmath> 4 #include <algorithm> 5 #include <vector> 6 using namespace std; 7 8 const in
阅读全文
摘要:BZOJ1012,特点是只往后加所以可用单调栈。亦可无脑线段树。 1 #include <bits/stdc++.h> 2 #define ll long long 3 using namespace std; 4 5 int m; 6 ll D, last; 7 ll q[200005]; 8 i
阅读全文
摘要:cf818A 1 #include <bits/stdc++.h> 2 #define ll __int64 3 using namespace std; 4 5 ll n, k; 6 7 int main() { 8 cin >> n >> k; 9 ll a = n / 2 / (k+1); 1
阅读全文
摘要:HDU3401,列完转移方程拆分一下,正着、反着跑优先队列优化代表买或卖。初始化不大会搞…… 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 const int inf = 0x3f3f3f3f; 5 const int maxn = 20
阅读全文
摘要:BZOJ1005,给了度就有prufer序,排列组合。 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 struct BigInt { 5 int a[10005], len; 6 7 BigInt() { 8 memset(a, 0, s
阅读全文
摘要:BZOJ1001,裸网络流,对偶图做法比较有趣但在这道题上好像有点花哨? 1 #include <bits/stdc++.h> 2 #define ri readint() 3 #define wi(x) writeint(x) 4 #define gc getchar() 5 #define pc
阅读全文
摘要:CF618C,水啊。 1 #include <bits/stdc++.h> 2 #define ll long long 3 using namespace std; 4 5 struct point { 6 ll x, y; 7 int id; 8 bool operator < (const p
阅读全文
摘要:石子合并,入门区间dp 1 #include <cstdio> 2 #include <cstring> 3 #define maxn 305 4 #define min(a, b) a < b ? a : b 5 6 int n; 7 int sum[maxn]; 8 int f[maxn][ma
阅读全文
摘要:自然数拆分,完全背包 1 #include <cstdio> 2 #define ll long long 3 #define mod 2147483648 4 #define rep(i, a, b) for (int i = a; i <= b; i++) 5 6 int n; 7 ll f[4
阅读全文
摘要:Joyoi Mobile Service,第一维:阶段,第几时刻;第二第三维:不安定因素,两个服务员的位置;省略第四维:肯定在p[i-1]。 1 #include <bits/stdc++.h> 2 using namespace std; 3 #define rep(i, a, b) for (i
阅读全文
摘要:UVA11992,自己板子真心难调bugwoc 1 #include <bits/stdc++.h> 2 #define maxn 50005 3 using namespace std; 4 5 struct Seg { 6 int l, r; 7 int sum, maxx, minn; 8 }
阅读全文
摘要:洛谷3372,才开始学segment tree,初级板子。 1 #include <cstdio> 2 #define ll long long 3 #define maxn 100001 4 5 int n, m; 6 ll a[maxn], sum[maxn << 2], tag[maxn <<
阅读全文
摘要:joyoi楼兰图腾,树状数组求逆序对的题,joyoi过不去,contesthunter过去了…… 1 #include <cstdio> 2 #include <cstring> 3 #define ll long long 4 #define init(a, b) memset(a, b, siz
阅读全文