如果遇到子页面跨域的问题,可通过HTML5的postMessage来实现,但前提是子页面需要主动向父页面发送信息。下面是子页面部分: Got post? Lots of stuff here which will be inside the iframe. 在父页面中获取到子页面传递过来的...
分类:
其他好文 时间:
2015-04-13 18:40:41
阅读次数:
122
题意:给你一个网格图 ,每个网格中是W,B,两种颜色和 ? 表示未知,相同颜色的网格不能相邻,问你能否满足条件解题思路:W和B的位置 和 (i+j) 的奇偶有关。解题代码: 1 // BEGIN CUT HERE 2 /* 3 4 */ 5 // END CUT HERE 6 #lin...
分类:
其他好文 时间:
2015-04-13 18:17:33
阅读次数:
172
【题目链接】click here~~
【题目大意】
给出一个矩形平分,一个width*hight的矩形,过底边上的一点(dor,0)做m-1条射线,把这个矩形的面积平均分成m份,求这些射线和矩形的(m-1)个交点的坐标
【解题思路】思路给出在代码中了:
//从左往右依次判断每加一个单位面积状态下的坐标
//可以证明每个面积是一块三角形
#include
#include
#inclu...
分类:
其他好文 时间:
2015-04-13 10:55:34
阅读次数:
155
direictives/index.js:module.exports = function(ngModule) { //register all the directives here require('./hello')(ngModule);};directives/hello.js...
分类:
Web程序 时间:
2015-04-13 06:51:49
阅读次数:
223
【题目链接】click here~~
【题目大意】求多个圆与线段相交的部分占整个线段的百分比。
【解题思路】
求出符合要求的交线段,排序一遍圆心。最后求并。
代码:
#include
#define max(a,b) ((a)>(b)?(a):(b))
using namespace std;
struct node
{
double x,y,l,r;
} Map[10...
分类:
其他好文 时间:
2015-04-12 19:26:15
阅读次数:
142
【题目链接】click here~~
【题目大意】
LZM同学比较牛,Lsy最近也越来越生猛,他们思路快,代码速度神勇。近期惊闻此二人均要参加校赛,队里决定出些题目卡他们,因为他们的罢工给题目组留下了繁重的负担……(报复报复)
于是,XsugarX瞄准了LZM不太喜欢看的数学题目以及Lsy猜公式的喜好,奸笑中(^.^)。这个数学问题是个比较古老的问题,有如下图的三角形被称为杨辉三...
分类:
其他好文 时间:
2015-04-12 19:24:19
阅读次数:
135
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.
Here, we will use the integers ...
分类:
其他好文 时间:
2015-04-12 17:48:54
阅读次数:
131
【题目链接】click here~~
【题目大意】
Jzzhu has invented a kind of sequences, they meet the following property:
You are given x and
y, please calculate fn modulo
1000000007(109?+?7).
【解题思路】...
分类:
其他好文 时间:
2015-04-11 22:39:36
阅读次数:
179
【题目链接】click here~~
【题目大意】
M斐波那契数列F[n]是一种整数数列,它的定义如下:
F[0] = a
F[1] = b
F[n] = F[n-1] * F[n-2] ( n > 1 )
现在给出a, b, n,你能求出F[n]的值吗?对每组测试数据请输出一个整数F[n],由于F[n]可能很大,你只需输出F[n]对1000000007取模后的值即...
分类:
其他好文 时间:
2015-04-11 22:37:15
阅读次数:
188
【题目链接】click here~~
【题目大意】
Let's define another number sequence, given by the following function:
f(0) = a
f(1) = b
f(n) = f(n-1) + f(n-2), n > 1
When a = 0 and b = 1, this sequence gives the...
分类:
其他好文 时间:
2015-04-11 20:52:48
阅读次数:
152