自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

短发

啦啦啦~~~

  • 博客(40)
  • 收藏
  • 关注

原创 数论题集1-4(扩展欧几里得)-- POJ - 2142 The Balance

The BalanceTime Limit: 5000MS   Memory Limit: 65536K Total Submissions: 8601   Accepted: 3735 DescriptionMs. Iyo Kiffa-Australis has a balance and only two kinds of weights to meas...

2018-07-30 18:21:52 224

原创 Play on Words UVA - 10129(欧拉道路)

Some of the secret doors contain a very interesting word puzzle. The team of archaeologists has to solve it to open that doors. Because there is no other way to open the doors, the puzzle is very impo...

2018-07-30 17:00:56 188

原创 数论题集1-3(扩展欧几里得)--Raising Modulo Numbers(快速幂取模)

Raising Modulo NumbersTime Limit: 1000MS   Memory Limit: 30000K Total Submissions: 10336   Accepted: 6288 DescriptionPeople are different. Some secretly read magazines full of inte...

2018-07-30 09:58:28 186

原创 数论题集1-2(扩展欧几里得)--C Looooops

C LooooopsTime Limit: 1000MS   Memory Limit: 65536K Total Submissions: 31493   Accepted: 9147 DescriptionA Compiler Mystery: We are given a C-language style for loop of type for...

2018-07-30 09:19:04 134

原创 数论题集1-1(扩展欧几里得)--poj1061-青蛙的约会

青蛙的约会 Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 127227   Accepted: 27556 Description 两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上...

2018-07-28 09:27:52 117

原创 扩展欧几里得应用2(数论)

题目描述【题意】已知a,b,m,求x的最小正整数解,使得ax=b(mod m)【输入格式】一行三个整数 a,b,m。 1 ≤ a,b,m ≤ 10^9 【输出格式】一行一个整数x,无解输出"no solution!"【样例输入】2 5 7【样例输出】6解释:这题通俗讲就是 ax mod m=b mod m那么 b 是个常数,所以直接 b=b%m,不影响结果ax...

2018-07-25 17:34:49 270

原创 扩展欧几里得应用1(数论~扯上数论就很高端的感觉~~)

 【题意】解不定方程Ax+By=K(得到的x和y只是其中一组解)给出A、B、K,求出x和y,满足Ax+By=K。【输入格式】一行三个整数 A,B,K。 1 ≤ A,B,K ≤ 10^9 【输出格式】一行两个整数 x,y。如果无解,输出"no solution!"【样例输入】12 15  3【样例输出】-1 1 假设当前要求 gcd(a,b),并求出了一组 x 和 y...

2018-07-25 16:59:42 299

原创 牛客小白月赛5 -- 区间 (interval)(暴力? 差分?)

题目链接:https://www.nowcoder.com/acm/contest/135/I题目描述    Apojacsleam喜欢数组。    他现在有一个n个元素的数组a,而他要对a[L]-a[R]进行M次操作:        操作一:将a[L]-a[R]内的元素都加上P        操作二:将a[L]-a[R]内的元素都减去P    最后询问a[l]-a[r]内...

2018-07-25 12:02:47 249

原创 还是畅通工程 HDU - 1233 (Kruskal)

某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。 Input测试输入包含若干测试用例。每个测试用例的第1行给出村庄数目N ( < 100 );随后的N(N-1)/2行对应村庄间的距离,每行给出一对...

2018-07-21 17:04:55 149

原创 City HDU - 4496 (并查集+小转换)

Luxer is a really bad guy. He destroys everything he met. One day Luxer went to D-city. D-city has N D-points and M D-lines. Each D-line connects exactly two D-points. Luxer will destroy all the D-li...

2018-07-21 16:28:16 133

原创 Is It A Tree? POJ - 1308 (并查集)

A tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edges between nodes satisfying the following properties. There ...

2018-07-20 23:45:55 196

原创 Tram POJ - 1847 (Dijkstra -- vector存图 , 邻接矩阵存图)

没有言语可以表达我的生气啦!!!!!!!!!!!!!!!!!!!!!!!!!!!写了俩遍 , 发布的时候都没有了??!!!!生气!!!还有!!!裸的Dijkstra样例出成这样!!!!看了老久久了!!!Tram network in Zagreb consists of a number of intersections and rails connecting some of the...

2018-07-19 16:39:15 445

原创 Choose the best route HDU - 2680 (还是用vector存图哒~ Dijkstra 最短路)

One day , Kiki wants to visit one of her friends. As she is liable to carsickness , she wants to arrive at her friend’s home as soon as possible . Now give you a map of the city’s traffic route, and t...

2018-07-18 18:16:23 161

原创 一个人的旅行 HDU - 2066 (还是用Vector存哒--Dijkstra)

虽然草儿是个路痴(就是在杭电待了一年多,居然还会在校园里迷路的人,汗~),但是草儿仍然很喜欢旅行,因为在旅途中 会遇见很多人(白马王子,^0^),很多事,还能丰富自己的阅历,还可以看美丽的风景……草儿想去很多地方,她想要去东京铁塔看夜景,去威尼斯看电影,去阳明山上看海芋,去纽约纯粹看雪景,去巴黎喝咖啡写信,去北京探望孟姜女……眼看寒假就快到了,这么一大段时间,可不能浪费啊,一定要给自己好好的放个假...

2018-07-18 16:40:01 160

原创 最短路 HDU - 2544 (邻接矩阵存图 && vector 存图 Dijkstra + SPFA)

在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗?  Input输入包括多组数据。每组数据第一行是两个整数N、M(N<=100,M<=10000),N表示成都的大街上有几个路口,标号为1的路口是商店所在地,标号为N的路口...

2018-07-18 14:54:46 244

转载 STL 基础运用(vector set map容器基础用法 , 其它)

vector//vector(容器)#include??<vector>vector<int> vec;vector[0];//使用下标访问元素;vec.front();//取vec中的第一个元素;vec.back();//取vec中的最末一个元素;vec.push_back(x);//在向量末尾加入元素x;vec.pop_back();//删除末尾元素...

2018-07-17 18:02:39 192

原创 Codeforces Round #498 (Div. 3)-C. Three Parts of the Array

C. Three Parts of the Arraytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array d1,d2,…,dnd1,d2,…,dn consisting...

2018-07-17 14:00:55 246

原创 Codeforces Round #498 (Div. 3)-B. Polycarp's Practice

B. Polycarp's Practicetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp is practicing his problem solving skill. He has a...

2018-07-17 09:17:13 417

原创 Codeforces Round #498 (Div. 3)-A. Adjacent Replacements

A. Adjacent Replacementstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMishka got an integer array aa of length nn as a birthday...

2018-07-17 09:07:00 250

原创 Educational Codeforces Round 47 (Rated for Div. 2)-C. Annoying Present

C. Annoying Presenttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAlice got an array of length nn as a birthday present once again! This is the t...

2018-07-16 11:46:31 193

原创 Educational Codeforces Round 47 (Rated for Div. 2)--B. Minimum Ternary String

B. Minimum Ternary Stringtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a ternary string (it is a string which consists only of char...

2018-07-16 09:21:15 166

原创 Educational Codeforces Round 47 (Rated for Div. 2)--A. Game Shopping

A. Game Shoppingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMaxim wants to buy some games at the local game shop. There are nn games in the sho...

2018-07-16 09:02:48 202

原创 Oil Deposits HDU - 1241 (深搜 dfs )

The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides th...

2018-07-14 18:02:19 163

原创 棋盘问题 POJ - 1321 (深搜)

在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n <= 8 , k <= n 当为-1...

2018-07-14 15:52:35 328

原创 Codeforces Round #497 (Div. 2)--C. Reorder the Array(Map~~)

C. Reorder the Arraytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array of integers. Vasya can permute (change order) its integ...

2018-07-14 11:38:20 255

原创 Codeforces Round #497 (Div. 2)--B. Turn the Rectangles

B. Turn the Rectanglestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are nn rectangles in a row. You can either turn each rectangle by 9090...

2018-07-14 11:26:11 164

原创 Codeforces Round #497 (Div. 2)--A. Romaji(Map , 一定要学好STL!!!)

A. Romajitime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVitya has just started learning Berlanese language. It is known that Berlanese uses the L...

2018-07-14 11:18:48 261

原创 牛客练习赛22--C-简单瞎搞题(bitset 基础用法)

一共有 n个数,第 i 个数是 xi xi 可以取 [li , ri] 中任意的一个值。设 ,求 S 种类数。输入描述:第一行一个数 n。 然后 n 行,每行两个数表示 li,ri。输出描述:输出一行一个数表示答案。输入复制51 22 33 44 55 6输出复制26备注:1 ≤ n , li , ri ≤ 100...

2018-07-14 10:01:00 846

原创 牛客练习赛22--B-送分题

数据结构之神ccz又在出毒瘤数据结构了 神出了这样一个题: 给你三个数,在这三个数中间任意加*或者是+,然后可以随便打括号,只要这个表达式合法 比如说1 2 3可以得到: 1+2*3=7 1*(2+3)=5 1*2*3=6 (1+2)*3=9 不能改变这三个数的原顺序 最大化表达式...

2018-07-14 09:43:18 483

原创 牛客练习赛22--有趣的题(可有趣了呢)

给6个火柴棍,问能不能拼成“熊”或者“象”“熊”:4根棍子长度一样,另外2根棍子长度不一样“象”:4根棍子长度一样,另外2根棍子长度一样。如果可以拼出熊,输出“Bear”如果可以拼出象,输出“Elephant”如果都不可以拼出,输出“Hernia”输入描述:一行六个数表示每个火柴棍的长度输出描述:输出一行一个字符串表示答案示例1输入复制4 2 5 4 4 4输出复制Bear示例2输入复制4 4 5...

2018-07-14 09:39:47 305

原创 SPFA详解(^-^)

SPFA(Shortest Path Faster Algorithm)(队列优化)算法是求单源最短路径的一种算法,它还有一个重要的功能是判负环如果没必要判负环建议使用DijkstraSPFA判断负环:如果一个点进入队列达到n次,则表明图中存在负环,没有最短路径。主要思想及方法:...

2018-07-13 08:42:29 3104 3

原创 迪杰斯特拉算法详解(^-^)

指定一个点(源点)到其余各个顶点的最短路径,也叫做“单源最短路径”。例如求下图中的1号顶点到2、3、4、5、6号顶点的最短路径。                                                                  首先用二维数组来存储这个图, 如下:                                                    ...

2018-07-13 00:24:55 466

原创 简单迷宫 POJ-3984

定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0,};它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找出从左上角到右下角的最短路线。Input一个5 × 5的二维数组,表示...

2018-07-12 17:06:24 162

原创 Codeforces Round #496 (Div. 3)--D. Polycarp and Div 3(emm.... 难受~~,数学题)

D. Polycarp and Div 3time limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp likes numbers that are divisible by 3.He has a huge number ss. Polyc...

2018-07-12 09:09:05 155

原创 Codeforces Round #496 (Div. 3)--C. Summarize to the Power of Two(没错!用的map!!,哇咔咔咔~~)

C. Summarize to the Power of Twotime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA sequence a1,a2,…,ana1,a2,…,an is called good if, for each elemen...

2018-07-11 17:17:02 449

原创 谁能赢呢?(简单博弈)

小明和小红经常玩一个博弈游戏。给定一个 n × n 的棋盘,一个石头被放在棋盘的左上角。他们轮流移动石头。每一回合,选手只能把石头向上,下,左,右四个方向移动一格,并且要求移动到的格子之前不能被访问过。谁不能移动石头了就算输。假如小明先移动石头,而且两个选手都以最优策略走步,问最后谁能赢?Input    输入文件有多组数据。    输入第一行包含一个整数n,表示棋盘的规模。    当输入n为0时...

2018-07-11 16:59:15 235

原创 Codeforces Round #496 (Div. 3)--B. Delete from the Left(哇咔咔~~还是有vector的写法)

B. Delete from the Lefttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given two strings ss and tt. In a single move, you can choose any of...

2018-07-11 11:32:55 154

原创 Codeforces Round #496 (Div. 3)--A. Tanya and Stairways(初次尝试用vector,哇咔咔咔~~)

A. Tanya and Stairwaystime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle girl Tanya climbs the stairs inside a multi-storey building. Every tim...

2018-07-11 08:55:00 156

原创 尺取法 and 二分加前缀和

A sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, and a positive integer S (S < 100 000 000) are given. Write a program to find the minimal length o...

2018-07-10 11:21:53 272

原创 数据库

关系模型中有三类完整性约束:实体完整性、参照完整性 和 用户定义的完整性关系代数中专门的关系运算包括:选择、投影、除和 连接。 数据库范式的好处:1.减少数据冗余2.消除异常数据模型:层次,关系和网状.DBMS 的基本工作单位是事务,它是用户定义的一组逻辑一致的程序序列;并发控制的主要方法是  封锁 机制。 .在数据库并发控制中,两个或多个事务同时处在相互等待状态,称为 死锁在 SQL 语言中,为...

2018-07-05 08:59:08 194

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除