自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

JW12138的博客

但行好事,莫问前程!!!

  • 博客(77)
  • 收藏
  • 关注

原创 2018年第九届蓝桥杯C++组B组第二题——明码

标题:明码汉字的字形存在于字库中,即便在今天,16点阵的字库也仍然使用广泛。16点阵的字库把每个汉字看成是16x16个像素信息。并把这些信息记录在字节中。一个字节可以存储8位信息,用32个字节就可以存一个汉字的字形了。把每个字节转为2进制表示,1表示墨迹,0表示底色。每行2个字节,一共16行,布局是:    第1字节,第2字节    第3字节,第4字节    ....    第31字节, 第32字...

2018-04-02 09:50:51 1292 7

原创 Brackets Sequence (POJ-1141)

Let us define a regular brackets sequence in the following way:1. Empty sequence is a regular sequence. 2. If S is a regular sequence, then (S) and [S] are both regular sequences. 3. If A an

2017-07-19 19:14:57 487

原创 Power of Cryptography(POJ-2109 && UVA-113)

DescriptionCurrent work in cryptography involves (among other things) large prime numbers and computing powers of numbers among these primes. Work in this area has resulted in the practical use of r

2017-06-20 20:57:36 334

原创 The Pilots Brothers' refrigerator(POJ-2965)

DescriptionThe game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to open a refrigerator.There are 16 handles on the refrigerator door. Every handle can b

2017-06-20 20:14:15 274

原创 Flip Game(POJ-1753)

DescriptionFlip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares. One side of each piece is white and the other one is black and each piece is lying e

2017-06-20 18:52:31 287

原创 Message Decoding (UVA-213)

Some message encoding schemes require that an encoded message be sent in two parts. The first part,called the header, contains the characters of the message. The second part contains a pattern that re

2017-06-18 12:05:45 426

原创 树——数据结构

二叉树的链式储存及其操作,Huffman树及Huffman编码;#include#include#includetypedef struct Node //二叉树的链式储存方式;{ char data; struct Node*LChild; struct Node*RChild;} BitNode,*BiTree;void Init(BiTr

2017-06-17 19:15:54 303

原创 Hangman Judge (UVA-489)

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

2017-06-16 19:10:25 267

原创 Ancient Cipher (UVA-10340 && POJ-2159)

DescriptionAncient Roman empire had a strong government system with various departments, including a secret service department. Important documents were sent between provinces and the capital in enc

2017-06-16 18:57:49 275

原创 稀疏矩阵——数据结构

三元组表表示法和十字链表表示法及转置函数;#include#include#define maxn 100typedef struct //三元组表表示法;{ int row,col; int e;} Triple;typedef struct{ Triple data[maxn+1]; int m,n,len;} TSMatrix;

2017-06-15 22:12:34 717

原创 KMP算法模板

KMP算法是一种改进的字符串匹配算法,又称“看毛片”算法,时间复杂度为O(m+n);还不是很懂,但是代码挺简单的,先敲个模板,之后再细看;#include#include#include#include#define maxn 10010using namespace std;int next[maxn];void getNext(string s) //

2017-06-14 11:22:14 223

原创 串——数据结构

数据结构#include#include#include#define maxn 100typedef struct //串;{ char ch[maxn]; int len;} SString;void StrInsert(SString *s,int pos,SString t) //在s上的pos位置查入一个t的字符串;{ if(p

2017-06-13 22:02:06 346

原创 队列——数据结构

链队列和循环队列及其应用——杨辉三角#include#includetypedef struct Node //链队列;{ int data; struct Node *next;} LinkQueueNode;typedef struct{ LinkQueueNode *front; LinkQueueNode *rear;} Li

2017-06-13 19:49:07 327

原创 栈——数据结构

顺序栈,链栈及其应用——括号匹配算法#include#include#define maxn 100typedef struct //顺序栈;{ char elem[maxn]; int top;}SeqStack;void InitStack(SeqStack *S){ S->top=-1;}void Push(SeqStack *S

2017-06-12 22:24:13 324

原创 线性表——数据结构

线性表分顺序储存和链式储存,链式储存只写了单链表、循环链表和双向链表,及线性表的应用——一元多项式的表示及相加;线性表的顺序储存及其操作:#include#include#define maxn 100#define OK 1#define ERROR 0typedef struct //定义线性表顺序储存;{ int elem[maxn];

2017-06-12 20:11:10 367

原创 函数带出方式示例——数据结构

数据结构学习;ps:p29#include#includetypedef struct //定义结构体;{ int max,min;} Data;int MIN; //全局变量;int fun1(int a[],int n){ int max; max=MIN=a[0]; //初始化; for(int i=1; i<n

2017-06-01 20:58:26 1178 3

原创 Coins (HDU-2844)

Problem DescriptionWhuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One day Hibix opened purse and found there were some coins. He decided to buy a very nice watch in a

2017-05-31 11:00:50 406

原创 汉诺塔(火车掉头)-课程设计

跟我两个队友一起,我们三个一组,每个组都要有高低分。他俩都是拿专业前三的人,都比较看重分数,反正我对成绩也不在乎,就让给他俩了,所以就给了我一个简单的题。不过既然做了,就想做好点吧。下面铁路线A段中,有n个车头,按图中所示的顺序编号为1,2,...,n。每个车头都可以在铁路上独立行驶,但约定,当B段或C段已有车头时,新进入这二段的车头号必须比该段中已有的车头号小。设计一个程序,

2017-05-24 10:43:21 492

原创 Exponentiation(POJ-1001) Java大数例题

DescriptionProblems involving the computation of exact values of very large magnitude and precision are common. For example, the computation of the national debt is a taxing experience for many comp

2017-05-24 10:30:32 511

原创 ACM-Java中大数的应用

BigInteger: BigInteger a,b,c; //定义; a=BigInteger.ZERO; //0; b=BigInteger.ONE; //1; c=BigInteger.TEN; //10; c=BigInteger.valueOf(10); //把long long赋给c; a=a.abs(); //绝对值; 要有等号; a=a.add(b);

2017-05-24 10:22:40 377

原创 Arbitrage(POJ-2240 && HDU-1217)

DescriptionArbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currency. For example, suppose that 1 US Dollar bu

2017-05-24 10:10:00 406

原创 Invitation Cards(POJ-1511)

DescriptionIn the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater and, most of all, Antique Co

2017-05-23 22:03:31 315

原创 Heavy Transportation(POJ-1797)

DescriptionBackgroundHugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there really is a way from the

2017-05-23 21:51:18 267

原创 Choose the best route(HDU-2680)

Problem DescriptionOne day , Kiki wants to visit one of her friends. As she is liable to carsickness , she wants to arrive at her friend’s home as soon as possible . Now give you a map of the city’s

2017-05-23 21:40:42 223

原创 Radar Installation(POJ-1328)

DescriptionAssume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea side. And any radar installation, loc

2017-05-23 21:16:07 230

原创 Thrall’s Dream(山东省第四届ACM大学生程序设计竞赛 )

Problem DescriptionWe never paid any heed to the ancient prophecies, like fools we clung to the old hatreds, and fought as we had for generations. Until one day the sky rained fire, and a new enem

2017-05-23 20:59:57 344

原创 快速幂( O(log n) )

快速幂模板,时间复杂度O(log n);#include#includeusing namespace std;int pow_mod(int a,int n,int m)//快速幂,a为底数,n为幂数,m为mod数;{ if(n==0) return 1; int x=pow_mod(a,n/2,m); long long ans=(long lo

2017-05-23 20:52:40 366

原创 Fruit Ninja II(山东省第三届ACM大学生程序设计竞赛 )

Problem Description Have you ever played a popular game named "Fruit Ninja"?Fruit Ninja (known as Fruit Ninja HD on the iPad and Fruit Ninja THD for Nvidia Tegra 2 based Android devices)

2017-05-23 20:46:35 748

原创 Rescue The Princess(山东省第四届ACM大学生程序设计竞赛 )

Problem Description    Several days ago, a beast caught a beautiful princess and the princess was put in prison. To rescue the princess, a prince who wanted to marry the princess set out immedia

2017-05-23 20:43:08 704

原创 How Many Nines(ZOJ-3950)

If we represent a date in the format YYYY-MM-DD (for example, 2017-04-09), do you know how many 9s will appear in all the dates between Y1-M1-D1 and Y2-M2-D2 (both inclusive)?Note that you should ta

2017-05-23 20:37:02 435

原创 Mathman Bank(第二届ACM大学生程序设计竞赛 )

Problem Description With the development of mathmen's mathematics knowlege, they have finally invented computers. Therefore, they want to use computers to manage their banks. However, mathmen's pr

2017-05-23 20:31:06 257

原创 Identifiers(第二届ACM大学生程序设计竞赛 )

Problem Description Identifier is an important concept in the C programming language. Identifiers provide names for several language elements, such as functions, variables, labels, etc.An identifi

2017-05-23 20:17:45 214

原创 n a^o7 !(山东省第三届ACM大学生程序设计竞赛 )

Problem Description All brave and intelligent fighters, next you will step into a distinctive battleground which is full of sweet and happiness. If you want to win the battle, you must do warm-u

2017-05-23 20:09:47 479

原创 Contest Print Server(山东省第四届ACM大学生程序设计竞赛 )

Problem 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-23 11:14:42 256

原创 Full Binary Tree(山东省第五届ACM大学生程序设计竞赛 )

Problem DescriptionIn computer science, a binary tree is a tree data structure in which each node has at most two children. Consider an infinite full binary tree (each node has two children except

2017-05-23 11:05:17 263

原创 Weighted Median(山东省第五届ACM大学生程序设计竞赛 )

Problem DescriptionFor n elements x1, x2, ..., xn with positive integer weights w1, w2, ..., wn. The weighted median is the element xk satisfying and  , S indicates Can you compute the weighted

2017-05-23 11:01:54 344

原创 兴奋剂检查(Vijos-1426)

背景北京奥运会开幕了,这是中国人的骄傲和自豪,中国健儿在运动场上已经创造了一个又一个辉煌,super pig也不例外………………描述虽然兴奋剂是奥运会及其他重要比赛的禁药,是禁止服用的。但是运动员为了提高成绩难免要服用一些,super pig也不例外。为了不被尿检检查出来,这些药品就只能选一些不容易被发现的来服用。但是奥委会关于兴奋剂检查有很多个指标,只有尿检中各项数值均不高于规定指标

2017-05-23 10:56:09 400

原创 搭建双塔(Vijos-1037)

描述2001年9月11日,一场突发的灾难将纽约世界贸易中心大厦夷为平地,Mr. F曾亲眼目睹了这次灾难。为了纪念“9?11”事件,Mr. F决定自己用水晶来搭建一座双塔。Mr. F有N块水晶,每块水晶有一个高度,他想用这N块水晶搭建两座有同样高度的塔,使他们成为一座双塔,Mr. F可以从这N块水晶中任取M(1≤M≤N)块来搭建。但是他不知道能否使两座塔有同样的高度,也不知道如果能搭建成一座

2017-05-23 10:45:37 430

原创 多人背包(Vijos-1412)

描述DD 和好朋友们要去爬山啦!他们一共有 K 个人,每个人都会背一个包。这些包的容量是相同的,都是 V。可以装进背包里的一共有 N 种物品,每种物品都有给定的体积和价值。在 DD 看来,合理的背包安排方案是这样的:每个人背包里装的物品的总体积恰等于包的容量。 每个包里的每种物品最多只有一件,但两个不同的包中可以存在相同的物品。 任意两个人,他们包里的物品清单不能完全相同。

2017-05-23 10:31:36 771

原创 ACboy needs your help(HDU-1712)

Problem DescriptionACboy has N courses this term, and he plans to spend at most M days on study.Of course,the profit he will gain from different course depending on the days he spend on it.How to ar

2017-05-23 10:05:40 314

空空如也

空空如也

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

TA关注的人

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