摘要: 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 阅读(92) 评论(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 阅读(155) 评论(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 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Problem Description In the world line 1.048596% 回到了比过去还遥远的过去,拯救了牧之原翔子和樱岛麻衣后,世界重归平静。 时间转眼就到了正月新年。梓川咲太却颇不宁静。 “有的时候记住一个电话号码的方法即使把他写成一个容易记住的单词或者短语。比如说要打电话 阅读全文
posted @ 2019-01-12 16:09 RomanticChopin 阅读(125) 评论(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 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 题目描述 有了一张自驾旅游路线图,你会知道城市间的高速公路长度、以及该公路要收取的过路费。现在需要你写一个程序,帮助前来咨询的游客找一条出发地和目的地之间的最短路径。如果有若干条路径都是最短的,那么需要输出最便宜的一条路径。 输入描述 输入说明:输入数据的第1行给出4个正整数N、M、S、D,其中N( 阅读全文
posted @ 2019-01-12 16:09 RomanticChopin 阅读(126) 评论(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 阅读(73) 评论(0) 推荐(0) 编辑
摘要: 题目描述 设计一个算法,删除顺序表中值重复的元素(值相同的元素仅保留第一个),使得表中所有元素的值均不相同。其中顺序表的动态分配用C语言描述如下: #define InitSize 100 //表长度的初始定义 typedef int DataType; //定义表元素的数据类型 typedef s 阅读全文
posted @ 2019-01-12 16:09 RomanticChopin 阅读(3735) 评论(0) 推荐(3) 编辑
摘要: 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 阅读(82) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(46) 评论(0) 推荐(0) 编辑
摘要: Problem Description In the world line 1.048596% 麻衣的鲜血逐渐将洁白而冰冷的绒毯染成鲜红...... 鲜红...... 究竟是多少次看到这样的情境呢?梓川咲太的心已经麻木了。 为了挽救在12月24四日为了梓川咲太而献身的樱岛麻衣。在牧之原翔子的帮助下, 阅读全文
posted @ 2019-01-12 16:09 RomanticChopin 阅读(69) 评论(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 阅读(98) 评论(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 阅读(167) 评论(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 阅读(87) 评论(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 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 题目描述 在带权有向图G中,求G中的任意一对顶点间的最短路径问题,也是十分常见的一种问题。 解决这个问题的一个方法是执行n次迪杰斯特拉算法,这样就可以求出每一对顶点间的最短路径,执行的时间复杂度为O(n3)。 而另一种算法是由弗洛伊德提出的,时间复杂度同样是O(n3),但算法的形式简单很多。 可以将 阅读全文
posted @ 2019-01-12 16:08 RomanticChopin 阅读(258) 评论(0) 推荐(0) 编辑
摘要: Description 有一只经过训练的蜜蜂只能爬向右侧相邻的蜂房,不能反向爬行。请编程计算蜜蜂从蜂房a爬到蜂房b的可能路线数。 其中,蜂房的结构如下所示。 Input 输入数据的第一行是一个整数N,表示测试实例的个数,然后是N 行数据,每行包含两个整数a和b(0<a<b<50)。 Output 对 阅读全文
posted @ 2019-01-12 16:08 RomanticChopin 阅读(58) 评论(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 阅读(2716) 评论(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 阅读(95) 评论(0) 推荐(0) 编辑
摘要: Description 输入一个字符串,判断其是否是C的合法标识符。 Input 输入数据包含多个测试实例,数据的第一行是一个整数n,表示测试实例的个数,然后是n行输入数据,每行是一个长度不超过50的字符串。 Output 对于每组输入数据,输出一行。如果输入数据是C的合法标识符,则输出"yes", 阅读全文
posted @ 2019-01-12 16:07 RomanticChopin 阅读(417) 评论(0) 推荐(0) 编辑
-->
Live2D