- 博客(13)
- 资源 (6)
- 收藏
- 关注
原创 OpenGL中点算法画圆弧、内接多边形算法画圆
#include "stdafx.h"#include #include #include #include #include #include #include #define PI acos(-1.0)#define Jiao (36.0/180*PI)void init1(){ glClearColor(0.0,0.0,0.0,1.0);}double x[110],y[110];void
2015-09-22 09:12:51 5482
原创 OpenGL中点算法和DDA算法画直线
#include "stdafx.h"#include#include#include#include#include#include#include#define INF 0x3f3f3f3fvoid init(){ glClearColor(0.0,0.0,0.0,1.0);}void Set(int x,int y,int c1,int c
2015-09-15 09:28:27 2906
原创 树状数组区间更新 hdu4031
AttackProblem DescriptionToday is the 10th Annual of “September 11 attacks”, the Al Qaeda is about to attack American again. However, American is protected by a high wall this time, which can be treati
2015-09-11 13:45:05 367
原创 2007 Asia Regional Chengdu(树状数组神题+割点暴力+STL)
A Sequence of NumbersProblem DescriptionYou are given a sequence of N integers (each within the range [0, 2162^{16} - 1] ) along with P operations and in order to solve this problem you need to process
2015-09-09 11:39:40 555
原创 OpenGL画五角星
include “stdafx.h”include include include include include include include define PI acos(-1.0)define Jiao (36.0/180*PI)void init1(){ glClearColor(0.0,0.0,0.0,1.0);//黑色背景 } double x[11],y[11];v
2015-09-08 09:51:09 1053
原创 2010 Asia Regional Tianjin Site —— Online Contest (线段树二维转一维,2-SAT,floyed变形)hdu3621-3631
Bomb GameProblem DescriptionRobbie is playing an interesting computer game. The game field is an unbounded 2-dimensional region. There are N rounds in the game. At each round, the computer will give Ro
2015-09-07 21:50:15 993
原创 BFS最短路+状态dp(hdu3681)好
Prison BreakProblem DescriptionRompire is a robot kingdom and a lot of robots live there peacefully. But one day, the king of Rompire was captured by human beings. His thinking circuit was changed by h
2015-09-07 20:16:07 556
原创 旋转数组
上次去阿里面试的题目,当时写的那叫搓啊。。。题目描述 把一个数组最开始的若干个元素搬到数组的末尾,我们称之为数组的旋转。输入一个非递减序列的一个旋转,输出旋转数组的最小元素。例如数组{3,4,5,1,2}为{1,2,3,4,5}的一个旋转,该数组的最小值为1。 思路网上都有,这里给出实现:int minNumberInRotateArray(vector<int> rotateArray) {
2015-09-05 21:09:24 403
原创 二维数组中查找
在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。 bool Find(vector<vector<int> > array,int target) { int col=array.size()-1,row=0; while(col>=0&&row<ar
2015-09-05 20:10:52 260
原创 python用called函数实现函数对象
在c++里函数对象是重载了()运算符的对象,可以直接调用,他也有很多模板函数对象,像加减乘除等等,那么python如何实现函数对象那?其实很简单,python有一个特殊函数,叫做_ called_,它允许创建可调用的对象,所以只要重写这个函数就可以了class plus(): def __call__(self,x,y): return x+yadd=plus()prin
2015-09-05 10:27:57 797
转载 python描述符和property
Python描述符简介 Python之美[从菜鸟到高手]–玩转描述符和属性 在说property之前,我们需要理解描述符,因为不管property还是classmethod都是构建在描述符的基础上,那么到底什么是描述符呢? 描述符,用一句话来说,就是将某种特殊类型的类的实例指派给另一个类的属性(注意:这里是类属性,而不是对象属性)。而这种特殊类型的类就是实现了get,set,delete的新式类
2015-09-04 18:03:18 562
原创 python包装和授权
首先了解什么是包装和授权。 我们知道,面向对象程序设计中有一个理念就是封装,而实际上面向对象也让程序员在使用一些类(自己定义或则别人定义)对象的时候非常方便。包装就是一个希望将某个对象(或类),进行重新打包,装换成另外一种更适合当前使用场合的对外接口。相似娱乐界对明星的包装一样,其实本质没有什么改变,只是表面变得更容易受当下人欢迎而已。用到程序编程中,就是将程序包装成,当前环境跟适合的样子(主要
2015-09-04 11:04:16 4100
原创 python重载运算符
class Time60(object): 'Time60 - trace hours and minutes' def __init__(self,h,m): 'constructor - takes hours and minutes' self.h=h self.m=m def __str__(self):
2015-09-03 20:45:20 543
高效awk编程
2018-06-03
hadoop-eclipse-plugin-2.7.2.jar
2016-03-19
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人