自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(92)
  • 收藏
  • 关注

转载 Java 集合和容器的区别与相互转换的方法

集合和容器都是Java中的容器。区别数组特点:大小固定,只能存储相同数据类型的数据集合特点:大小可动态扩展,可以存储各种类型的数据转换数组转换为集合:Arrays.asList(数组)示例:int[] arr = {1,3,4,6,6};Arrays.asList(arr);for(int i=0;i<arr.length;i...

2018-05-03 10:05:00 176

转载 Codeforces 976F Minimal k-covering【最大流】

题意:给一个二分图,存在重边,求使各点度数至少为k(0<=k<=min(d[i]))的最小边集合。分析:首先建立一个源点s向二分图左边连边,建立一个汇点e,所有二分图右边的点向e点连边。要使每个点的度数大于等于k,可使流过每个点的流量小于等于d[i]-k。(d[i]为每个点的度数),就可以在建立源点到二分图左边点,和二分图右边点到汇点时开始限制。然后对每个k跑一遍最大流,...

2018-05-02 21:03:00 158

转载 Codeforces-976E - Well played! - 贪心

题目链接:http://codeforces.com/contest/976/problem/E题目:Recently Max has got himself into popular CCG “BrainStone”. As “BrainStone” is a pretty intellectual game, Max has to solve numerous har...

2018-05-02 21:01:00 158

转载 D - Degree Set CodeForces - 976D 双指针

Degree Settime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a sequence ofnpositive integersd1...

2018-05-02 20:57:00 120

转载 こだわり者いろはちゃん / Iroha's Obsession AtCoder - 1973 我居然WA了两发

Problem StatementIroha is very particular about numbers. There areKdigits that she dislikes:D1,D2,…,DK.She is shopping, and now paying at the cashier. Her total isNyen (the currency o...

2018-05-02 20:53:00 174

转载 文字列大好きいろはちゃんイージー / Iroha Loves Strings (ABC Edition) AtCoder - 1978

文字列大好きいろはちゃんイージー / Iroha Loves Strings (ABC Edition)AtCoder - 1978Problem StatementIroha has a sequence ofNstringsS1,S2,…,SN. The length of each string isL.She will concatenate a...

2018-05-02 20:52:00 319

转载 和風いろはちゃんイージー / Iroha and Haiku (ABC Edition) AtCoder - 1977 这也太水题了...

和風いろはちゃんイージー / Iroha and Haiku (ABC Edition)AtCoder - 1977Problem StatementIroha lovesHaiku. Haiku is a short form of Japanese poetry. A Haiku consists of three phrases with5,7...

2018-05-02 20:51:00 198

转载 いろはちゃんとマス目 / Iroha and a Grid AtCoder - 1974 45分钟AK赛

Problem StatementWe have a large square grid withHrows andWcolumns. Iroha is now standing in the top-left cell. She will repeat going right or down to the adjacent cell, until she reache...

2018-05-02 20:50:00 226

转载 山东省第七届ACM省赛 题解

Problem DescriptionJulyed is preparing for her CET-6. She has N words to remember, but there is only M days left. If she can’t remember all these words, she won’t pass CET-6. If she can’t pass ...

2018-05-02 20:45:00 288

转载 Graph Theory HDU - 6029 留着练英语

Little Q loves playing with different kinds of graphs very much. One day he thought about an interesting category of graphs called ``Cool Graph'', which are generated in the following way:Let th...

2018-05-02 20:38:00 118

转载 Sudoku HDU - 5547 数独 搜索

Yi Sima was one of the best counselors of Cao Cao. He likes to play a funny game himself. It looks like the modern Sudoku, but smaller.Actually, Yi Sima was playing it different. First of all, h...

2018-05-02 20:36:00 383

转载 Game FZU - 2275 kmp

Alice and Bob is playing a game.Each of them has a number. Alice’s number is A, and Bob’s number is B.Each turn, one player can do one of the following actions on his own number:1. Flip: ...

2018-05-02 20:34:00 103

转载 Frog FZU - 2272 鸡兔同笼

FrogFZU - 2272Therearex frogs and y chicken in a garden. Kim found there are n heads and m legs in the garden. Please tell Kim how many frogs and chicken are there. (A frog has 4 legs, an...

2018-05-02 20:29:00 99

转载 阶乘除法 CSU - 1781

阶乘除法CSU - 1781输入两个正整数n, m,输出n!/m!,其中阶乘定义为n!= 1*2*3*...*n (n>=1)。 比如,若n=6, m=3,则n!/m!=6!/3!=720/6=120。是不是很简单?现在让我们把问题反过来:输入k=n!/m!,找到这样的整数二元组(n,m) (n>m>=1)。如果答案不唯一,n...

2018-05-02 20:27:00 106

转载 Lara Croft and the New Game CodeForces - 976B 水题排序

You are given a sequencea1, a2, ..., anof one-dimensional segments numbered1throughn. Your task is to find two distinct indicesiandjsuch that segmentailies within segmentaj.Segment[l...

2018-05-02 20:26:00 121

转载 CodeForces - 976B Lara Croft and the New Game 思维

You might have heard about the next game in Lara Croft series coming out this year. You also might have watched its trailer. Though you definitely missed the main idea about its plot, so let me l...

2018-05-02 20:24:00 149

转载 CodeForces - 976A Minimum Binary Number 水题

String can be calledcorrectif it consists of characters "0" and "1" and there are no redundant leading zeroes. Here are some examples: "0", "10", "1001".You are given acorrectstrings.You...

2018-05-02 20:23:00 125

转载 sort自定义cmp函数

1.改写comp从大到小排序。#include<iostream>#include<vector>#include<algorithm>using namespace std;bool comp(const int &a,const int &b){ return a>b;}int m...

2018-05-02 20:04:00 363

转载 The 2015 China Collegiate Programming Contest Sudoku

SudokuTime Limit: 3000/1000 MS (Java/Others)Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 3015Accepted Submission(s): 1010Problem DescriptionYi Sima was one of the b...

2018-04-30 21:52:00 100

转载 G - Ancient Go HDU - 5546 DFS

Yu Zhou likes to playGowith Su Lu. From the historical research, we found that there are much difference on the rules between ancient go and modern go.Here is the rules for ancient go they wer...

2018-04-30 18:13:00 128

转载 ccpc 女生专场 C - Coprime Sequence HDU - 6025

Do you know what is called ``Coprime Sequence''? That is a sequence consists ofnnpositive integers, and the GCD (Greatest Common Divisor) of them is equal to 1.``Coprime Sequence'' is easy to f...

2018-04-28 21:29:00 113

转载 HDU - 1702 ACboy needs your help again! 标准的stl题,队列和栈

HDU - 1702ACboy was kidnapped!!he miss his mother very much and is very scare now.You can't image how dark the room he was put into is, so poor :(.As a smart ACMer, you want to get ACboy o...

2018-04-15 17:36:00 102

转载 线段树

一直没写关于线段树的题解,简单的补两个部分。完整的请转https://blog.csdn.net/yrhsilence/article/details/5793699线段树做了很多,感觉这类题其实比别的算法更简单,只不过代码量比较大。关于树,大家明白一点就行       父节点 n ...

2018-04-03 23:37:00 69

转载 String,StringBuffer与StringBuilder的区别

String 字符串常量StringBuffer 字符串变量(线程安全)StringBuilder 字符串变量(非线程安全)简要的说, String 类型和 StringBuffer 类型的主要性能区别其实在于 String 是不可变的对象, 因此在每次对 String 类型进行改变的时候其实都等同于生成了一个新的 String 对象,然后将指针指向新的 String 对象,所以经常改...

2018-03-21 19:56:00 232

转载 Java之ACM注意点

1.类名称必须采用publicclassMain方式命名2.在有些OJ系统上,即便是输出的末尾多了一个“”,程序可能会输出错误,所以在我看来好多OJ系统做的是非常之垃圾3.有些OJ上的题目会直接将OI上的题目拷贝过来,所以即便是题目中有输入和输出文件,可能也不需要,因为在OJ系统中一般是采用标准输入输出,不需要文件4.在有多行数据输入的情况下,一般这样处理...

2018-03-20 17:32:00 119

转载 OpenCV 从入门到放弃(2)读取并显示图像

女神镇python.jpg首先要导入OpenCV包,方法为:import cv2 在Python中不需要声明变量,所以也就不需要C++中的cv::Mat xxxxx了。只需这样:(路径根据实际情况啦)OpenCV目前支持读取bmp、jpg、png、tiff等常用格式。img = cv2.imread("/home/upstar/pic/god...

2018-01-18 12:20:00 74

转载 OpenCV 从入门到放弃(1)虚拟机 Ubuntu16.04+ python安装opencv

在opencv官网(http://opencv.org/)下载linux版本的opencv压缩包。然后选择opencv下载文件夹,在终端中输入:cd (压缩包地址);将下载的文件解压unzip opencv-3.2.0.zip进入opencv-3.2.0目录,创建编译目录,编译,命令如下:cd ~/ opencv-3.1.0 ...

2018-01-18 12:05:00 169

转载 2017 ACM/ICPC Asia Regional Qingdao Online 青岛区域赛

1001AppleProblem DescriptionApple is Taotao's favourite fruit. In his backyard, there are three apple trees with coordinates (x1,y1), (x2,y2), and (x3,y3). Now Taotao is planning to pla...

2017-09-18 14:56:00 147

转载 母鸡下蛋

题目描述鸡国中的母鸡最擅长下蛋了,MGMG 是鸡国中一只以下蛋产量高而闻名全鸡国的母鸡。鸡国专供下蛋的 n 个鸡窝呈一字排列在鸡国的“下蛋中心”,从左到右依次编号为 1 到n。每个鸡窝都有一个最大可下蛋的量,其中第 i 个鸡窝的最大可下蛋量为 ci 。有时候由于MGMG 产量实在太大而无法在一个鸡窝中下完所有的蛋,不得不转移到隔壁的鸡窝继续下蛋,如果隔壁的鸡窝还是不能让它下完所...

2017-07-26 15:13:00 319

转载 Ubuntu的一些常用快捷键

Ubuntu操作基本快捷键* 打开主菜单 = Alt + F1* 运行 = Alt + F2* 显示桌面 = Ctrl + Alt + d* 最小化当前窗口 = Alt + F9* 最大化当前窗口 = Alt + F10* 关闭当前窗口 = Alt + F4* 截取全屏 = Print Screen* 截取窗口 = Alt + Print Screen默认特殊快捷键* 展示所有窗口程...

2017-06-11 21:34:00 98

转载 centos添加图形桌面

阿里云官网默认的Linux Centos7系统镜像,都是没有安装桌面环境的,用户如果要使用桌面,需要自己在服务器上进行安装。当然,对于咱这种新人来说,第一次玩,还是玩图形界面的吧~逼格太高了不是件好事儿~嘿嘿首先链接终端,输入自己的终端密码以后,先安装MATE可视化桌面yum groups install "MATE Desktop"安装好MA...

2017-06-05 13:57:00 122

转载 centos 复制并重命名文件

centos 复制并重命名文件。  维护网站时,因为友情链接交换的问题,需要需要修改一下模板foot.htm,但是其他页面也需要调用这个文件,只是首页的变动,因此需要多创建一个文件 footer.htm,以便首页调用这个文件,其他页面正常调用原来的文件,那么就需要用到centos 复制并重命名文件,应该怎么操作?  语法:cp,就是英文cope的缩写,后面加上参数,因为是复...

2017-05-25 21:03:00 2532

转载 山东省第八届ACM程序设计大赛总结

背景 第一次参加省赛的菜鸡选手学校比较近,我们第一天热身赛和正式比赛都是打车直接回学校,并不知道传说中的宾馆房间是什么样子。不过宾馆的火爆麻辣土豆丝盒饭倒是领教了。/摊手第一天热身赛题没怎么看,一直敲模板,最后想要个气球A了两个题,结果被告知气球没了,僵硬,你们明明黑板上有贴的嘛 /阴险,A题测试案例有问题,还跟志愿者开玩笑,希望你们明天也出个坑坑一波大佬们(我这乌鸦嘴。。。)(...

2017-05-08 11:27:00 98

转载 RMQ

int RMQ(int L,int R){ int k=0; while((1<<(k+1))<=R-L+1) ++k; return max(f[L][K],f[R-(1<<k)+1][K]);}转载于:https://www.cnblogs.com/upstart/p/6808077.html...

2017-05-04 16:54:00 58

转载 图的深度优先搜索

#include<bits/stdc++.h>using namespace std;const int MAX_N = 100;const int MAX_M = 10000;struct edge{ int v,next;}e[MAX_N];int p[MAX_N],eid;int init(){memset(p,-1,siz...

2017-05-04 16:20:00 72

转载 ACM知识点清单

本文直接来源http://blog.csdn.net/xuanandting/article/details/52160859,如有侵权,请联系删除。训练过ACM等程序设计竞赛的人在算法上有较大的优势,这就说明当你编程能力提高之后,主要时间是花在思考算法上,不是花在写程序与debug上。下面给个计划你练练:第一阶段:练经典常用算法,下面的每个算法给我打上十到二...

2017-05-02 18:51:00 120

转载 优先队列(priority_queue)

优先队列(priority_queue),是一种被专门设计的容器,其第一个元素总是它所包含的最大的元素。使第一个元素总是它所包含的优先级最高的元素,这种情况类似于堆,元素可以随时插入,只能检索优先级最高的元素。例如,当优先队列中是int类型的数据时,则数值越大优先级越高。Member functionsImplementation functionem...

2017-05-02 17:04:00 126

转载 Contest Print Server

Description In ACM/ICPC on-site contests ,3 students share 1 computer,so you can print your source code any time. Here you need to write a contest print server to handle all the requests...

2017-05-01 21:39:00 83

转载 巴什博弈

们从一道小学奥数题讲起。甲乙轮流报数至多报7个数,至少报1个数,从1开始,谁先报到50谁就胜利。甲先报,有无必胜策略?甲有必胜策略,先报2个数;接下来乙报x个数,甲都会报(8-x)(8−x)个数。因为8∣48,故一定是甲先报到50。同理,在巴什博奕中,当物品的总量n=(m+1)r+s(r为任意自然数,s≤m≤m) 时,先取的人先拿走s个物品...

2017-04-30 10:23:00 144

转载 Pick apples 第三届acm省赛

DescriptionOnce ago, there is a mystery yard which only produces three kinds of apples. The number of each kind is infinite. A girl carrying a big bag comes into the yard. She is so su...

2017-04-28 22:37:00 79

空空如也

空空如也

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

TA关注的人

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