To The Max
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 7533 Accepted Submission(s): 3647
Problem Description
Given a two-dim...
摆明的一个TSP问题,但是解决TSP问题的效率是相当低的。
不过这里的点数很少,而且有一个条件限制。
所以最后剩下的可选择的路径就很少了。于是这里我使用了暴力法,可以很轻松地通过。
技巧就是:预先产生了路径,那么速度就快了。...
一、Mahout简介
查了Mahout的中文意思——驭象的人,再看看Mahout的logo,好吧,想和小黄象happy地玩耍,得顺便陪陪这位驭象人耍耍了...
附logo:
(就是他,骑在象头上的那个Mahout)
步入正文:
Mahout 是一个很强大的数据挖掘工具,是一个分布式机器学习算法的集合,包括:被称为Taste的分布式协同过滤的实现、分类、聚...
??
1、Binary Tree Postorder Traversal
Given a binary tree, return the postorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
retu...
亲和数
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 20184 Accepted Submission(s): 12195
Problem Description
古希腊数学家毕达哥拉斯在自然数研...
题目链接:10693 - Traffic Volume
根据物理知识, 车经过的时间等于,距离/速度,所以可以列出公式t = (l + d)/v,v/2f + d/v,只有当v / 2f = d/v时,时间最小,v = sqrt(2df),之后时间也能算了。
#include
#include
#include
double l, f;
int main() {
while (~s...
??
1、表示永真,相当于TRUE关键字。
colon.sh脚本利用while循环打印1到10的整数,while循环的条件使用了冒号,此时冒号就表示永真,即while循环永远执行下去,while循环体内使用if/then结构判断跳出while循环的条件。
1 #!/bin/bash
2
3 i=0
4 while : ...
题目链接:Back
to Intermediate Math
题意:两种过河方式,一种笔直过河,一种最快过河,求两种时间差
只要计算出两种时间,笔直过河的速度等于两个速度分量的合速度,最快就等于船速度,求出差即可。
代码:
#include
#include
#include
int t, d, v, u;
int main() {
int cas = 0;
scanf(...