上一页 1 ··· 6 7 8 9 10 11 下一页
  2017年4月15日
摘要: 基础练习 Sine之舞 时间限制:1.0s 内存限制:512.0MB 时间限制:1.0s 内存限制:512.0MB 问题描述 最近FJ为他的奶牛们开设了数学分析课,FJ知道若要学好这门课,必须有一个好的三角函数基本功。所以他准备和奶牛们做一个“Sine之舞”的游戏,寓教于乐,提高奶牛们的计算能力。 阅读全文
posted @ 2017-04-15 16:48 北溟有鱼。 阅读(287) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; int main() { int time=0,v1,v2,t,s,l; while(cin>>v1>>v2>>t>>s>>l) { bool gui=false,tu=false; //gui为真则龟到达终点,tu为真表示兔到达终点 int guil=0,tul=0... 阅读全文
posted @ 2017-04-15 14:07 北溟有鱼。 阅读(231) 评论(0) 推荐(0) 编辑
  2017年4月13日
摘要: #include #include #include #define MAX 10000 using namespace std; typedef struct bignum //定义大数类型 { bignum(){memset(arr,0,sizeof(arr));length=0;} //初始化成员变量 int arr[MAX*2+10]; int... 阅读全文
posted @ 2017-04-13 21:43 北溟有鱼。 阅读(121) 评论(0) 推荐(0) 编辑
摘要: Bull Math Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 14972 Accepted: 7695 Description Bulls are so much better at math than the cows. 阅读全文
posted @ 2017-04-13 20:08 北溟有鱼。 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 二分求幂, 非递归求法(二进制求法): 比如 2^5就是5个2相乘,按照5的二进制求 3^10就是8个3相乘,再2个3相乘。 处理幂的二进制,具体实现代码如下: 阅读全文
posted @ 2017-04-13 19:23 北溟有鱼。 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 问题描述 给定一个n*n的棋盘,棋盘中有一些位置不能放皇后。现在要向棋盘中放入n个黑皇后和n个白皇后,使任意的两个黑皇后都不在同一行、同一列或同一条对角线上,任意的两个白皇后都不在同一行、同一列或同一条对角线上。问总共有多少种放法?n小于等于8。 输入格式 输入的第一行为一个整数n,表示棋盘的大小。 阅读全文
posted @ 2017-04-13 10:10 北溟有鱼。 阅读(123) 评论(0) 推荐(0) 编辑
  2017年4月12日
摘要: Power Strings Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 47748 Accepted: 19902 Description Given two strings a and b we define a*b to 阅读全文
posted @ 2017-04-12 22:42 北溟有鱼。 阅读(305) 评论(0) 推荐(0) 编辑
摘要: 题目: To the Max Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 48507 Accepted: 25662 Description Given a two-dimensional array of positive 阅读全文
posted @ 2017-04-12 22:22 北溟有鱼。 阅读(405) 评论(0) 推荐(0) 编辑
  2017年4月5日
摘要: #include #include #include using namespace std; typedef struct node { char data; struct node *lchild; struct node *rchild; }Node; void buildTree(Node *&node) { char data; scan... 阅读全文
posted @ 2017-04-05 13:42 北溟有鱼。 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 如题,给出二叉树的前序遍历和中序遍历,怎么还原二叉树。 假如一个二叉树的前序遍历为:12453,中序遍历为:42513。由于这颗二叉树比较简单,可以用 凑 的方法很容易凑出符合题意的二叉树(没有写这篇文章之前,我都是用这种笨方法的..尴尬)。 即如图: 那么有没有一个标准的方法来推导呢?当然是有的! 阅读全文
posted @ 2017-04-05 13:09 北溟有鱼。 阅读(837) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 下一页