题目链接:https://codeforces.com/contest/1999/problem/D #include<iostream>#include<string>#include<vector>usingnamespacestd;intmain(){intn; cin>>n;for(;n>0;n--){ string arr1; string arr2; cin>>arr1>>arr2;intt1=arr1.length();intt2=arr2.length();intdi=0,o=0;boolyes=0;boolyes...
https://codeforces.com/contest/1516/problem/B Baby Ehab is known for his love for a certain operation. He has an arrayaa of lengthnn, and he decided to keep doing the following operation on it: he picks22 adjacent elements; he then removes them and places a single integer in their plac...
https://codeforces.com/problemset/problem/1304/E 用lca求树上距离 只有3种情况 a->b a->x+x->y+y->b a->y+y->x+x->b 因为距离过长就可以来回走,所以k-len得是偶数 #include <iostream>#include<cstdio>#include<cstdlib>#include<algorithm>#include<cmath>#include<cstring>#defineinf 21474836...
https://codeforces.com/problemset/problem/525/E 每个仙女有三种情况,枚举一下,n对半分,使得复杂度变成o(k*3^(n/2)) 用map统计的时候,每次如果跑for的话会有很多重复的,这样可以直接存下来前缀和 for(auto i:mp){for(intj=1;j<=25;j++){ mp[i.first][j]+=mp[i.first][j-1]; } } 我第一...
https://codeforces.com/problemset/problem/1304/E 用lca求树上距离 只有3种情况 a->b a->x+x->y+y->b a->y+y->x+x->b 因为距离过长就可以来回走,所以k-len得是偶数 #include <iostream>#include<cstdio>#include<cstdlib>#include<algorithm>#include<cmath>#include<cstring>#defineinf 21474836...
[E. Ehab's REAL Number Theory Problem](https://codeforces.com/contest/1325/problem/E) 数论+图论 求最小环 E. Ehab's REAL Number Theory Problem 数论+图论 求最小环 题目大意: 给你一个n大小的数列,数列里的每一个元素满足以下要求: 数据范围是:1<=ai<=1061<=ai<=106 aiai 最多只有7个因数 ...