自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 1060 Are They Equal (25 point(s))

问题描述: If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0.123×10^5 with simple chopping. Now given the number of si...

2019-05-16 14:46:37 140

原创 1052 Linked List Sorting (25 point(s))

问题描述: A linked list consists of a series of structures, which are not necessarily adjacent in memory. We assume that each structure contains an integer key and a Next pointer to the next structure. No...

2019-05-14 16:06:15 111

原创 1032 Sharing (25 point(s))

问题描述: To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the same sublist if they share the same suffix. For ex...

2019-05-14 14:42:35 159

原创 1069 The Black Hole of Numbers (20 point(s))

问题描述: For any 4-digit integer except the ones with all the digits being the same, if we sort the digits in non-increasing order first, and then in non-decreasing order, a new number can be obtained by...

2019-04-01 15:22:38 154

原创 1101 Quick Sort (25 point(s))

问题描述: There is a classical process named partition in the famous quick sort algorithm. In this process we typically choose one element as the pivot. Then the elements less than the pivot are moved to ...

2019-03-28 21:17:02 113

原创 1093 Count PAT's (25 point(s))

问题描述: The string APPAPT contains two PAT’s as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed by the 3rd, the 4th, and the 6th characters....

2019-03-28 21:13:09 116

原创 CODEVS 1001 舒适的路线

题目描述 Description Z小镇是一个景色宜人的地方,吸引来自各地的观光客来此旅游观光。 Z小镇附近共有 N(1<N≤500)个景点(编号为1,2,3,…,N),这些景点被M(0<M≤5000)条道路连接着,所有道路都是双向的,两个景点之间可能有多条道路。也许是为了保护该地的旅游资源,Z小镇有个奇怪的规定,就是对于一条给定的公路Ri,任何在该公路上行驶的车辆速度必须为Vi。频繁...

2019-03-21 21:12:52 117

原创 1025 PAT Ranking (25 point(s))

问题描述: Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run simultaneously in several places, and the rankl...

2019-03-12 20:49:25 94

原创 CSP201503-4(树的直径+bfs)

求树的直径裸题。可以用两次dfs或者两次bfs,都一样。 树的直径:从任意一点到距离这一点的最远处的一点,最远处的这一点为树的直径的一个端点,从这个端点开始深搜或者广搜求得距离该端点最远的一个结点,也就是树的直径的另一个端点。 #include &amp;amp;lt;iostream&amp;amp;gt; #include &amp;amp;lt;queue&amp;amp;gt; #include &amp;amp;lt;vector&amp;amp;g

2019-03-11 17:23:14 188

原创 CSP201503-1(简单题)

题目题意十分明确,基本上不需要思考。但是!!必须声明全局数组,否则csf的大数据测试会溢出。多么痛的领悟~ #include &amp;lt;iostream&amp;gt; int graph[1005][1005]; int main(){ int n; int m; scanf (&quot;%d%d&quot;,&amp;amp;n,&amp;amp;m); for (int a=0;a&amp;lt;n;a++){ for (in

2019-03-11 17:00:55 227

原创 CSP201412-4(kruskal裸题)

完全就是一道不带拐弯的minimum spanning tree,prim或kruskal都可以,这里我选择了kruskal。 以并查集1中的麦田数目是否等于麦田总数作为循环跳出条件。 #include &amp;amp;amp;lt;iostream&amp;amp;amp;gt;//考虑用set,但是需要重载运算符,不如用vector算了 #include &amp;amp;amp;lt;vector&amp;amp;amp;gt; #include &amp;a

2019-03-07 20:04:04 201

原创 CSP201409-4(bfs)

把所有分店全插入队列bfs即可 #include &lt;iostream&gt; #include &lt;queue&gt; using namespace std; int graph[1001][1001]={0}; struct POS{ int x,y; int dis; }; int main(){ int n,m,k,d; cin&gt;&gt;n&gt;&gt;m&gt...

2019-03-05 13:46:39 217

空空如也

空空如也

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

TA关注的人

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