Ps: - -感觉这道题完全就是数学题...就是求知道每个顶点的坐标,然后求这个多边形的面积... 代码:#include "stdio.h"#include "stdlib.h"#include "math.h"int main(){ int x[100],y[100]; int i,k,n; d
分类:
其他好文 时间:
2016-02-27 16:25:11
阅读次数:
119
题目链接 给两个数n, m. 求n%1+n%2+.......+n%m的值。 首先, n%i = n-n/i*i, 那么原式转化为n*m-sigma(i:1 to m)(n/i*i)。 然后我们可以发现 1/4 = 2/4 = 3/4 = 0, 4/4 = 5/4 = 6/4 = 7/4 = 1.
分类:
其他好文 时间:
2016-02-23 20:46:24
阅读次数:
243
组合数学题。好难啊,请教了Xiang578大神&&看了他题解才会的...... 甩上题解链接:http://blog.csdn.net/xinag578/article/details/50645160 另外还发现了组合数递推公式实际上就是一个01背包。 #include <stdio.h> #in
分类:
其他好文 时间:
2016-02-13 14:33:06
阅读次数:
159
题解:从1開始乘到n,由于结果仅仅要最后一位。所以每乘完一次,仅仅要保留后5位(少了值会不准确,刚開始仅仅保留了一位。结果到15就错了,保留多了int会溢出,比方3125就会出错) 和下一个数相乘,接着保留5位,注意5位没有后导零,最后取5位中最后一个不是零的就能够了。 #include <iost
分类:
其他好文 时间:
2016-02-09 12:47:39
阅读次数:
219
LeetCode传送门 https://leetcode.com/problems/trapping-rain-water/ 目标:找出积木能容纳的水的“面积”,如图中黑色部分是积木,蓝色为可容纳水的部分 假设:积木宽度均为1 输入:各个积木的高度 输出:所有积木能容纳水的“面积” 思考过程 1.
分类:
移动开发 时间:
2016-02-08 17:23:56
阅读次数:
253
Problem Description In many applications very large integers numbers are required. Some of these applications are using keys for secure transmission o
分类:
其他好文 时间:
2016-02-03 11:45:34
阅读次数:
124
Problem Description 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 sequenc
分类:
其他好文 时间:
2016-02-03 11:44:53
阅读次数:
137
Problem Description The least common multiple (LCM) of a set of positive integers is the smallest positive integer which is divisible by all the numbe
分类:
其他好文 时间:
2016-02-03 10:44:31
阅读次数:
130
Problem Description: The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit th
分类:
其他好文 时间:
2016-02-02 17:36:24
阅读次数:
133
d. Jam有道数学题想向你请教一下,他刚刚学会因式分解比如说,x^2+6x+5=(x+1)(x+5) 就好像形如 ax^2+bx+c => pqx^2+(qk+mp)x+km=(px+k)(qx+m) 但是他很蠢,他只会做p,q,m,kp,q,m,k为正整数的题目 请你帮助他,问可不可以分解 题意
分类:
其他好文 时间:
2016-01-31 02:57:27
阅读次数:
149