多校
Zaller
acm退休,考研ing...
无偿给同校学弟学妹们解答;
博客若有看不懂的或者不对的地方,直接私信我就行(如果我回复晚了,对不起都是我的错);
不用太客气等我回复,有问题直接私信发:)
ps: 随缘上线
展开
-
2020 Multi-University Training Contest 8
Auto-correctionBreaking Down NewsClockwise or Counterclockwise#include <bits/stdc++.h>using namespace std;typedef long long ll;int main() { int t; scanf("%d", &t); while (t--) { ll x1, y1, x2, y2, x3, y3; scan原创 2020-08-22 19:13:00 · 167 阅读 · 0 评论 -
2020 Multi-University Training Contest 7
Animism Bitwise Xor Counting Decision Expectation FlowerGame Heart Increasing and DecreasingJoggingKcats原创 2020-08-22 19:09:58 · 226 阅读 · 0 评论 -
2020 Multi-University Training Contest 10
Anti-hash TestNetwork TestMine Sweeper随机生成#include <bits/stdc++.h>using namespace std;#define between(x, a, b) (a<=x && x<=b)const int dir[8][2] = {1, 0, 0, 1, -1, 0, 0, -1, -1, -1, -1, 1, 1, -1, 1, 1};int n;map<int, vector原创 2020-08-20 20:47:49 · 245 阅读 · 0 评论 -
2020 Multi-University Training Contest 4
1001 Anti-AK ProblemBlow up the Enemy #include <bits/stdc++.h>using namespace std;typedef long long ll;const long long INF = 0x3f3f3f3f3f3f3f3f;const int N = 5e3 + 10;struct wapon { ll a, d; ll val;} s[N];int main() { int t; s原创 2020-08-18 19:49:42 · 238 阅读 · 0 评论 -
2020 Multi-University Training Contest 3
Tokitsukaze and Multiple10510^5105 的区间,显然不能用两个for把所有的区间和求出来,将每个前缀和 %p\% p%p,如果前缀和 sum[i] = sum[ i前面某个位置 k],说明 a[k]+a[k+1]+…+a[i] 是 p 的倍数,是可以合并的一个区间,dp找答案最大值#include <bits/stdc++.h>using namespace std;typedef long long ll;const int N = 1e6 + 1原创 2020-08-17 21:34:29 · 305 阅读 · 0 评论 -
2020 Multi-University Training Contest 2
1001 Total Eclipse 1002 Blood Pressure Game 1003 Count on a Tree II Striking Back1004 Diamond Rush1005 New Equipments 1006 The Oculus1007 In Search of Gold 1008 Dynamic Convex Hull 1009 It’s All Squares 1010 Lead of Wisdom 1011 King of Hot Pot原创 2020-08-15 12:49:36 · 417 阅读 · 0 评论 -
2020牛客暑期多校训练营(第九场)
Groundhog and 2-Power Representations = input()n = len(s) a = []for i in range(len(s)): if s[i] == '(': a.append(-1) elif s[i] == ')': a.append(-2) elif s[i] == '+': a.append(-3) else: a.append(int(s[i])原创 2020-08-09 14:30:03 · 315 阅读 · 0 评论 -
2020 Multi-University Training Contest 6
Road To The 3rd Building期望 = 区间的权值 * 区间出现的次数当 n=3n=3n=3E(x)=∑x×p(x)=a1+12(a1+a2)+13(a1+a2+a3)+a2+12(a2+a3)+a3n(n+1)2E(x)=\sum x\times p(x)=\cfrac{ a_1+\frac{1}{2}(a_1+a_2)+\frac{1}{3}(a_1+a_2+a_3)+a_2+\frac{1}{2}(a_2+a_3)+a_3}{\cfrac{n(n+1)}{2}}E(x)=∑x×原创 2020-08-06 19:11:00 · 361 阅读 · 0 评论 -
2020 Multi-University Training Contest 1
Fibonacci Sum赛中交的代码赛后疯狂T,感谢测评姬放过……原创 2020-08-05 20:32:04 · 395 阅读 · 1 评论 -
2020牛客暑期多校训练营(第七场)
A Social DistancingB Mask Allocation#include <bits/stdc++.h>using namespace std;const int N = 1e6 + 10;int res[N], tot;int n, m, k;int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int T; cin >> T;原创 2020-08-05 18:50:09 · 274 阅读 · 0 评论 -
2020 Multi-University Training Contest 5
Tetrahedron1h2=1a2+1b2+1c2\cfrac{1}{h^2}=\cfrac{1}{a^2}+\cfrac{1}{b^2}+\cfrac{1}{c^2}h21=a21+b21+c21E(x+y)=E(x)+E(y)E(x+y)=E(x)+E(y)E(x+y)=E(x)+E(y)#include <bits/stdc++.h>using namespace std;typedef long long ll;const ll mod = 998244353;c原创 2020-08-04 20:43:39 · 323 阅读 · 0 评论 -
2020牛客暑期多校训练营(第八场)
A All-Star Game B Bon VoyageC Cinema D Disgusting Relationship E Enigmatic Partition F Factorio G. Game SET#include <bits/stdc++.h>using namespace std;const int N = 1e6 + 10;int n;string str[13] = { "one", "two", "three",原创 2020-08-03 21:11:23 · 445 阅读 · 0 评论 -
2020牛客暑期多校训练营(第六场)
A African SortB. Binary Vector#include <bits/stdc++.h>using namespace std;typedef long long ll;const ll mod = 1e9 + 7;const int M = 2e7;int n;ll qpow(ll a, ll b) { a %= mod; ll res = 1; while (b) { if (b & 1)res = res原创 2020-08-02 16:47:02 · 1261 阅读 · 0 评论 -
宁波市多校训练(二)
LCA!任意根求lca:lca(root,u,v)lca(u,v)、lca(root,u)、lca(root,v)三者中深度最大的那个点坑点:cin输入会T#include <bits/stdc++.h>using namespace std;const int N = 1e5 + 10;vector<int> e[N];int n, m, k;int Log[N];//log2(x)int fa[N][20];int dep[N];//树的深度//常数初原创 2020-08-02 09:34:49 · 341 阅读 · 0 评论 -
2020牛客暑期多校训练营(第五场)
A Portal [B. Graph]C Easy D Drop VoicingE Bogo Sort [F DPS]G Greetings Souvenir H IntervalI Hard Math Problem J Cone walker K Git Merge原创 2020-07-30 20:06:40 · 249 阅读 · 0 评论 -
2020牛客暑期多校训练营(第四场)
A Ancient DistanceB Basic Gcd ProblemC Count New StringD Dividing StringsE Eliminate++ F Finding the Order G Geometry Challenge H Harder Gcd ProblemI Investigating LegionsJ Jumping on the Graph原创 2020-07-29 21:33:10 · 198 阅读 · 0 评论 -
2020牛客暑期多校训练营(第一场)
A. B-Suffix ArrayB Infinite Tree C Domino D Quadratic Form E Counting Spanning Trees F Infinite String Comparision G BaXianGuoHai, GeXianShenTongH Minimum-cost FlowI. 1 or 2拆边拆点,最后进行边的端点与点的匹配建图原理见下面这篇博客↓据说是原题来着:HDUOJ 3551 Hard Problem#includ原创 2020-07-28 22:25:41 · 290 阅读 · 0 评论 -
2020牛客暑期多校训练营(第三场)
A. Clam and FishB. Classical String ProblemC. Operation Love识别左右手方法1:将旋转的图形掰正几个知识点:直线的斜率可以通过 c++函数 atan2(Δy,Δx)atan2(\Delta y,\Delta x)atan2(Δy,Δx) 求出,其返回的是弧度,即当斜率为90°时atan2(90°)=1.57atan2(90°)=1.57atan2(90°)=1.57c++的 sin(x)\sin(x)sin(x) cos(x原创 2020-07-27 21:43:57 · 362 阅读 · 0 评论 -
2020牛客暑期多校训练营(第二场)
A All with Pairs B. BoundaryC. Cover the Tree#include <bits/stdc++.h>using namespace std;const int N = 1e6 + 10;int n, m, k;vector<int> v;vector<int> e[N];void dfs(int u, int fa) { if (e[u].size() == 1) v.push_back(u);原创 2020-07-27 11:47:57 · 311 阅读 · 1 评论