摘要:
A tourist gets lost in the desert with n liters of water. He drinks positive integer units of water each day. Write a program to calculate how many di 阅读全文
posted @ 2019-01-12 16:10
RomanticChopin
阅读(99)
评论(0)
推荐(0)
摘要:
Description HDOJ上面已经有10来道A+B的题目了,相信这些题目曾经是大家的最爱,希望今天的这个A+B能给大家带来好运,也希望这个题目能唤起大家对ACM曾经的热爱。 这个题目的A和B不是简单的整数,而是两个时间,A和B 都是由3个整数组成,分别表示时分秒,比如,假设A为34 45 56 阅读全文
posted @ 2019-01-12 16:10
RomanticChopin
阅读(172)
评论(0)
推荐(0)
摘要:
Description 有一个大小是 2 x n 的网格,现在需要用2种规格的骨牌铺满,骨牌规格分别是 2 x 1 和 2 x 2,请计算一共有多少种铺设的方法。 Input 输入的第一行包含一个正整数T(T<=20),表示一共有 T组数据,接着是T行数据,每行包含一个正整数N(N<=30),表示网 阅读全文
posted @ 2019-01-12 16:10
RomanticChopin
阅读(124)
评论(0)
推荐(0)
摘要:
1、大数加法 string add(string a,string b) { string c; int len1=a.length(); int len2=b.length(); int len=max(len1,len2); for(int i=len1;i<len;i++) a="0"+a; 阅读全文
posted @ 2019-01-12 16:09
RomanticChopin
阅读(201)
评论(0)
推荐(0)
摘要:
Description Fibonacci数列,定义如下: f(1)=f(2)=1 f(n)=f(n-1)+f(n-2) n>=3。 计算第n项Fibonacci数值。 Input 输入第一行为一个整数N,接下来N行为整数Pi(1<=Pi<=1000)。 Output 输出为N行,每行为对应的f(P 阅读全文
posted @ 2019-01-12 16:09
RomanticChopin
阅读(90)
评论(0)
推荐(0)
摘要:
Description I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B. Input The first line of the i 阅读全文
posted @ 2019-01-12 16:09
RomanticChopin
阅读(105)
评论(0)
推荐(0)
摘要:
Problem Description In the world line 1.048596% 回到了比过去还遥远的过去,拯救了牧之原翔子和樱岛麻衣后,世界重归平静。 时间转眼就到了正月新年。梓川咲太却颇不宁静。 “有的时候记住一个电话号码的方法即使把他写成一个容易记住的单词或者短语。比如说要打电话 阅读全文
posted @ 2019-01-12 16:09
RomanticChopin
阅读(133)
评论(0)
推荐(0)
摘要:
As a cute girl, Kotori likes playing ``Hide and Seek'' with cats particularly. Under the influence of Kotori, many girls and cats are playing ``Hide a 阅读全文
posted @ 2019-01-12 16:09
RomanticChopin
阅读(81)
评论(0)
推荐(0)
摘要:
题目描述 设计一个算法,删除顺序表中值重复的元素(值相同的元素仅保留第一个),使得表中所有元素的值均不相同。其中顺序表的动态分配用C语言描述如下: #define InitSize 100 //表长度的初始定义 typedef int DataType; //定义表元素的数据类型 typedef s 阅读全文
posted @ 2019-01-12 16:09
RomanticChopin
阅读(3820)
评论(0)
推荐(3)
摘要:
Description Given an integer N(0 ≤ N ≤ 10000), your task is to calculate N! Input One N in one line, process to the end of file. Output For each N, ou 阅读全文
posted @ 2019-01-12 16:09
RomanticChopin
阅读(49)
评论(0)
推荐(0)
摘要:
Problem Description In the world line 1.048596% 麻衣的鲜血逐渐将洁白而冰冷的绒毯染成鲜红...... 鲜红...... 究竟是多少次看到这样的情境呢?梓川咲太的心已经麻木了。 为了挽救在12月24四日为了梓川咲太而献身的樱岛麻衣。在牧之原翔子的帮助下, 阅读全文
posted @ 2019-01-12 16:09
RomanticChopin
阅读(79)
评论(0)
推荐(0)
摘要:
题目描述 有了一张自驾旅游路线图,你会知道城市间的高速公路长度、以及该公路要收取的过路费。现在需要你写一个程序,帮助前来咨询的游客找一条出发地和目的地之间的最短路径。如果有若干条路径都是最短的,那么需要输出最便宜的一条路径。 输入描述 输入说明:输入数据的第1行给出4个正整数N、M、S、D,其中N( 阅读全文
posted @ 2019-01-12 16:09
RomanticChopin
阅读(132)
评论(0)
推荐(0)
摘要:
You're given an array aa of length nn. You can perform the following operations on it: choose an index ii (1≤i≤n)(1≤i≤n), an integer xx (0≤x≤106)(0≤x≤ 阅读全文
posted @ 2019-01-12 16:08
RomanticChopin
阅读(154)
评论(0)
推荐(0)
摘要:
题目描述 算法训练 9-7链表数据求和操作 时间限制:1.0s 内存限制:512.0MB 读入10个复数,建立对应链表,然后求所有复数的和。 样例输入 1 2 1 3 4 5 2 3 3 1 2 1 4 2 2 2 3 3 1 1 样例输出 23+23i #include<iostream> #in 阅读全文
posted @ 2019-01-12 16:08
RomanticChopin
阅读(176)
评论(0)
推荐(0)
摘要:
Welcome to HDU to take part in the first CCPC girls' competition! As a pretty special competition, many volunteers are preparing for it with high enth 阅读全文
posted @ 2019-01-12 16:08
RomanticChopin
阅读(99)
评论(0)
推荐(0)
摘要:
题目描述 在带权有向图G中,求G中的任意一对顶点间的最短路径问题,也是十分常见的一种问题。 解决这个问题的一个方法是执行n次迪杰斯特拉算法,这样就可以求出每一对顶点间的最短路径,执行的时间复杂度为O(n3)。 而另一种算法是由弗洛伊德提出的,时间复杂度同样是O(n3),但算法的形式简单很多。 可以将 阅读全文
posted @ 2019-01-12 16:08
RomanticChopin
阅读(277)
评论(0)
推荐(0)
摘要:
Description 有一只经过训练的蜜蜂只能爬向右侧相邻的蜂房,不能反向爬行。请编程计算蜜蜂从蜂房a爬到蜂房b的可能路线数。 其中,蜂房的结构如下所示。 Input 输入数据的第一行是一个整数N,表示测试实例的个数,然后是N 行数据,每行包含两个整数a和b(0<a<b<50)。 Output 对 阅读全文
posted @ 2019-01-12 16:08
RomanticChopin
阅读(71)
评论(0)
推荐(0)
摘要:
一、值传递 #include <iostream> #include <string> using namespace std; struct Student { int id; string name; float score[2]; }; void OutCome(Student s) { co 阅读全文
posted @ 2019-01-12 16:08
RomanticChopin
阅读(2842)
评论(0)
推荐(0)
摘要:
A. Vova and Train time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vova plans to go to the 阅读全文
posted @ 2019-01-12 16:07
RomanticChopin
阅读(149)
评论(0)
推荐(0)
摘要:
Description 对于输入的每个字符串,查找其中的最大字母,在该字母后面插入字符串“(max)”。 Input 输入数据包括多个测试实例,每个实例由一行长度不超过100的字符串组成,字符串仅由大小写字母构成。 Output 对于每个测试实例输出一行字符串,输出的结果是插入字符串“(max)”后 阅读全文
posted @ 2019-01-12 16:07
RomanticChopin
阅读(92)
评论(0)
推荐(0)
摘要:
Description lin2144是一只小菜鸟,都是笨鸟先飞,lin2144想来个菜鸟先飞,他从0点出发 一开始的飞行速度为1m/s,每过一个单位时间lin2144的飞行速度比上一个单位时间的飞行速度快2m/s,问n (0 < n < 10^5)个单位时间之后lin2144飞了多远? Input 阅读全文
posted @ 2019-01-12 16:07
RomanticChopin
阅读(123)
评论(0)
推荐(0)
摘要:
Problem Statement A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T−x×0.006 de 阅读全文
posted @ 2019-01-12 16:07
RomanticChopin
阅读(102)
评论(0)
推荐(0)
摘要:
Description 输入一个字符串,判断其是否是C的合法标识符。 Input 输入数据包含多个测试实例,数据的第一行是一个整数n,表示测试实例的个数,然后是n行输入数据,每行是一个长度不超过50的字符串。 Output 对于每组输入数据,输出一行。如果输入数据是C的合法标识符,则输出"yes", 阅读全文
posted @ 2019-01-12 16:07
RomanticChopin
阅读(441)
评论(0)
推荐(0)
摘要:
做了一个小时有事出去了,所以还没看其他的题目,放寒假的时候再补上吧。 A :dreamstart的催促 简单快速幂的运用,水题。 链接:https://ac.nowcoder.com/acm/contest/322/A 来源:牛客网 题目描述 有一天集训队的学弟们正在计算一堆数,但是dreamsta 阅读全文
posted @ 2019-01-12 16:06
RomanticChopin
阅读(133)
评论(0)
推荐(0)
摘要:
A. Frog Jumping time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A frog is currently at th 阅读全文
posted @ 2019-01-12 16:06
RomanticChopin
阅读(219)
评论(0)
推荐(0)
摘要:
大致的解题思路就是:只要后面一个字符比前面的大,就删除这个字符就好啦。越前面的字符越好。 当然也要考虑到所有字符都相等的情况。 A. Minimizing the String time limit per test 1 second memory limit per test 256 megaby 阅读全文
posted @ 2019-01-12 16:06
RomanticChopin
阅读(100)
评论(0)
推荐(0)
摘要:
Problem Description In the world line 1.048596% “为了帮助笨蛋梓川利用程序来解决青春期症候群的问题,我觉得有必要你给你普及一下C语言的内存知识。” 今天的双叶理央也依然在理科实验室用烧杯煮咖啡。 “我已经几年没有用过这个东西,还被人可怜的说是原始人了哦 阅读全文
posted @ 2019-01-12 16:06
RomanticChopin
阅读(100)
评论(0)
推荐(0)
摘要:
题目描述 根据输入的int 数组建立哈希表,然后查找是否存在相应元素。 输入描述 第一行为测试数据的组数n, 下面有n组测试数据。对于每组测试数据,第一行为用空格隔开的int数列,数量不超过1,000,000,下面一行为查找数目m, 接下来的m行为m个需要查找的数(int型)。 输出描述 每组测试数 阅读全文
posted @ 2019-01-12 16:06
RomanticChopin
阅读(388)
评论(0)
推荐(1)
摘要:
链接:https://ac.nowcoder.com/acm/contest/333/B 来源:牛客网 题目描述 AH是auction house,拍卖行的缩写。众所周知,为了道具流通,基本上每个网络游戏都会有拍卖行或者类似拍卖行的系统存在。 Wpremig最近喜欢上玩《XX传奇》,游戏为了吸引玩家 阅读全文
posted @ 2019-01-12 16:06
RomanticChopin
阅读(92)
评论(0)
推荐(0)
摘要:
题目描述 编写多线程应用程序,模拟三个人Tom,Peter,Bob过山洞: 1、这个山洞每次只能通过一个人,每个人通过山洞的时间为1秒 2、过山洞次序为:Tom,Peter,Bob 将下列代码补充完整: public class Main{ public static void main(Strin 阅读全文
posted @ 2019-01-12 16:06
RomanticChopin
阅读(167)
评论(0)
推荐(0)
摘要:
该算法时间复杂度为: O(n*loglogn) 当 n = 1e6 时 , 复杂度约为 7.7 * 10^5 ,优于O( n ) //素数线性筛法,复杂度:O(nloglogn) //求100以内素数 #include<iostream> #include<cstring> #include<str 阅读全文
posted @ 2019-01-12 16:05
RomanticChopin
阅读(590)
评论(0)
推荐(0)
摘要:
题目描述 在带权有向图G中,给定一个源点v,求从v到G中的其余各顶点的最短路径问题,叫做单源点的最短路径问题。 在常用的单源点最短路径算法中,迪杰斯特拉算法是最为常用的一种,是一种按照路径长度递增的次序产生最短路径的算法。 可将迪杰斯特拉算法描述如下: 在本题中,读入一个有向图的带权邻接矩阵(即数组 阅读全文
posted @ 2019-01-12 16:05
RomanticChopin
阅读(221)
评论(0)
推荐(0)
摘要:
很简单的一元二次方程,用高中学的公式求解就好啦。 大晚上打比赛真刺激!!!嘿嘿嘿 C. Meme Problem time limit per test 1 second memory limit per test 256 megabytes input standard input output 阅读全文
posted @ 2019-01-12 16:05
RomanticChopin
阅读(121)
评论(0)
推荐(0)
摘要:
JATC and his friend Giraffe are currently in their room, solving some problems. Giraffe has written on the board an array a1a1, a2a2, ..., anan of int 阅读全文
posted @ 2019-01-12 16:05
RomanticChopin
阅读(101)
评论(0)
推荐(0)
摘要:
Description 话说,经过了漫长的一个多月,小明已经成长了许多,所以他改了一个名字叫“大明”。 这时他已经不是那个只会做100以内加法的那个“小明”了,现在他甚至会任意长度的正小数的加法。 现在,给你两个正的小数A和B,你的任务是代表大明计算出A+B的值。 Input 本题目包含多组测试数据 阅读全文
posted @ 2019-01-12 16:05
RomanticChopin
阅读(90)
评论(0)
推荐(0)
摘要:
线性筛法,数学问题,找规律。 You are given an integer number nn. The following algorithm is applied to it: if n=0n=0, then end algorithm; find the smallest prime di 阅读全文
posted @ 2019-01-12 16:05
RomanticChopin
阅读(124)
评论(0)
推荐(0)
摘要:
Problem Description “上一个国家的人真的是好心呢。” 在山脉群之间,是一片宽广平坦的大地。被草木覆盖的绿意,顺着灰色的山间延伸。 摩托车(注:两轮的车子,尤其是指不在天空飞行的交通工具)飞驰在道路上。 骑士年约十五、六岁,有着一头黑色短发及炯炯有神的脸庞。 她身穿黑色夹克,腰际系 阅读全文
posted @ 2019-01-12 16:05
RomanticChopin
阅读(190)
评论(0)
推荐(0)
摘要:
题目描述 近来,跳一跳这款小游戏风靡全国,受到不少玩家的喜爱。 简化后的跳一跳规则如下:玩家每次从当前方块跳到下一个方块,如果没有跳到下一个方块上则游戏结束。 如果跳到了方块上,但没有跳到方块的中心则获得1分;跳到方块中心时,若上一次的得分为1分或这是本局游戏的第一次跳跃则此次得分为2分,否则此次得 阅读全文
posted @ 2019-01-12 16:04
RomanticChopin
阅读(123)
评论(0)
推荐(0)
摘要:
Problem Description In the world line 1.048596% 在反覆上演的梦境中,两年前的梓川咲太坐在通往沙滩的阶梯,心不在焉地看着七里滨的海。 这也一定是梦,接下来的进展他早已知晓。翔子小姐就要来了。 “咲太小弟今天的心情也处于低潮呢。”,翔子踩着轻快脚步现身,坐 阅读全文
posted @ 2019-01-12 16:04
RomanticChopin
阅读(126)
评论(0)
推荐(0)
摘要:
Problem Description In the world line 1.048596% “梓川......今天是第几次了?” 双叶理央正在摆弄虹吸式咖啡壶,她看梓川咲太的目光已经不是傻眼或者嫌烦,而是带着悲悯。 “这次不是青春期症候群的事情,而是这个。”梓川拿出了『翔子小姐』的信件。 “寻求 阅读全文
posted @ 2019-01-12 16:04
RomanticChopin
阅读(143)
评论(0)
推荐(0)
摘要:
There are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2). Input Input consists of a sequence of lines, each con 阅读全文
posted @ 2019-01-12 16:04
RomanticChopin
阅读(233)
评论(0)
推荐(0)
摘要:
题目描述 1.从命令行读入一个队名,输出该队获得冠军是哪一年(以下面五届数据作为基础数据)。如果该队没有获得冠军,则输出:队名+“ lose the championship!”。 2.下面是五届世界杯数据: 届数 举办年份 举办地点 冠军 第一届,1930年,Uruguay,Uruguay; 第三 阅读全文
posted @ 2019-01-12 16:03
RomanticChopin
阅读(212)
评论(0)
推荐(0)
摘要:
Problem Description In the world line 1.048596% ——咲太小弟,我认为啊,人生是为了变温柔而存在的。 ——为了达到『温柔』这个目标,我努力活到现在。 在梓川花枫患有解离性障碍以后,失去了所有的记忆,忘记了自己是谁。 “我们会把自己的知觉,意识与记忆整合在 阅读全文
posted @ 2019-01-12 16:03
RomanticChopin
阅读(152)
评论(0)
推荐(0)
摘要:
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 阅读全文
posted @ 2019-01-12 16:03
RomanticChopin
阅读(90)
评论(0)
推荐(0)
摘要:
题目描述 输入任意顺序的整数序列,输出结果为从小到大的排序结果 输入描述 输入一个整数序列,整数之间用空格隔开,输入完最后一个整数,回车 输出描述 从小到大的排序结果 输入样例 9 8 7 6 5 4 输出样例 4 5 6 7 8 9 提示 注意,主类名称务必为Main,其他类修饰符不可为publi 阅读全文
posted @ 2019-01-12 16:03
RomanticChopin
阅读(173)
评论(0)
推荐(0)
摘要:
乐曲介绍: 贝多芬《升c小调第十四钢琴奏鸣曲》 Piano Sonata No.14, Op.27 No.2 又名《月光奏鸣曲》 作于1801年 《月光》这一名的由来众说纷纭,但最多的是源于德国诗人路德维希·雷尔施塔布(1799-1860)形容这首乐曲的第一乐章为“如在瑞士琉森湖那月光闪耀的湖面上一 阅读全文
posted @ 2019-01-12 16:03
RomanticChopin
阅读(572)
评论(0)
推荐(0)
摘要:
链接:https://ac.nowcoder.com/acm/contest/333/F 来源:牛客网 题目描述 Jhadgre为了他的女神,准备了一场盛大的告白,可惜却被女神毫不留情的拒绝。于是Jhadgre决定离开这个伤心之地。但是钱都被Jhadgre拿去准备告白了,剩下的钱并不够他买车票,只够 阅读全文
posted @ 2019-01-12 16:03
RomanticChopin
阅读(131)
评论(0)
推荐(0)
摘要:
直接在网盘上下载,方便快捷: 链接:https://pan.baidu.com/s/12wrnr_eEGkCtS9Ny9ZCDFw 提取码:38f7 教程如下: 阅读全文
posted @ 2019-01-12 16:03
RomanticChopin
阅读(500)
评论(0)
推荐(0)
摘要:
题目描述 编一个程序,读入用户输入的一串先序遍历字符串,根据此字符串建立一个二叉树(以指针方式存储)。 例如如下的先序遍历字符串: ABC##DE#G##F### 其中“#”表示的是空格,空格字符代表空树。建立起此二叉树以后,再对二叉树进行中序遍历,输出遍历结果。 输入描述 输入包括1行字符串,长度 阅读全文
posted @ 2019-01-12 16:02
RomanticChopin
阅读(253)
评论(0)
推荐(0)
摘要:
这其实是代码风格问题, node* p = node *p = node * p; 但是建议用 node *p的写法,因为这样方便定义多个指针变量。 比如: node *p,*a,*b; 就创建了3个node类型的指针变量。 阅读全文
posted @ 2019-01-12 16:02
RomanticChopin
阅读(542)
评论(0)
推荐(0)
摘要:
链接:https://ac.nowcoder.com/acm/contest/333/I 来源:牛客网 题目描述 最近Jhadgre拿到了一个系列表情包,他很高兴,于是他给每个关系好的女性好友都送了一盒饼干外带这一套表情包。 结果让他惊呆了,竟然真的有女孩子答应他........再来一盒(不然你以为 阅读全文
posted @ 2019-01-12 16:02
RomanticChopin
阅读(99)
评论(0)
推荐(0)
摘要:
There are nn students in a university. The number of students is even. The ii-th student has programming skill equal to aiai. The coach wants to form 阅读全文
posted @ 2019-01-12 16:02
RomanticChopin
阅读(82)
评论(0)
推荐(0)
摘要:
Description As the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because the 阅读全文
posted @ 2019-01-12 16:02
RomanticChopin
阅读(109)
评论(0)
推荐(0)
摘要:
链接:https://ac.nowcoder.com/acm/contest/333/J 来源:牛客网 题目描述 继上次Jhadgre在楼梯上跳台阶玩了很久之后,他获得了一个很强(la)力(ji)的能力,那就是上楼梯的时候可以跨任意偶数级台阶.... 今天上完课,Jhadgre又开始了他的跳台阶之旅 阅读全文
posted @ 2019-01-12 16:02
RomanticChopin
阅读(77)
评论(0)
推荐(0)
摘要:
链接:https://ac.nowcoder.com/acm/contest/326/A 来源:牛客网 题目描述 10年后,tokitsukaze大佬已经变成了年收入超百万的的精英程序员,家里没钱也没矿的teitoku,找tokitsukaze大佬借1000块钱,然后tokitsukaze大佬说,借 阅读全文
posted @ 2019-01-12 16:02
RomanticChopin
阅读(200)
评论(0)
推荐(0)
摘要:
题目描述 本题要求实现一个简易连连看游戏模拟程序。 给定一个2的方阵网格游戏盘面,每个格子中放置一些符号。这些符号一定是成对出现的,同一个符号可能不止一对。程序读入玩家给出的一对位置(x1,y1)、(x2,y2),判断这两个位置上的符号是否匹配。如果匹配成功,则将两个符号消为“*”并输出消去后的盘面 阅读全文
posted @ 2019-01-12 16:01
RomanticChopin
阅读(219)
评论(0)
推荐(0)
摘要:
A. Uniform String time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given two integ 阅读全文
posted @ 2019-01-12 16:01
RomanticChopin
阅读(108)
评论(0)
推荐(0)
摘要:
链接:https://ac.nowcoder.com/acm/contest/333/D 来源:牛客网 题目描述 陶陶摘了这么多年苹果,Jhadgre他也很想摘苹果。 这天Jhadgre趁着陶陶还没起床,决定先去把苹果摘了,现在Jhadgre知道树上有N个苹果以及每个苹果离地面的高度,当然机智的Jh 阅读全文
posted @ 2019-01-12 15:58
RomanticChopin
阅读(1)
评论(0)
推荐(0)

浙公网安备 33010602011771号