/images/avatar.png

^_^

test

Button

Try Element

Cloud

fail to load fail to load fail to load fail to load fail to load fail to load

Game



Watch_Dogs2           Watch Dogs: Legion       Forza Horizon 4



Forza Horizon 5          Dishonored           Dishonored 2



Assassin's Creed 2         Assassin's Creed Brotherhood  Assassin's Creed Unity



Assassin's Creed Origins      Assassin's Creed Odyssey      Assassin's Creed Valhalla



Metro Exodus           PUBG              Dota 2



CS:GO                Grand Theft Auto V         Riders Republic



PoP: The Sands of Time      PoP: Warrior Within        PoP: The Two Thrones



HITMAN 2            Human: Fall Flat          SCP: Secret Laboratory



Cyberpunk 2077          Sekiro: Shadows Die Twice    Battlefield 1



Steep               Notch              Halo: Combat Evolved



DARK SOULS III          Apex Legends          Overwatch



It Takes Two            NieR:Automata         Tomb Raider



Life is Strange - Episode 1     Yakuza 0             The Witcher 3: Wild Hunt



Left 4 Dead            Subnautica            Devil May Cry 5



FINAL FANTASY XV        ICEY               God of War



课设测试(临时)


实验一 实验二 实验三 实验四 实验五 清空 例子

二进制表示集合

以二进制的原理表示集合,以整数呈现

1表示在集合内,0表示不在集合内

一位运算优先于按位逻辑运算

空集 0 只含有第i个元素的集合{i}       1«i 含有全部n个元素的集合 {0,1,2,…n-1}      (1«n) - 1 判断第i个元素是否属于集合S           if ( s»i & 1 ) 原来的集合变了 向集合中加入第i个元素 S∪{i}          S|1«i 从集合中去除第i个元素 S{i}             S&~(1«i) 集合S和T的并集                               S|T 集合S和T的交集                           S&T

Number Theory

求最大公约数和最小公倍数

辗转相除法

时间复杂度O(log(max(a,b)))

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
int gcd(int a,int b)
{
	if(b==0) return a;
	else return gcd(b,a%b);
}

int lcm(int a,int b)
{
	return a*b/gcd(a,b);
}

或直接调用algorithm库中的__gcd(int a,int b)  

hduoj2089(数位dp + 记忆化搜索)

Problem Description

杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。 杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。 不吉利的数字为所有含有4或62的号码。例如: 62315 73418 88914 都属于不吉利号码。但是,61152虽然含有6和2,但不是62连号,所以不属于不吉利数字之列。 你的任务是,对于每次给出的一个牌照区间号,推断出交管局今次又要实际上给多少辆新的士车上牌照了。

Segment Tree

线段树是把区间分割,然后把数据按树存储的数据结构。线段树是一颗完美二叉树

用一个例子来介绍线段树

RMQ(range minimum query)

实现功能 对于一个数列 1.给定s,t求[s,t)区间的最小值(最大值) 2.给定i和x,把ai改成x

Graph Theory

图的存储:邻接表、邻接矩阵、前向星、链式前向星等

链式前向星存图

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
struct edge{
	int to , w , next;
}e[maxn];
int tot,head[maxn];

void add_edge(int u,int v,int w){
	e[tot].to = v;
	e[tot].w = w;
	e[tot].next = head[u];
	head[u] = tot++;
}

for(int i=head[u];~i;i=e[i].next){
	int v = e[i].to;
	int w = e[i].w;
}

//init
memset(head , -1 , sizeof(head));

二分图判定

通过着色来判定,整个图只染两种颜色,如果相邻点颜色不同就是二分图

poj

线段相交

1127

题意

判断两条线段是否相交,对于N条线段,间接相交也算相交。对于每次询问,判 断给定的两条线段是否相交

题解

这个题目分成两部分,一部分是基础的判断两条线段是否相交,用一个bool数组来存储信息。另一部分是判断间接相交,可以用floyd-warshall(比较巧妙)或者并查集.第一部分就是套模板。