自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 L1-005 考试座位号 (15 分) JAVA版

L1-005 考试座位号 (15 分)每个 PAT 考生在参加考试时都会被分配两个座位号,一个是试机座位,一个是考试座位。正常情况下,考生在入场时先得到试机座位号码,入座进入试机状态后,系统会显示该考生的考试座位号码,考试时考生需要换到考试座位就座。但有些考生迟到了,试机已经结束,他们只能拿着领到的试机座位号码求助于你,从后台查出他们的考试座位号码。输入格式:输入第一行给出一个正整数 N(≤...

2019-01-22 11:55:55 1290 1

转载 蓝桥杯A组训练-完美的代价(回文串)

问题描述  回文串,是一种特殊的字符串,它从左往右读和从右往左读是一样的。小龙龙认为回文串才是完美的。现在给你一个串,它不一定是回文的,请你计算最少的交换次数使得该串变成一个完美的回文串。交换的定义是:交换两个相邻的字符例如mamad第一次交换 ad : mamda第二次交换 md : madma第三次交换 ma : madam (回文!完美!)输入格式  第一行是一个整数N,表示...

2019-01-12 20:38:52 1291

原创 迷宫问题

参考博客:https://blog.csdn.net/tsaid/article/details/6856795定义一个二维数组: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表示可以走...

2018-10-07 20:13:20 177

原创 servlet

html写客户端,将信息通过url经xml送给servlet类的requestservlet类的response类做出反应后将结果以html的形式反馈给客户端

2018-09-20 21:41:04 132

原创 计算机网络第一节课笔记

首先理清三个概念互联网(因特网)计算机网络互连网(网络的网络)互联网是互连网的一种;互连网泛指由多个计算机网络互连而成的计算机网络互联网之所以能够向用户提供许多服务,就是因为互联网就有两个重要基本特点,即连通性和共享。举例:如果一个物流公司,有了自己的运货路线,然后发货给分公司,这样这个物流公司就运作起来了,这就是一个服务。 || ...

2018-09-19 21:24:13 287

原创 回溯法原理

回溯法是一种选优搜索法,按选优条件向前搜索,以达到目标。但当探索到某一步时,发现原先选择并不优或达不到目标,就退回一步重新选择,这种走不通就退回再走的技术为回溯法 深搜、广搜都属于回溯法。...

2018-09-12 20:30:58 510

原创 讲解前序中序建立二叉树

vector版:直接上c++代码,讲解在下面,一定要看哦!struct node{ node *l, *r; int val; node(int x) : val(x), l(NULL), r(NULL) {}};node* reBuild(vector<int> pre, vector<int> in){ vector<int...

2018-09-12 20:11:41 1129

转载 1123 Is It a Complete AVL Tree(AVL树)

标明出处:https://www.liuchuo.net/archives/27321123 Is It a Complete AVL Tree(30 分)An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node ...

2018-09-07 19:31:36 139

原创 1018 Public Bike Management(Dijkstra + dfs)

部分内容引用自: https://www.liuchuo.net/archives/2373 1018 Public Bike Management(30 分)There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the w...

2018-09-07 13:11:42 128

转载 1013 Battle Over Cities(连通分量个数,dfs)

参考博客:https://blog.csdn.net/qq_33913037/article/details/71213985?locationNum=1&fps=1 https://www.liuchuo.net/archives/2346 1013 Battle Over Cities(25 分)It is vitally important to have all the c...

2018-09-06 17:00:41 270

转载 1010 Radix(二分)

标明出处:https://www.liuchuo.net/archives/2458 1010 Radix(25 分)Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is yes, if 6 is a decimal number ...

2018-09-05 11:47:47 131

转载 1007. Maximum Subsequence Sum (最大连续子序列和、动态规划dp)

标明出处:https://www.liuchuo.net/archives/2122 1007. Maximum Subsequence Sum (最大连续子序列和、动态规划dp)Given a sequence of K integers { N1, N2, …, NK }. A continuous subsequence is defined to be { Ni, Ni+1, …, ...

2018-09-05 10:43:26 416

转载 1004 Counting Leaves(dfs)

标明出处:https://www.liuchuo.net/archives/2229 1004 Counting Leaves(30 分)A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child. Input ...

2018-09-05 10:19:33 91

转载 1003 Emergency(Dijkstra)

标明出处:https://www.liuchuo.net/archives/2359 1003 Emergency(25 分)As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities conn...

2018-09-05 08:37:09 115

原创 Matlab基础

pi %3.14变量名、函数名区分大小写 变量名的第一个字符必须是英文字母 一行中可以输入多个命令,但各命令间要用“分号”或“逗号”分开 命令后采用“分号”结尾,使运算结果不显示。 养成在数值、运算符、虚单元之间不留空格的习惯,因为空格被用作矩阵或数组元素之间的分隔符。clf %清空图形窗grid on %画图纸分格线axis equal %横轴纵轴等刻度text(x,y...

2018-09-02 11:41:02 87

原创 Lingo基础

@if(表达式,为真时返回的值,为假时返回的值)

2018-09-01 17:03:49 226

原创 1104 Sum of Number Segments(20 分)

1104 Sum of Number Segments(20 分)Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the sequence { 0.1, 0.2, 0.3, 0.4 }, we have 10 segmen...

2018-08-29 15:58:46 929 1

转载 1108. Finding Average (20)

标明出处: https://www.liuchuo.net/archives/1924 1108. Finding Average (20) The basic task is simple: given N real numbers, you are supposed to calculate their average. But what makes it complicated is ...

2018-08-28 21:54:49 142

转载 1112. Stucked Keyboard (20)

标明出处: https://www.liuchuo.net/archives/2075 1112. Stucked Keyboard (20) On a broken keyboard, some of the keys are always stucked. So when you type some sentences, the characters corresponding to t...

2018-08-28 21:29:14 103

转载 1116. Come on! Let’s C (20)

不是自己做的,CSDN现在不让转载,只能复制了,标明出处:https://www.liuchuo.net/archives/2476Come on! Let’s C (20) “Let’s C” is a popular and fun programming contest hosted by the College of Computer Science and Technology,...

2018-08-28 20:35:28 152

原创 夏季小学期Day06,07,08——图书馆管理系统(JAVAEE,数据库mysql,前端H5)

首先导入mysql.jar包,直接复制粘贴到lib下即可 我是按字典序排列的class,所以按照代码顺序应该先看第五个->第一个->第二个->第三个->第四个(未完成) 第一个: pac

2018-08-28 20:09:22 3037 1

转载 1120 Friend Numbers(20 分)

不是自己做的,CSDN现在不让转载,只能复制了,标明出处:https://www.liuchuo.net/archives/29011120 Friend Numbers(20 分)Two integers are called “friend numbers” if they share the same sum of their digits, and the sum is their...

2018-08-27 21:26:01 136

转载 1124 Raffle for Weibo Followers(20 分)

1124 Raffle for Weibo Followers(20 分)John got a full mark on PAT. He was so happy that he decided to hold a raffle(抽奖) for his followers on Weibo – that is, he would select winners from every N foll...

2018-08-27 21:07:13 199

原创 1128 N Queens Puzzle(20 分)

1128 N Queens Puzzle(20 分)The “eight queens puzzle” is the problem of placing eight chess queens on an 8×8 chessboard so that no two queens threaten each other. Thus, a solution requires that no two...

2018-08-27 20:27:58 217

原创 夏季小学期Day05——JAVAEE入门

package com.qianfeng;import java.io.IOException;import javax.servlet.ServletException;import javax.servlet.ServletRequest;import javax.servlet.ServletResponse;import javax.servlet.http.HttpServ...

2018-08-27 19:46:44 273

原创 典型相关分析(SPSS)

原理讲解:放一篇博客~ https://blog.csdn.net/mbx8x9u/article/details/78824216例题: 2012高教社杯全国大学生数学建模竞赛题目 (请先阅读“全国大学生数学建模竞赛论文格式规范”)A题 葡萄酒的评价确定葡萄酒质量时一般是通过聘请一批有资质的评酒员进行品评。每个评酒员在对葡萄酒进行品尝后对其分类指标打分,然后求和得到其总分,从...

2018-08-26 12:33:59 8180

原创 夏季小学期day02——JAVA(java.swing)

package mdi;import java.awt.Component;import java.awt.Font;import java.awt.Graphics;import java.awt.Image;import java.awt.Toolkit;import java.awt.image.ImageObserver;public class ImgButton ...

2018-08-22 20:47:42 159

原创 夏季小学期day01——简单考试系统(JAVA)

public class Question { String title; String result; public Question(String title) { super(); this.title = title; }}import java.util.ArrayList;import java.u...

2018-08-22 20:34:42 168

原创 最大流问题讲解(Lingo)

第一节 图论的基本知识1. 图的概念 定义 图G(V,E)是指一个二元组(V(G),E(G)),其中: (1)V(G)={v1,v2,…, vn}是非空有限集,称为顶点集, (2)E(G)是V(G)中的元素对(vi,vj)组成的集合称为边集。 图G:V(G)={v1,v2,v3,v4} ...

2018-08-22 15:58:51 21759 2

转载 1133 Splitting A Linked List(25 分)

声明:本文在博主柳婼的文章基础上做了修改。 原文链接:https://blog.csdn.net/liuchuo/article/details/78037305 1133 Splitting A Linked List(25 分)Given a singly linked list, you are supposed to rearrange its elements so that a...

2018-08-22 15:26:41 200 2

原创 1142 Maximal Clique(25 分)

1142 Maximal Clique(25 分)A clique is a subset of vertices of an undirected graph such that every two distinct vertices in the clique are adjacent. A maximal clique is a clique that cannot be extende...

2018-08-22 09:38:04 155

原创 1144 The Missing Number(JAVA)

1144 The Missing Number(20 分)Given N integers, you are supposed to find the smallest positive integer that is NOT in the given list. Input Specification:Each input file contains one test case. Fo...

2018-08-20 17:22:21 130 1

原创 1145 Hashing - Average Search Time(25 分)

1145 Hashing - Average Search Time(25 分)The task of this problem is simple: insert a sequence of distinct positive integers into a hash table first. Then try to find another sequence of integer keys...

2018-08-20 17:21:18 254

原创 1146 Topological Order(25 分)

1146 Topological Order(25 分)This is a problem given in the Graduate Entrance Exam in 2018: Which of the following is NOT a topological order obtained from the given directed graph? Now you are suppo...

2018-08-20 17:19:57 457

原创 1019 General Palindromic Number (20)(JAVA)

1019 General Palindromic Number (20)(20 分)A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic number. All ...

2018-08-20 17:18:37 144

原创 1015 Reversible Primes (20)(JAVA)

1015 Reversible Primes (20)(20 分)A reversible prime in any number system is a prime whose “reverse” in that number system is also a prime. For example in the decimal system 73 is a reversible prime ...

2018-08-20 17:17:49 167

原创 1011 World Cup Betting (20)(JAVA)

1011 World Cup Betting (20)(20 分)With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing battles for the W...

2018-08-20 17:17:10 153

原创 1008 Elevator (20)(JAVA)

1008 Elevator (20)(20 分)The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in speci...

2018-08-20 17:16:26 133

原创 1005 Spell It Right (20)(JAVA)

1005 Spell It Right (20)(20 分)Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English.Input Specification:Each input ...

2018-08-20 17:15:47 191

原创 1001 A+B Format (20)(JAVA)

1001 A+B Format (20)(20 分)Calculate a + b and output the sum in standard format – that is, the digits must be separated into groups of three by commas (unless there are less than four digits).Inpu...

2018-08-20 17:14:59 145

空空如也

空空如也

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

TA关注的人

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