摘要:
好难 #include<bits/stdc++.h> using namespace std; const int N = 1e6 + 5; const double pi = acos(-1); int n, m, rev[4 * N]; struct comp{ double x, y; com 阅读全文
摘要:
#include<bits/stdc++.h> using namespace std; const int L = 105; const int mod = 1e4 + 7; int n, m, cnt, ans = 1, tr[L * 60][30], fail[L * 60], dp[L][L 阅读全文
摘要:
能自动AC的机器(不是 简单版 #include<bits/stdc++.h> using namespace std; const int N = 1e6 + 5; int n, cnt, ans, fail[N], tr[N][30], flag[N]; string s, t; queue<i 阅读全文
摘要:
一个贪心算法,先排序,然后从小到大开始选边; 同时用并查集来维护两个点是否连通,如果当前边连接的两个点已经连通,那么说明选这条边没有任何意义,一定是劣的(因为前面已经排了序) #include<bits/stdc++.h> using namespace std; const int N = 500 阅读全文
摘要:
单点修改,区间查询树状数组,洛谷P3374 #include<bits/stdc++.h> using namespace std; const int N = 5e5 + 5; int n, m, a[N]; int query(int x){ int ans = 0; for(; x; x -= 阅读全文