すのはら荘春原庄的雪

Hi, Toretto!

You got to put the past behind you before you can move on.

  • 海上月是天上月,眼前人是心上人。
    线段树模板

    摘要: 本文只是自己存的模板,来源于https://www.cnblogs.com/xenny/p/9801703.html; 想学习线段树的请前往大佬的博客。 #include using namespace std; const int maxn=100005; int a

    Codeforces Round #782 (Div. 2)A,B题解

    摘要: A. Red Versus Blue Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of nn matches

    快速幂与矩阵快速幂模板

    摘要: 快速幂: long long fastPower(long long base, long long power) { long long result = 1; while (power > 0) { if (power & 1) { result = result * base % 1000;

    埃氏筛和欧拉筛

    摘要: 1.埃氏筛 思路:将所求范围内所有的数定义为素数,从最小的真实素数(即2)开始,将其倍数筛选出来定义为非素数,最后剩下的被定义为素数的数便是给定范围内所有的素数。 代码: 1 #include 2 using namespace std; 3 bool prime[10

    位运算

    摘要: 1.按位与(&): 运算规则:只有两个数的二进制同时为1,结果才为1,否则为0。 即 0 & 0= 0 ,0 & 1= 0,1 & 0= 0, 1 & 1= 1。 两个整数在按位与运算时每一位分别进行运算,如3&5=011&101=001=1; 按位或(|): 2.运算规则:参加运算的两个数只要两个

    Codeforces Round #781 (Div. 2)题解

    摘要: A. GCD vs LCM You are given a positive integer nn. You have to find 44 positive integers a,b,c,da,b,c,d such that a+b+c+d=na+b+c+d=n, and gcd(a,b)=lcm

    最小生成树

    摘要: 首先,生成树是指在一个连通图中的连通子图,hanyou图中全部n个顶点,但只有足以构成一棵树的n-1条边。一颗有n个顶点的生成树有且仅有n-1条边,如果生成树中再添加一条边,则必定成环。 而最小生成树则是指在连通网的所有生成树中,所有的代价和最小的生成树。 Kruskal算法 思路:初始边数为1,每

    Codeforces Round #780 (Div. 3)A-D题解

    摘要: A. Vasya and Coins Vasya decided to go to the grocery store. He found in his wallet aa coins of 11 burle and bb coins of 22 burles. He does not yet kn

    摘要: 本文只是自己存的模板,来源于https://www.cnblogs.com/xenny/p/9801703.html; 想学习线段树的请前往大佬的博客。 #include<bits/stdc++.h> using namespace std; const int maxn=100005; int a 阅读全文
    posted @ 2022-04-22 17:16 cbmango 阅读(27) 评论(0) 推荐(0) 编辑
    摘要: A. Red Versus Blue Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of nn matches 阅读全文
    posted @ 2022-04-20 17:09 cbmango 阅读(77) 评论(0) 推荐(0) 编辑
    摘要: 快速幂: long long fastPower(long long base, long long power) { long long result = 1; while (power > 0) { if (power & 1) { result = result * base % 1000; 阅读全文
    posted @ 2022-04-15 23:02 cbmango 阅读(33) 评论(0) 推荐(0) 编辑
    摘要: 1.埃氏筛 思路:将所求范围内所有的数定义为素数,从最小的真实素数(即2)开始,将其倍数筛选出来定义为非素数,最后剩下的被定义为素数的数便是给定范围内所有的素数。 代码: 1 #include<bits/stdc++.h> 2 using namespace std; 3 bool prime[10 阅读全文
    posted @ 2022-04-13 18:04 cbmango 阅读(298) 评论(1) 推荐(2) 编辑
    摘要: 1.按位与(&): 运算规则:只有两个数的二进制同时为1,结果才为1,否则为0。 即 0 & 0= 0 ,0 & 1= 0,1 & 0= 0, 1 & 1= 1。 两个整数在按位与运算时每一位分别进行运算,如3&5=011&101=001=1; 按位或(|): 2.运算规则:参加运算的两个数只要两个 阅读全文
    posted @ 2022-04-11 23:17 cbmango 阅读(114) 评论(0) 推荐(1) 编辑
    摘要: A. GCD vs LCM You are given a positive integer nn. You have to find 44 positive integers a,b,c,da,b,c,d such that a+b+c+d=na+b+c+d=n, and gcd(a,b)=lcm 阅读全文
    posted @ 2022-04-11 17:52 cbmango 阅读(168) 评论(0) 推荐(3) 编辑
    摘要: 首先,生成树是指在一个连通图中的连通子图,hanyou图中全部n个顶点,但只有足以构成一棵树的n-1条边。一颗有n个顶点的生成树有且仅有n-1条边,如果生成树中再添加一条边,则必定成环。 而最小生成树则是指在连通网的所有生成树中,所有的代价和最小的生成树。 Kruskal算法 思路:初始边数为1,每 阅读全文
    posted @ 2022-04-03 22:26 cbmango 阅读(74) 评论(0) 推荐(1) 编辑
    摘要: A. Vasya and Coins Vasya decided to go to the grocery store. He found in his wallet aa coins of 11 burle and bb coins of 22 burles. He does not yet kn 阅读全文
    posted @ 2022-04-01 23:14 cbmango 阅读(133) 评论(0) 推荐(2) 编辑
    摘要: A. Marin and Photoshoot Today, Marin is at a cosplay exhibition and is preparing for a group photoshoot! For the group picture, the cosplayers form a 阅读全文
    posted @ 2022-03-29 20:55 cbmango 阅读(101) 评论(3) 推荐(1) 编辑
    点击右上角即可分享
    微信分享提示