Ice_cream's world I Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 741    Accepted Submission(s): 429 Problem Description ice_cream's world is a rich country, it has many fertile lands. Today,…
Ice_cream's world I ice_cream's world is a rich country, it has many fertile lands. Today, the queen of ice_cream wants award land to diligent ACMers. So there are some watchtowers are set up, and wall between watchtowers be build, in order to partit…
称号:pid=2121" target="_blank">hdoj 2121 Ice_cream's world II 题意:题目是一道躶题,给n个点,m条边的有向图.然后找一个点.到全部点的距离和最小.找出这个点并输入距离. 分析:非常明显是求一个最小树形图,可是没有说根节点.要找跟节点,我们能够虚拟一个节 点 x .x 到全部节点连边距离为前面全部距离和+1为 dis . 然后从x 节点求一次最小树形图为ans,则ans - dis 就是最小树形图的距离. 假设图不…
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=2120 Ice_cream's world I Description ice_cream's world is a rich country, it has many fertile lands. Today, the queen of ice_cream wants award land to diligent ACMers. So there are some watchtowers are s…
前文链接:帮初学者改代码——playerc之“练习:求完数问题”(上) 再来看看be_ferfect()应该如何改. be_ferfect()函数的功能是判断number是否为完数,同时把因子对写入divisers数组.以28这个完数为例,在数组中将依次写入 1 28 2 14 4 7 输出时则按要求依大小次序输出 1 2 4 7 14.先从前跳到后,到头之后掉头,再从后跳到前. 这种写入的方式决定了输出代码写起来要困难一些.如果希望输出写得容易些的话,写入时就必须改变这种图省事的办法. 有很多…
原文:“练习:求完数问题” 原代码: // #include <stdio.h> #include <stdlib.h> #include <math.h> #define DIVISERS_MAX_LENGTH (1024) #define TOP (10000) int main(void) { /* * 储存因子,成对的储存.例如6 * 1,6, 2,3 */ int divisers[DIVISERS_MAX_LENGTH] = {0}; int diviser…
// GetWanShu.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include "omp.h" #include <Windows.h> #include "time.h" //函数声明 void getWanShuBySection(); void getWanShu(); void getWanShuByReduction(); int _tmain(int argc, _TCH…
内容: 求两数的整数商 和 商 ,商保留两位小数 输入说明: 一行 两个整数 输出说明: 一行,一个整数,一个实数(两位小数) 输入样例:   12 8 输出样例 : 1 1.50 #include <stdio.h> int main(void) { ; ; scanf("%f %f", &num1, &num2); printf("%d %.2f", (int)(num1 / num2), num1 / num2); ; } 或者 #…
内容: 求两数的整数商 和 余数 输入说明: 一行两个整数 输出说明: 一行两个整数 输入样例:   18 4 输出样例 : 4 2 #include <stdio.h> int main(void) { ; ; scanf("%d %d", &num1, &num2); printf("%d %d", num1 / num2, num1 % num2); ; }…
Under Attack II Time Limit: 5 Seconds      Memory Limit: 65536 KB Because of the sucessfully calculation in Under Attack I, Doctor is awarded with Courage Cross and promoted to lieutenant. But the war seems to end in never, now Doctor has a new order…