自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 uvaoj-1595:symmetry

1595 - SymmetryThe figure shown on the left is left-right symmetric as it is possible to fold the sheet of paper along a vertical line, drawn as a dashed line, and to cut the figure into two ide

2016-02-25 20:22:54 524

原创 mooc data structure 韩永楷 HW1.2(homework)

这道题主要就是第一周的课程的内容的训练,训练的是对归并排序(margesort)的运用;题目:题目内容:在一個N個數字的序列S裡,當S[i] > S[j] 且 i Hint : 利用歸併排序法計算一個序列裡有多少逆序數對。Hint : 思考一下在merge的過程,怎麼找到答案!Hint : 直接使用兩層迴圈來找答案的話會超過系統時間限制。输入格式

2016-02-25 14:46:23 1097

原创 uvaoj-10391:conpound words

You are to find all the two-word compound words in a dictionary. A two-word compound word is a word in the dictionary that is the concatenation of exactly two other words in the dictionary.Input

2016-02-24 18:07:32 466

原创 uvaoj-10763:foreign change

Your non-profit organization (iCORE - international Confederation of Revolver Enthusiasts) coordinates a very successful foreign student exchange program. Over the last few years, demand has sky-rocke

2016-02-24 16:05:31 395

原创 uvaoj-10925:throwing cards away

Given is an ordered deck of  n  cards numbered 1 to  n  with card 1 at the top and card  n  at the bottom. The following operation is performed as long as there are at least two cards in the deck:

2016-02-24 15:06:40 468

原创 c++STL中常用模板常用函数记录(新手向)

vector(不定长数组/向量):#include  vector vec;vector[0];//使用下标访问元素;vec.front();//取vec中的第一个元素;vec.back();//取vec中的最末一个元素;vec.push_back(x);//在向量末尾加入元素x;vec.pop_back();//删除末尾元素,同时向量空间减少1;vec.inser

2016-02-24 12:55:17 4516

原创 uvaoj-1594:ducci sequence

A Ducci sequence is a sequence of n-tuples of integers. Given an n-tuple of integers (a1,a2,···,an), the next n-tuple in the sequence is formed by taking the absolute differences of neighboring integer

2016-02-24 12:47:29 341

原创 uvaoj-1592:database

Peter studies the theory of relational databases. Table in the relational database consists of values that are arranged in rows and columns.There are different normal forms that database may adhere

2016-02-24 10:59:48 702

原创 uvaoj-12096:the setstack computer

Background from Wikipedia: Set theory is a branch ofmathematics created principally by the German mathe-matician Georg Cantor at the end of the 19th century.Initially controversial, set theory h

2016-02-24 01:16:55 645

原创 uvaoj-232:crossword answer

A crossword puzzle consists of a rectangular grid of black and white squares and two lists of definitions (or descriptions).One list of definitions is for ``words" to be written left to right across

2016-02-23 20:33:06 557

原创 uvaoj-1593:alignment of code

You are working in a team that writes Incredibly Customizable Programming Codewriter (ICPC) which is basically a text editor with bells and whistles. You are working on a module that takes a piece of

2016-02-23 18:17:00 357

原创 uvaoj-400:Unix Is

The computer company you work for is introducing a brand new computer line and is developing a new Unix-like operating system to be introduced along with the new computer. Your assignment is to write

2016-02-23 15:15:33 778

原创 uvaoj-136:ugly number

Ugly numbers are numbers whose only prime factors are 2, 3 or 5.  The sequence1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, ...shows the first 11 ugly numbers.  By convention, 1 is included.Write

2016-02-23 12:02:28 328

原创 uvaoj-540:team queue

(小白详细讲解向)//Queues and Priority Queues are data structures which are known to most computer scientists. The Team Queue, however, is not so well known, though it occurs often in everyday life. At lunc

2016-02-23 10:50:45 531

原创 nefuoj-549:气球

description   长达5个小时的ACM比赛结束了,每组参赛者桌子前都挂了不同颜色的气球,裁判们想知道哪种颜色的气球最多,请你写个程序帮他们计算一下。   input   输入数据有多组,每组数据第一行是一个数字N(N<100),即气球的总数。接下来是N行,每一行包含一种颜色,颜色是一个字符串,长度不超过15。当N

2016-02-16 23:39:41 366

原创 nefuoj-831:统计good

description我们每天都面临着要学习大量的英文单词,但我最喜欢good这个词,这个词见到的越多,我的生活就越幸福和愉快!给你一些英文单词,你能统计出good有多少个吗?input输入数据的第1行一个N (1 < N < 100),代表输入的数据组数,然后有N 行,每行有很多个单词,单词之间用空格隔开;每行的长度

2016-02-16 16:19:18 572

原创 uvaoj-156:反片语

Most crossword puzzle fans are used to anagrams--groups of words with the same letters in different orders--for example OPTS, SPOT, STOP, POTS and POST. Some words however do not have this attribute

2016-02-16 15:12:41 626

原创 uvaoj-10815:安迪的第一个字典

Andy, 8, has a dream - he wants to produce his very own dictionary. This is not an easy task for him, as the number of words that he knows is, well, not quite enough. Instead of thinking up all the wo

2016-02-16 10:21:54 586

原创 uvaoj-101:小木块

Background Many areas of Computer Science use simple, abstract domains for both analytical and empirical studies. For example, an early AI study of planning and robotics (STRIPS) used a block wo

2016-02-15 15:58:13 549

原创 uvaoj-12474:大理石在哪里

Raju and Meena love to play with Marbles. They have got a lot of marbles with numbers written on them. At the beginning, Raju would place the marbles one after another in ascending order of the number

2016-02-14 22:21:01 737

原创 nefuoj-833:店长推荐2

题解:简单的进行一下循环,因为数据量小,所以直接遍历就行了,水题。code:#include #include #include using namespace std;int main(){    char s[105];    while(cin>>s)    {        int len=strlen(s);        int

2016-02-13 16:49:03 413

原创 nefuoj-834:Hrbust 集训队

题解:这道题和之前做的刘汝佳白书上的一道练习题很像,不过这个更简单一点;附上链接:uvaoj-分子量;code:#include #include #include using namespace std;int main(){    char s[105];    while(cin>>s)    {        int len=strl

2016-02-13 16:37:43 843

原创 nefuoj-813:good

description我们每天都面临着要学习大量的英文单词,但我最喜欢good这个词,这个词见到的越多,我的生活就越幸福和愉快!给你一些英文单词,你能统计出good有多少个吗?input输入数据的第1行一个N (1 < N < 100),代表输入的数据组数,然后有N 行,每行有很多个单词,单词之间用空格隔开;每行的长度

2016-02-13 15:31:36 479

原创 uvaoj-340:猜数字游戏的提示

MasterMind is a game for two players. One of them,Designer, selects a secret code. The other,Breaker, tries to break it. A code is no more than a row of colored dots. At the beginning of a game, t

2016-02-13 13:04:59 831

原创 uvaoj-401:回文词

A regular palindrome is a string of numbers or letters that is the same forward as backward. For example, the string "ABCDEDCBA" is a palindrome because it is the same when the string is read from l

2016-02-13 12:16:16 426

原创 uvaoj-10082:WERTYU

A common typing error is to place the hands on the keyboard one row to the right of the correct position. So "Q" is typed as "W" and "J" is typed as "K" and so on. You are to decode a message typed

2016-02-13 10:49:05 482

原创 nefuoj-1041:字符串变形记

descriptionProblem Description Give you a string, just circumgyrate. The number N means you just circumgyrate the string N times, and each time you circumgyrate the string for 45 degr

2016-02-12 16:22:57 329

原创 nefuoj-1036:2月29日

description给定两个日期,计算这两个日期之间有多少个2月29日(包括起始日期)。只有闰年有2月29日,满足以下一个条件的年份为闰年:1. 年份能被4整除但不能被100整除2. 年份能被400整除input第一行为一个整数T,表示数据组数。之后每组数据包含两行。每一行格式为"month day,

2016-02-12 15:49:07 930

原创 uvaoj-1225:数数字

原题没找到。。贴上链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=247&problem=3666&mosmsg=Submission+received+with+ID+16836885题解:两种方法,第一种就是正常算就好啦,虽

2016-02-12 14:47:52 482

原创 uvaoj-1586:分子量

An organic compound is any member of a large class of chemical compounds whose molecules contain carbon. The molar mass of an organic compound is the mass of one mole of the organic compound. The mola

2016-02-12 14:27:52 621

原创 uvaoj-1585:得分

ScoreThere is an objective test result such as ``OOXXOXXOOO". An `O' means a correct answer of a problem and an `X' means a wrong answer. The score of each problem of this test is calculated by

2016-02-12 13:49:50 639

原创 uvaoj-213:字符串

Message Decoding 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 p

2016-02-12 10:25:41 354

原创 uvaoj-10340:子序列

水题,题目就不贴了;题解:思路很简单,一个指针始终跟随着输入的第一个串;但是需要注意的是,字符数组要开的大一点,不然会RE;另外听说用scanf会导致TLE,我没试过,直接用的cin;code:#include #include #define maxn 100000+10using namespace std;char ins[maxn],cmps[m

2016-02-10 23:08:23 326

原创 nefuoj-1011:最长循环节

Problem : 1011Time Limit : 1000msMemory Limit : 65536Kdescription正整数k的倒数1/k,写为10进制的小数如果为无限循环小数,则存在一个循环节,求<=n的数中,倒数循环节长度最长的那个数。1/6= 0.1(6) 循环节长度为11/7= 0.(14

2016-02-10 22:21:53 660

原创 uvaoj-202:循环小数

The decimal expansion of the fraction 1/33 is 0.03, where the 03 is used to indicate that the cycle 03 repeats indefinitely with no intervening digits. In fact, the decimal expansion of every rational

2016-02-10 21:40:56 470

原创 uvaoj-1368:DNA序列

Figure 1.DNA (Deoxyribonucleic Acid) is the molecule which contains the genetic instructions. It consists of four different nucleotides, namely Adenine, Thymine, Guanine, and Cytosine as shown in Figu

2016-02-10 13:22:01 464

转载 c++中string常用函数整理<引用>

C++中string是标准库中一种容器,相当于保存元素类型为char的vector容器(自己理解),这个类提供了相当丰富的函数来完成对字符串操作,以及与C风格字符串之间转换,下面是对string一些总结 一,C语言的字符串在C语言里,对字符串的处理一项都是一件比较痛苦的事情,因为通常在实现字符串的操作的时候都会用到最不容易驾驭的类型——指针。比如下面这个例子://example

2016-02-03 20:47:35 1588

原创 nefuoj-904:删数问题

description给定n位正整数a,去掉其中任意k个数字后,剩下的数字按原次序排列成一个新的正整数。 n (1input可输入多组测试数据,每组测试数据分两行,每行一个数,数的含义如下。 第一行:正整数a(a是大于0的一个n位正整数) 第二行:正整数k 以0来结束测试数据。output

2016-02-02 23:34:12 560

原创 uvaoj-455:周期串

A character string is said to have periodk if it can be formed by concatenating one or more repetitions of another string of lengthk. For example, the string "abcabcabcabc" has period 3, since it

2016-02-02 20:33:49 619

原创 uvaoj-133:约瑟夫环的模拟

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 larg

2016-02-02 19:19:08 562

空空如也

空空如也

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

TA关注的人

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