将已经链接的边的权值设为0即可。但是可能会超时,提交的时候,有一次显示超时,所以这个解法是有问题的,看到有171ms的,实力差的太大了,还是得使劲刷题。/*2015-5-18 951ms*/#include#include#includeusing namespace std;#define INF...
分类:
其他好文 时间:
2015-05-18 22:24:24
阅读次数:
165
DescriptionThe ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four...
分类:
其他好文 时间:
2015-05-18 20:13:06
阅读次数:
139
Problem Description
Give you three integers n, A and B.
Then we define Si = Ai mod B and Ti = Min{ Sk | i-A = 1}
Your task is to calculate the product of Ti (1
Input
Each line will...
分类:
其他好文 时间:
2015-05-18 14:48:39
阅读次数:
142
Count the number of prime numbers less than a non-negative number,n.1.常规思路(计算复杂度为O(n*sqrt(n))),提交后超时。public static boolean isPrime(int m){ bool...
分类:
其他好文 时间:
2015-05-18 10:32:38
阅读次数:
90
题目来自“廖雪峰的官方网站--Python教程”,尝试用filter()函数删除1~100的素数:defis_prime(n):
ifn<=1:
returnFalse
forsinrange(2,n):
ifn%s==0:
returnFalse
returnTrue
printfilter(is_prime,range(1,101)素数的定义:质数(primenumber)又称素数,有无限个。一个..
分类:
其他好文 时间:
2015-05-17 23:44:44
阅读次数:
310
https://github.com/lyn2313121/mmpackage 高级计算器;import java.util.*;import javax.swing.*;import java.awt.*;import java.awt.event.*;public class Calculate...
分类:
其他好文 时间:
2015-05-17 18:35:37
阅读次数:
117
Link: https://www.hackerrank.com/challenges/identify-smith-numbers 1 def sum_digits(n): 2 return sum(int(x) for x in str(n)) 3 4 def prime_facto...
分类:
其他好文 时间:
2015-05-17 10:44:42
阅读次数:
112
经常使用虚拟现实仿真软件总汇(zz)http://hi.baidu.com/busycai/blog/item/fe57e41e5f25fa1c403417b2.html2007年09月07日 星期五 17:37视景驱动类: OpenGVS 4.5 Vega 3.7 Vega Prime 1...
分类:
其他好文 时间:
2015-05-15 21:15:20
阅读次数:
165
C/C++中的指针可以指向一个函数,也叫函数指针。
注:函数返回值是指针的叫指针函数,中心词在后面,即函数指针其实质是一个指针,指针函数其实质是函数。还是以实例说话,下面的例子进行加减乘除运算。/*compute函数的第三个参数是一个指针函数,这里的calculate是一个变量,其存储的是函数地址,你可以将具有相同签名的函数名传递给calculate也是可以的*/
double compute(d...
分类:
其他好文 时间:
2015-05-15 15:32:37
阅读次数:
117
examination questionsDescription:Count the number of prime numbers less than a non-negative number, nReferences:How Many Primes Are There?Sieve of Era...
分类:
其他好文 时间:
2015-05-15 07:53:07
阅读次数:
388