自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 【EXPERIMENT】tmux、SCIP

【代码】【EXPERIMENT】tmux、SCIP。

2024-03-20 15:08:38 166

原创 Java环境配置及IDEA安装

Java环境配置、intellij IDEA安装

2022-06-19 12:48:21 643 1

原创 基于国密算法实现主机之间的密钥分发和安全传输-2021西北工业大学网络空间安全学院暑期夏令营

基于国密算法实现主机之间的密钥分发和安全传输-2021年西北工业大学网络空间安全学院暑期夏令营

2021-09-02 15:46:32 2418 16

原创 [PAT] A1143/A1151 Lowest Common Ancestor

A1143/A1151 Lowest Common Ancestor1143 Lowest Common Ancestor1151 LCA in a Binary Tree1143 Lowest Common AncestorLink1143 Lowest Common Ancestor (30 分)The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U a

2021-08-16 17:13:04 196

原创 [PAT] A1153 Decode Registration Card of PAT

A1153 Decode Registration Card of PATLinkInput SpecificationOutput SpecificationSample Input & OutputSample InputSample OutputTopicAnalysis & CodeLink1153 Decode Registration Card of PAT (25 分)A registration card number of PAT consists of 4 part

2021-08-05 02:09:32 247

原创 [PAT] A1152 Google Recruitment

A1152 Google RecruitmentLinkInput SpecificationOutput SpecificationSample Input & OutputSample Input 1Sample Output 1Sample Input 2Sample Output 2TopicAnalysis & CodeLink1152 Google Recruitment (20 分)In July 2004, Google posted on a giant billbo

2021-08-05 01:53:24 109

原创 [PAT] A1016 Phone Bills

A1016 Phone BillsLinkInput SpecificationOutput SpecificationSample InputSample OutputCodeLink1016 Phone Bills (25 分)A long-distance telephone company charges its customers by the following rules:Making a long-distance call costs a certain amount per mi

2021-07-30 00:46:49 72

原创 [PAT] A1015 Reversible Primes

A1015 Reversible PrimesInput SpecificationOutput SpecificationSample InputSample OutputCodeA 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

2021-07-28 23:15:39 97

原创 [PAT] A1012 The Best Rank

A1012 The Best RankInput SpecificationOutput SpecificationSample InputSample OutputCodeTo evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Programming Language, M - Mathematics (Calculus

2021-07-26 23:45:21 93

原创 [PAT] A1011 World Cup Betting

A1008 ElevatorInput SpecificationOutput SpecificationSample InputSample OutputCodeWith 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 World Cup

2021-07-23 11:55:24 78

原创 [PAT] A1009 Product of Polynomials

A1009 Product of PolynomialsInput SpecificationOutput SpecificationSample InputSample OutputCodeThis time, you are supposed to find A×B where A and B are two polynomials.Input SpecificationEach input file contains one test case. Each case occupies 2 lin

2021-07-23 11:48:02 78

原创 [PAT] A1008 Elevator

A1008 ElevatorInput SpecificationOutput SpecificationSample InputSample OutputCodeThe 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 spec

2021-07-22 23:12:40 113 1

原创 [PAT] A1006 Sign In and Sign Out

A1006 Sign In and Sign OutInput SpecificationOutput SpecificationSample InputSample OutputCodeAt the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the

2021-07-22 21:51:01 73

原创 [PAT] A1005 Spell It Right

A1005 Spell It RightInput SpecificationOutput SpecificationSample InputSample OutputCodeGiven 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 SpecificationEach input fi

2021-07-22 21:43:31 80 1

原创 [PAT] A1003 Emergency

A1003 EmergencyInput SpecificationOutput SpecificationSample InputSample OutputCodeAs an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue

2021-07-22 21:40:55 96

原创 [PAT] A1002 A+B for Polynomials (23分!)

A1002 A+B for PolynomialsInput SpecificationOutput SpecificationSample InputSample OutputCodeThis time, you are supposed to find A+B where A and B are two polynomials.Input SpecificationEach input file contains one test case. Each case occupies 2 lines,

2021-07-21 19:11:39 120

原创 [PAT] A1001 A+B Format

A1001 A+B FormatInput SpecificationOutput SpecificationSample InputSample OutputCodeCalculate 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).Input

2021-07-21 18:57:01 74

原创 [Deep Learning-Andrew] Course1 Week2

Python Basics with Numpy1 - Building basic functions with numpy1.1 - sigmoid function, np.exp():1 - Building basic functions with numpy1.1 - sigmoid function, np.exp(): ????????????????????????????(????) = 1 / 1+e^-x^import mathdef basic_sigmoid

2021-05-06 23:07:30 140

原创 [CCF-CSP] 201609-2 火车购票

201609-2 火车购票输入格式输出格式样例输入样例输出样例说明 及 评测用例规模与约定分析Code(C++)  请实现一个铁路购票系统的简单座位分配算法,来处理一节车厢的座位分配。  假设一节车厢有20排、每一排5个座位。为方便起见,我们用1到100来给所有的座位编号,第一排是1到5号,第二排是6到10号,依次类推,第20排是96到100号。  购票时,一个人可能购一张或多张票,最多不超过5张。如果这几张票可以安排在同一排编号相邻的座位,则应该安排在编号最小的相邻座位。否则应该安排在编号最小的几个

2021-02-25 23:50:12 144

原创 [CCF-CSP] 201609-1 最大波动

201512-1 数位之和输入格式输出格式样例输入样例输出样例说明 及 评测用例规模与约定分析Code(C++)小明正在利用股票的波动程度来研究股票。小明拿到了一只股票每天收盘时的价格,他想知道,这只股票连续几天的最大波动值是多少,即在这几天中某天收盘价格与前一天收盘价格之差的绝对值最大是多少。输入格式输入的第一行包含了一个整数n,表示小明拿到的收盘价格的连续天数。第二行包含n个正整数,依次表示每天的收盘价格。输出格式输出一个整数,表示这只股票这n天中的最大波动值。样例输入62 5 5 7

2021-02-25 13:55:08 112

原创 [CCF-CSP] 201604-1 折点计数

201604-1 折点计数输入格式输出格式样例输入样例输出评测用例规模与约定分析Code(C++)给定n个整数表示一个商店连续n天的销售量。如果某天之前销售量在增长,而后一天销售量减少,则称这一天为折点,反过来如果之前销售量减少而后一天销售量增长,也称这一天为折点。其他的天都不是折点。如下图中,第3天和第6天是折点。给定n个整数a1, a2, …, an表示销售量,请计算出这些天总共有多少个折点。为了减少歧义,我们给定的数据保证:在这n天中相邻两天的销售量总是不同的,即ai-1≠ai。注意,如果两天

2021-02-25 00:56:17 123

原创 [CCF-CSP] 201512-1 数位之和

201512-1 数位之和输入格式输出格式样例输入样例输出样例说明 及 评测用例规模与约定分析Code(C++)给定一个十进制整数n,输出n的各位数字之和。输入格式输入一个整数n。输出格式输出一个整数,表示答案。样例输入20151220样例输出13样例说明 及 评测用例规模与约定·样例说明:20151220的各位数字之和为2+0+1+5+1+2+2+0=13。·评测用例规模与约定:所有评测用例满足:0 ≤ n ≤ 1000000000。分析个人选择用字符串处理的方式,

2021-02-25 00:07:33 131

原创 [CCF-CSP] 201509-2 日期计算

201509-2 日期计算输入格式输出格式样例输入1样例输出1样例输入2样例输出2分析Code(C++)给定一个年份y和一个整数d,问这一年的第d天是几月几日?注意闰年的2月有29天。满足下面条件之一的是闰年:  1) 年份是4的整数倍,而且不是100的整数倍;  2) 年份是400的整数倍。输入格式输入的第一行包含一个整数y,表示年份,年份在1900到2015之间(包含1900和2015)。输入的第二行包含一个整数d,d在1至365之间。输出格式输出两行,每行一个整数,分别表示答案的月份

2021-02-24 23:48:34 86

原创 [CCF-CSP] 201509-1 数列分段

201509-1 数列分段输入格式输出格式样例输入样例输出评测用例规模与约定分析Code(C++)给定一个整数数列,数列中连续相同的最长整数序列算成一段,问数列中共有多少段?输入格式输入的第一行包含一个整数n,表示数列中整数的个数。第二行包含n个整数a1, a2, …, an,表示给定的数列,相邻的整数之间用一个空格分隔。输出格式输出一个整数,表示给定的数列有多个段。样例输入88 8 8 0 12 12 8 0样例输出5评测用例规模与约定8 8 8是第一段,0是第二段,12 1

2021-02-24 20:43:27 110

原创 [CCF-CSP] 201503-2 数字排序

201503-2 数字排序输入格式输出格式样例输入样例输出评测用例规模与约定分析Code(C++)给定n个整数,请统计出每个整数出现的次数,按出现次数从多到少的顺序输出。输入格式输入的第一行包含一个整数n,表示给定数字的个数。第二行包含n个整数,相邻的整数之间用一个空格分隔,表示所给定的整数。输出格式输出多行,每行包含两个整数,分别表示一个给定的整数和它出现的次数。按出现次数递减的顺序输出。如果两个整数出现的次数一样多,则先输出值较小的,然后输出值较大的。样例输入125 2 3 3 1 3

2021-02-24 00:56:31 150

原创 [CCF-CSP] 201503-1 图像旋转

201503-1 图像旋转输入格式输出格式样例输入样例输出评测用例规模与约定Code(C++)旋转是图像处理的基本操作,在这个问题中,你需要将一个图像逆时针旋转90度。计算机中的图像表示可以用一个矩阵来表示,为了旋转一个图像,只需要将对应的矩阵旋转即可。输入格式输入的第一行包含两个整数n, m,分别表示图像矩阵的行数和列数。  接下来n行每行包含m个整数,表示输入的图像。输出格式输出m行,每行包含n个整数,表示原始矩阵逆时针旋转90度后的矩阵。样例输入2 31 5 33 2 4样例

2021-02-24 00:52:24 92

原创 [CCF-CSP] 201409-2 画图

201409-2 画图输入格式输出格式样例输入样例输出评测用例规模与约定分析Code(C++)在一个定义了直角坐标系的纸上,画一个(x1,y1)到(x2,y2)的矩形指将横坐标范围从x1到x2,纵坐标范围从y1到y2之间的区域涂上颜色。下图给出了一个画了两个矩形的例子。第一个矩形是(1,1) 到(4, 4),用绿色和紫色表示。第二个矩形是(2, 3)到(6, 5),用蓝色和紫色表示。图中,一共有15个单位的面积被涂上颜色,其中紫色部分被涂了两次,但在计算面积时只计算一次。在实际的涂色过程中,所有的矩形都

2021-02-23 15:19:14 105

原创 [CCF-CSP] 201409-1 相邻数对

201409-1 相邻数对输入格式输出格式样例输入样例输出样例说明 及 评测用例规模与约定分析Code(C++)给定n个不同的整数,问这些数中有多少对整数,它们的值正好相差1。输入格式输入的第一行包含一个整数n,表示给定整数的个数。第二行包含所给定的n个整数。输出格式输出一个整数,表示值正好相差1的数对的个数。样例输入610 2 6 3 7 8样例输出3样例说明 及 评测用例规模与约定·样例说明:值正好相差1的数对包括(2, 3), (6, 7), (7, 8)。·评测用

2021-02-23 00:53:28 275

原创 [CCF-CSP] 201412-1 门禁系统

201412-1 门禁系统输入格式输出格式样例输入样例输出评测用例规模与约定分析Code(C++)涛涛最近要负责图书馆的管理工作,需要记录下每天读者的到访情况。每位读者有一个编号,每条记录用读者的编号来表示。给出读者的来访记录,请问每一条记录中的读者是第几次出现。输入格式输入的第一行包含一个整数n,表示涛涛的记录条数。第二行包含n个整数,依次表示涛涛的记录中每位读者的编号。输出格式输出一行,包含n个整数,由空格分隔,依次表示每条记录中的读者编号是第几次出现。样例输入51 2 1 1 3

2021-02-22 23:00:04 147

原创 [PAT] A1036 Boys vs Girls(查找问题)

1036 Boys vs GirlsInput SpecificationOutput SpecificationSample Input 1Sample Output 1Sample Input 2Sample Output 2AnalysisCodeThis time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all th

2021-01-24 22:53:31 104

原创 [PAT] A1011 World Cup Betting(数学问题)

1011 World Cup BettingInput Specification:Output Specification:Sample Input:Sample Output:Analysis:Code: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 bat

2021-01-24 16:50:49 108

原创 [CCCC-GPLT] L1-012 计算指数 (5分)

真的没骗你,这道才是简单题 —— 对任意给定的不超过 10 的正整数 n,要求你输出 2​n。不难吧?Input Specification:输入在一行中给出一个不超过 10 的正整数 n。Output Specification:在一行中按照格式2^n^ = 计算结果输出 2​n的值。Sample Input:5Sample Output:2^5 = 32Code:#include<bits/stdc++.h>using namespace std;int mai

2020-10-05 23:25:59 104

原创 [CCCC-GPLT] L1-010 比较大小 (10分)

本题要求将输入的任意3个整数从小到大输出。Input Specification:输入在一行中给出3个整数,其间以空格分隔。Output Specification:在一行中将3个整数从小到大输出,其间以“->”相连。Sample Input:4 2 8Sample Output:2->4->8Code:#include<bits/stdc++.h>using namespace std;int main(){ int a[3];

2020-10-05 23:12:33 131

原创 [CCCC-GPLT] L1-008 求整数段和 (10分)

给定两个整数A和B,输出从A到B的所有整数以及这些数的和。Input Specification:输入在一行中给出2个整数A和B,其中−100≤A≤B≤100,其间以空格分隔。Output Specification:首先顺序输出从A到B的所有整数,每5个数字占一行,每个数字占5个字符宽度,向右对齐。最后在一行中按Sum = X的格式输出全部数字的和X。Sample Input:-3 8Sample Output: -3 -2 -1 0 1 2 3

2020-10-05 23:09:35 696

原创 [CCCC-GPLT] L1-007 念数字 (10分)

输入一个整数,输出每个数字对应的拼音。当整数为负数时,先输出fu字。十个数字对应的拼音如下:0: ling1: yi2: er3: san4: si5: wu6: liu7: qi8: ba9: jiuInput Specification:输入在一行中给出一个整数,如:1234。提示:整数包括负数、零和正数。Output Specification:在一行中输出这个整数对应的拼音,每个数字的拼音之间用空格分开,行末没有最后的空格。如 yi er san si。Sample

2020-10-05 20:31:15 134

原创 [CCCC-GPLT] L1-005 考试座位号 (15分)

每个 PAT 考生在参加考试时都会被分配两个座位号,一个是试机座位,一个是考试座位。正常情况下,考生在入场时先得到试机座位号码,入座进入试机状态后,系统会显示该考生的考试座位号码,考试时考生需要换到考试座位就座。但有些考生迟到了,试机已经结束,他们只能拿着领到的试机座位号码求助于你,从后台查出他们的考试座位号码。Input Specification:输入第一行给出一个正整数 N(≤1000),随后 N 行,每行给出一个考生的信息:准考证号 试机座位号 考试座位号。其中准考证号由 16 位数字组成,座位

2020-10-05 20:27:28 103

原创 [CCCC-GPLT] L1-003 个位数统计 (15分)

给定一个 k 位整数 N= dk-110k-1 + … + d1101 + d0 (0<=di<=9, i=0,…,k-1, dk-1>0)请编写程序统计每种不同的个位数字出现的次数。例如:给定 N=100311,则有 2 个 0,3 个 1,和 1 个 3。Input Specification:每个输入包含 1 个测试用例,即一个不超过 1000 位的正整数 N。Output Specification:对 N 中每一种不同的个位数字,以 D:M 的格式在一行中输出该位数字

2020-10-05 20:14:37 93

原创 [CCCC-GPLT] L1-004 计算摄氏温度 (5分)

给定一个华氏温度F,本题要求编写程序,计算对应的摄氏温度C。计算公式:C=5×(F−32)/9。题目保证输入与输出均在整型范围内。Input Specification:输入在一行中给出一个华氏温度。Output Specification:在一行中按照格式“Celsius = C”输出对应的摄氏温度C的整数值。Sample Input:150Sample Output:Celsius = 65Analysis按给出的公式计算即可Code:#include<iostre

2020-10-03 22:55:54 80

原创 [CCCC-GPLT] L1-001 Hello World (5分)

L1-001 Hello World (5分)这道超级简单的题目没有任何输入。你只需要在一行中输出著名短句“Hello World!”就可以了。Sample Input:无Sample Output:Hello World!#include<iostream>using namespace std;int main(){ cout<<"Hello World!";}...

2020-10-02 14:11:00 128

原创 LeetCode每日一题 945.使数组唯一的最小增量

给定整数数组 A,每次 move 操作将会选择任意 A[i],并将其递增 1。返回使 A 中的每个值都是唯一的最少操作次数。示例 1:输入:[1,2,2]输出:1解释:经过一次 move 操作,数组将变为 [1, 2, 3]。示例 2:输入:[3,2,1,2,1,7]输出:6解释:经过 6 次 move 操作,数组将变为 [3, 4, 1, 2, 5, 7]。可以看出 5 次或...

2020-03-22 23:28:48 93

空空如也

空空如也

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

TA关注的人

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