自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 简易表单服务器

任务:利用表单服务器发送一个用户名和密码,如果正确,返回欢迎您;否则返回错误。login.html<!DOCTYPE html><html><head> <meta charset="utf-8" /> <title></title></head><body> <form action="Hello/Login" method="post">//meth.

2021-03-15 16:32:19 297 1

原创 基础练习 龟兔赛跑预测

基础练习 龟兔赛跑预测问题描述  话说这个世界上有各种各样的兔子和乌龟,但是研究发现,所有的兔子和乌龟都有一个共同的特点——喜欢赛跑。于是世界上各个角落都不断在发生着乌龟和兔子的比赛,小华对此很感兴趣,于是决定研究不同兔子和乌龟的赛跑。他发现,兔子虽然跑比乌龟快,但它们有众所周知的毛病——骄傲且懒惰,于是在与乌龟的比赛中,一旦任一秒结束后兔子发现自己领先t米或以上,它们就会停下来休息s秒。对于不同的兔子,t,s的数值是不同的,但是所有的乌龟却是一致——它们不到终点决不停止。  然而有些比赛相当漫长

2021-02-17 17:04:06 164

原创 2020-12-14

7-21jmu-python-随机生成密码(20分)新建一个字符列表,这个列表中的内容从前到后依次包含小写字母、大写字母、数字。 形如['a',...,'z','A',...,'Z','0',...'9']建议:使用代码生成该字符列表。分别输入随机数的种子x(整型),随机生成的密码个数n,每个密码长度m。每个密码包含的m个字符是从上述字符列表中随机抽取。注意:本题不要用sample函数,否则答案错误。输入格式:种子x (注意:需将x转换为整数型再进行设置)密码个数n每个密码的长度...

2020-12-14 11:30:10 1089

原创 2020-12-07

列表转字符串 x=''.join([str(i) for i in x]) #x初始为列表 判断字符是否为汉字 #python3版本def is_chinese(uchar): """用unicode判断是否是汉字""" if uchar >= '\u4e00' and uchar<='\u9fa5': return True else: return False 字符串字符大小写转换 str.lower..

2020-12-07 11:32:26 111

原创 L1-008 求整数段和

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

2020-10-04 19:10:20 118

原创 Python格式化输出

%方式 %是一种占位符。符号 意义 %d/%i 十进制整数 %u 过时的十进制表示 %f 保留小数点后面六位有效数字 %.3f 保留3位小数位 %e 保留小数点后面六位有效数字,指数形式输出 %.3e 保留3位小数位,使用科学计数法 %g 在保证六位有效数字的前提下,使用小数方式,否则使用科学计数法 %.3g 保留3位有效数字,使用小数或科学计数法 %s 字符串 %o 八进制 %x/%...

2020-09-09 09:37:35 531

原创 委托

using System;using System.Collections;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace CollectionEx{ class Program { ...

2020-04-13 20:07:18 113

原创 字典类

using System;using System.Collections;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace CollectionEx{ class Program { ...

2020-04-13 11:26:18 105

原创 泛型

举例using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace XMGeneric{ class Apple { public string Color { get...

2020-04-01 10:03:02 135

原创 C# 类设计

using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ArrayTest{ class Program { static void Main(string[] ar...

2020-03-09 11:40:45 737

原创 进制转换

十进制转十六进制#include<iostream>#include<cstdio>#include<algorithm>#include<cmath>using namespace std;int main() { int num; cin>>num; printf("%X\n",num); return 0;...

2020-03-04 21:45:05 135

原创 01字串

问题描述对于长度为5位的一个01串,每一位都可能是0或1,一共有32种可能。它们的前几个是:0000000001000100001100100请按从小到大的顺序输出这32种01串。输入格式本试题没有输入。输出格式输出32行,按从小到大的顺序每行一个长度为5的01串。样例输出00000000010001000011<以下部分省略&gt...

2020-03-04 17:21:45 110

原创 @与$符号的使用

using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace InputAndOutput{ class Program { static void Main(string...

2020-02-26 09:42:24 1672

原创 序列求和

问题描述求1+2+3+...+n的值。输入格式输入包括一个整数n。输出格式输出一行,包括一个整数,表示1+2+3+...+n的值。样例输入4样例输出10样例输入100说明:有一些试题会给出多组样例输入输出以帮助你更好的做题。一般在提交之前所有这些样例都需要测试通过才行,但这不代表这几组样例数据都正确了你的程序就是完全正确的,潜在的错误可能仍...

2020-02-22 21:19:57 253

原创 Fibonacci数列

问题描述Fibonacci数列的递推公式为:Fn=Fn-1+Fn-2,其中F1=F2=1。当n比较大时,Fn也非常大,现在我们想知道,Fn除以10007的余数是多少。输入格式输入包含一个整数n。输出格式输出一行,包含一个整数,表示Fn除以10007的余数。说明:在本题中,答案是要求Fn除以10007的余数,因此我们只要能算出这个余数即可,而不需要先计算出Fn的准确值,再...

2020-02-22 21:05:15 113

原创 母牛的故事

题目描述有一头母牛,它每年年初生一头小母牛。每头小母牛从第四个年头开始,每年年初也生一头小母牛。请编程实现在第n年的时候,共有多少头母牛?输入输入数据由多个测试实例组成,每个测试实例占一行,包括一个整数n(0<n<55),n的含义如题目中描述。n=0表示输入数据的结束,不做处理。输出对于每个测试实例,输出在第n年的时候母牛的数量。每个输出占一行。样例输入...

2020-02-19 20:04:06 123

原创 字符逆序

题目描述将一个字符串str的内容颠倒过来,并输出。str的长度不超过100个字符。输入输入包括一行。 第一行输入的字符串。输出输出转换好的逆序字符串。样例输入I am a student样例输出tneduts a ma I【代码】#include<iostream>#include<cstdio>#include&lt...

2020-02-18 23:06:16 126

原创 Hello, world!【蓝桥】

题目描述This is the first problem for test. Since all we know the ASCII code, your job is simple: Input numbers and output corresponding messages.输入The input will contain a list of positive integers...

2020-02-18 22:45:07 159

原创 牌型种数(蓝桥杯2015初赛)

题目描述小明被劫持到X赌城,被迫与其他3人玩牌。一副扑克牌(去掉大小王牌,共52张),均匀发给4个人,每个人13张。这时,小明脑子里突然冒出一个问题:如果不考虑花色,只考虑点数,也不考虑自己得到的牌的先后顺序自己手里能拿到的初始牌型组合一共有多少种呢?输出请输出该整数,不要输出任何多余的内容或说明文字。【分析】该题可用递归进行计算。每一种点数共有四张牌...

2020-01-31 14:30:53 1398

原创 累加和

题目描述1、老师在黑板上写下一个正整数,记为X1。2、删除X1的最后一位数字后,得到的正整数记为X2。3、删除X2的最后一位数字后,得到的正整数记为X3。。。。。进行若干次操作后,剩下的正整数只有1位数字了,记为Xn。令Y = X1 + X2 + X3 + ....+ Xn。例如:老师刚开始在黑板写下的正整数是509,那么: X1 = 509 X2 = 50 ...

2019-11-12 19:10:41 2335

原创 大数相加

I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.InputThe first line of the input contains an integer T(1<=T<=20) which means the ...

2019-11-12 19:07:54 202

原创 Jessica's Reading Problem (尺取)

Jessica's a very lovely girl wooed by lots of boys. Recently she has a problem. The final exam is coming, yet she has spent little time on it. If she wants to pass it, she has to master all ideas incl...

2019-10-29 19:56:19 94

原创 Simplicity string

题目描述For a string of letters, define the Simplicity of the string to be the number of distinct letters in the string. For example, the string string has simplicity 6, and the string l...

2019-10-22 20:05:55 213

原创 Carmichael Numbers(素数判断+快速幂)

An important topic nowadays in computer science is cryptography. Some people even think that cryptography is the only important field in computer science, and that life would not matter at all without...

2019-10-10 19:52:09 226

原创 How Many Tables(并查集)

Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the friends know each other, a...

2019-09-24 21:07:18 108

原创 The Suspects(并查集)

Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best strategy is to s...

2019-09-24 21:06:13 150

原创 The Dole Queue (双向约瑟夫环)

In a serious attempt to downsize (reduce) the dole queue, The New National Green Labour Rhinoceros Party has decided on the following strategy. Every day all dole applicants will be placed in a large ...

2019-08-28 15:32:15 249

原创 任意进制与十进制之间的转换

任意进制转换为十进制 int pow(int n,int time){ int ans=1; for(int i=1;i<=time;i++) ans*=n; return ans;} int change_any_to_10(char *s,int type){ int ans=0; int len = strlen(...

2019-08-28 13:12:56 287

原创 Hangman Judge (set应用)

In "Hangman Judge,'' you are to write a program that judges a series of Hangman games. For each game, the answer to the puzzle is given as well as the guesses. Rules are the same as the classic game o...

2019-08-21 14:35:28 112

原创 set应用

1、介绍:set是STL中一个很有用的容器,用来存储同一种数据类型的数据结构(可以称之为K的模型),基本功能与数组相似。 set与数组不同的是,在set中每个元素的值都是唯一的,一个set集合不能包含重复的元素。 而且set插入数据时,能够根据元素的值自动进行排序。 set中数元素的值并不能直接被改变2、常用方法begin(),返回set容器第一个元素的迭代器end()...

2019-08-21 14:16:49 135

原创 计算数列

设表示一个交替两个数字f(a​1​​a​2​​...a​p−1​​a​p​​,b​1​​b​2​​...b​q−1​​b​q​​)的函数,其中a​1​​...a​p​​和b​1​​...b​q​​是以十进制表示法写入的两个整数的数字,不带前导零。换句话说,函数f(x,y)通过将数字x和y从最低位数写入新的数字,从数字y开始,交替地混洗数字x和y。该函数的...

2019-08-17 16:51:46 214

原创 String (字符串哈希)

Given a string S and two integers L and M, we consider a substring of S as “recoverable” if and only if(i) It is of length M*L;(ii) It can be constructed by concatenating M “diversified” subst...

2019-08-16 10:19:02 717 1

原创 A Rational Sequence

题目描述An infinite full binary tree labeled by positive rational numbers is defi ned by:• The label of the root is 1/1.• The left child of label p/q is p/(p+q).• The right child ofl abel p/q is (p+q...

2019-08-15 10:14:25 160

原创 Popular Cows (强连通分量)

Every cow's dream is to become the most popular cow in the herd. In a herd of N (1 <= N <= 10,000) cows, you are given up to M (1 <= M <= 50,000) ordered pairs of the form (A, B) that tell...

2019-08-14 16:19:24 197

原创 MUSICAL CHAIRS (模拟)

题目描述Musical chairs is a game frequently played at children’s parties. Players are seated in a circle facing outwards. When the music starts, the players have to stand up and move clockwise round t...

2019-08-13 09:39:25 570

原创 字符串哈希(模板)

寻找长度为n的主串S中的匹配串T(长度为m)出现的位置或次数属于字符串匹配问题。字符串哈希就是将每个字符串转化为一个数值,然后遍历主串,判断在主串起始位置为i长度为m的字符串的哈希值与匹配串的哈希值是否相等即可,每次判断为O(1)的时间。这样就可以转化为O(n)的时间完成判断。若求字符串中第i位到第j位的哈希值(i<j),则这个值为H(j)-H(i-1)*base^(j-i+1)。...

2019-08-12 15:46:49 227

原创 过河(动态规划)

有一条河,河中有n块石头,现在从河的一边只能通过走石头到达对岸,每一步可以跨越至多3个石头。但是不幸的是,有一块石头被上一个过河的人踩松后被踩松了,所以为了安全后来的人就不能再踩这一块石头了。若现在有一个人想要到河的对岸去,他有多少种方法?注:若我们将石头从1到n进行编号的话,那么被踩松的石头编号为k。输入格式:多组输入对于每组输入在一行中给出2个整数n和...

2019-08-12 09:30:49 1273

原创 Simple Addition expression(组合数学)

题目描述A luxury yacht with 100 passengers on board is sailing on the sea in the twilight. The yacht is ablaze with lights and there comes out laughers and singing from the hall where an evening party ...

2019-08-09 11:43:04 171

原创 Super Jumping! Jumping! Jumping! (动态规划)

Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now.The game c...

2019-08-08 11:07:51 99

原创 Degree Sequence of Graph G(模拟+Havel定理)

题目描述Wang Haiyang is a strong and optimistic Chinese youngster. Although born and brought up in the northern inland city Harbin, he has deep love and yearns for the boundless oceans. After graduation...

2019-08-08 10:35:14 504

空空如也

空空如也

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

TA关注的人

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