![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法实践
文章平均质量分 85
高斯纯牛奶
这个作者很懒,什么都没留下…
展开
-
POJ2431 运用queueq优先队列
ExpeditionTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 10742 Accepted: 3126DescriptionA group of cows grabbed a truck and ventured on an expedition原创 2016-03-17 15:28:55 · 312 阅读 · 0 评论 -
poj 2386 Lake Counting
#include #include #include using namespace std;int M,N;char field [102][102] ;int num = 0;bool dfs(int x, int y){ field[x][y] = '.'; for(int i = -1; i <=1; i++) { for(int j原创 2016-04-26 17:29:08 · 346 阅读 · 0 评论 -
AOJ 0118 Property Distribution (果园分类)
#include #include using namespace std;char orchard[101][101];int H,W,num;const int direction[4][2] ={ { -1, 0}, { 0, 1}, { 1, 0}, { 0, -1},};void dfs(int x, int y, char原创 2016-04-26 21:26:34 · 869 阅读 · 0 评论 -
hihocoder: hiho一下 第八十八周 88
微软笔试题《Coordinates》题目1 : Coordinates时间限制:10000ms单点时限:1000ms内存限制:256MB描述Give you two integers P and Q. Let all divisors of P be X-coordinates. Let all divisors原创 2016-03-08 10:17:25 · 454 阅读 · 0 评论 -
hihocoder hiho一下 第九十五周
先挖个坑我看完这道题第一感觉是不用拓展欧几里得,直接每走一步循环一次就行了,循环一个很大的次数(比如9999999,不会超时的次数),要是能找到就能找到了,找不到就找不到了。(小技巧:用这行代码就可以取消iostream的同步绑定,可以让cin 的输入速度和scanf一样快)std::ios::sync_with_stdio(false);下面代码在本地能运行成功,答案也对,但是提交上去就原创 2016-04-27 12:27:14 · 649 阅读 · 0 评论 -
0x5f3759df这个快速开方中的常数的数学依据和原理
Quake-III Arena (雷神之锤3)是90年代的经典游戏之一。 该系列的游戏不但画面和内容不错,而且即使计算机配置低,也能极其流畅地运行。这要归功于它3D引擎的开发者约翰-卡马克(John Carmack)。事实上早在90年代初DOS时代,只要能在PC上搞个小动画都能让人惊叹一番的时候,John Carmack就推出了石破天惊的Castle Wolfstein, 然后原创 2017-01-20 17:16:27 · 4062 阅读 · 1 评论 -
结构体定义:struct与typedef struct 用法详解和用法小结
一、typedef的用法在C/C++语言中,typedef常用来定义一个标识符及关键字的别名,它是语言编译过程的一部分,但它并不实际分配内存空间,实例像: typedef int INT; typedef int ARRAY[10]; typedef (int*) pINT; typedef可以增强程序的可读性,以及标识符的灵活性,但它也有“非直观性”等缺点。 二、#define的原创 2016-10-28 11:19:06 · 4078 阅读 · 1 评论 -
【深度好文】【NLPC】从白富美相亲名单 看机器学习中的特征选择与预处理
http://chanpin.family.baidu.com/article/63382再过一个月就是春节,相信有很多码农就要准备欢天喜地地回家过(xiang)年(qin)了。我们今天也打算讲一个相亲的故事。 讲机器学习为什么要讲相亲?小编目测未来30天内,内网寻Ta区的贴子数量又要暴涨。我们就打算以一个相亲的故事为例,串一些特征工程的内容。以示例现身说...原创 2019-01-22 14:39:03 · 627 阅读 · 0 评论 -
cin,cout与scanf,printf的速度到底相差多少
昨天在OJ上看到一个很水的题,题意就是两个递增序列,输出合并后新序列的中值(详细描述可参见我的另一篇文章http://hi.baidu.com/i5love1you9/blog/item/250f57d671b6f41aa08bb721.html)。当时也闲来无事,于是决定动手写写。刚开始也没怎么在意,认为该题随便都能AC。可提交的结果却TLE了,当时就郁闷了,这算法不可能会有问题啊,不就是一个简原创 2016-04-25 20:39:19 · 5030 阅读 · 0 评论 -
常用hash算法总结
public long DJBHash(String str) { long hash = 5381; for(int i = 0; i < str.length(); i++) { hash = ((hash << 5) + hash) + str.charAt(i);转载 2016-04-12 19:56:12 · 2105 阅读 · 0 评论 -
POJ3617 字典序最小问题
Best Cow LineTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 16228 Accepted: 4580DescriptionFJ is about to take his N (1 ≤ N ≤ 2,000) cows to the annu原创 2016-03-17 15:24:06 · 565 阅读 · 0 评论 -
大数快速运算法则
#include #include #include #include using namespace std; #define MAXN 9999#define MAXSIZE 10#define DLEN 4class BigNum{ private: int a[500]; //可以控制大数的位数 int len; //大数长度public原创 2016-03-30 21:30:29 · 603 阅读 · 0 评论 -
《挑战程序设计》一些小练习,均AC,不断更新
/* P43#include #include using namespace std;int N = 6;char S[6] = {'A','C','D','B','C','B'};void solve(){ int a = 0,b = N-1; while(a<=b){ bool left = false; for (int i = 0; i+a <= b; i+原创 2016-03-30 21:35:22 · 347 阅读 · 0 评论 -
准备省赛,fightinginging。(内有福利代码
看似很清晰的矩阵快速幂代码过一阵子我会把我们这次ACM省赛准备的资料都分享出来供大家借鉴//试试csdn的markdown的感觉#include <cstdio>#include <string>#include <cmath>#include <iostream>using namespace std;const long long M = 1000007;const long lon原创 2016-03-30 21:44:51 · 319 阅读 · 0 评论 -
POJ1035,求指点
网上几乎没有1035的代码这个代码在vector输入的时候有问题求大神指点#include #include #include using namespace std;vector dict;vector cmp;bool eql(int a){ int i = dict.size(); while(i--) { if(cmp原创 2016-03-30 22:42:14 · 295 阅读 · 0 评论 -
qsort函数用法
qsort 功 能: 使用快速排序例程进行排序 用 法: void qsort(void *base, int nelem, int width, int (*fcmp)(const void *,const void *)); 各参数:1 待排序数组首地址 2 数组中待排序元素数量 3 各元素的占用空间大小 4 指向函数的指针用于确定排序的顺序 排序方法有很多原创 2016-03-07 19:55:04 · 277 阅读 · 0 评论 -
hdu 5635 LCP Array(BC第一题)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5635LCP ArrayTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 282 Accepte原创 2016-03-08 08:40:36 · 343 阅读 · 0 评论 -
qsort函数用法 (自己加了注释)
qsort 功 能: 使用快速排序例程进行排序 用 法: void qsort(void *base, int nelem, int width, int (*fcmp)(const void *,const void *)); 各参数:1 待排序数组首地址 2 数组中待排序元素数量 3 各元素的占用空间大小 4 指向函数的指针用于确定排序的顺序 排序方法有很多种, 选择排转载 2016-03-31 21:53:16 · 339 阅读 · 0 评论 -
用Python解析吃鸡游戏的真相
近期在Kaggle里发现一个有趣的项目。他提供了一个端游吃鸡的数据包,里面有近百局吃鸡游戏中各种游戏内部的量化数据,这绝壁是个好东西,能挖掘出各种有趣的结论。所以今天就用吃鸡比赛的真实数据来看看如何提高你吃鸡的概率。那么我们就用 Python 和 R 做数据分析来回答以下的灵魂发问?首先来看下数据: 跳哪儿危险? 对于我这样一直喜欢苟着的良心玩家,在经历了无...原创 2019-02-18 11:38:02 · 698 阅读 · 0 评论