摘要:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
摘要:
题目要求我们进行多次操作,每次任选x(x>=2),$a_i$->$a_i$%x,使得每个数都相同 当数组中没有1时,我们可以通过有限次操作将数组全部变为0,(0%x=0) 当数组中有1时(x>=2,所以除数无法取1),当数组有一对连续的数时(如1和2),我们取任何数都无法让其相同 #define _ 阅读全文
摘要:
2015-2016 ACM-ICPC, NEERC, Northern Subregional Contest A - Alex Origami Squares 长为h, 宽为w 如果w * 3 > h,则正方体边长为w 如果w * 3 < h,则正方体边长为max(h / 3, w / 2) #i 阅读全文
摘要:
分解质因数,对于$\forall$ $x$$\in$ [1, m],来说,任意一个质因数的倍数及其本身都与题目中给定的数的最大公约数,至少有一个不是1 #include <iostream> using namespace std; const int N = 1e5 + 10; bool st[N 阅读全文
摘要:
一道全排列的题,可以用dfs,也可以用stl内置的函数next_permutation ####dfs版本 #include <algorithm> #include <iostream> #include <vector> using namespace std; vector<string> c 阅读全文
摘要:
需要string头文件 string a; a.resize(100); scanf("%s", &a[0]);//通过a的首地址输入 printf("%s", a.c_str()); //c_str()获取字符串首地址 阅读全文
摘要:
###方法一 筛一次素数,然后遍历即可 #include <iostream> using namespace std; const int N = 1e7 + 10; bool st[N]; int p[N], cnt; void get() { st[1] = 1; for (int i = 2 阅读全文
摘要:
模拟题,注意判断条件 #include <iostream> #include <map> using namespace std; string a; map<int, int> t; int maxx = 0, minn = 0; void solve() { int l = 0, r = a. 阅读全文
摘要:
先跑一次最短路,然后通过动态规划找出最短路的个数 #include <algorithm> #include <cstring> #include <iostream> #include <queue> using namespace std; typedef long long ll; const 阅读全文
摘要:
本质上是最短路+二分 本题要求是再求最短路的基础上限制边长,边长最长是 $dis*(1 + x / 100)$,在求出限制边长后,可以通过二分找出答案 在二分中,大于限制边长的不予考虑 #include <cstring> #include <iostream> #include <queue> u 阅读全文