opengl 编程指南 P30
下面代码 是 用 直线 连起来 画一个圆。
// circle.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include
#include
#define LENGTH 100
#define PI 3.1415926
void init(){
glClearColor(0,0,0,0);
}
...
分类:
其他好文 时间:
2015-07-13 00:54:55
阅读次数:
157
题意:给出n个位置,需要将m头牛放在这些位置中,使得所有相邻两头牛间的最小距离最大,求最大的最小距离;思路:二分枚举最优解。先将所有位置排序,从最大总距离枚举到0,若满足差值大于等于枚举值的位置个数大于等于m,则当前枚举值为最优解。#include#include#includeusing name...
分类:
其他好文 时间:
2015-07-13 00:42:43
阅读次数:
499
#include #include#include#include#include#includeusing namespace std;class GLNode{ public: int tag; string node; class { ...
分类:
其他好文 时间:
2015-07-13 00:42:32
阅读次数:
112
写了几道状压。。。然后就一直在颓废。。。2064: 分裂http://www.lydsy.com/JudgeOnline/problem.php?id=2064初始的为正,最后的为负,假设我们能找到k组凑成0的话,答案就是n+m-2*k。于是状压。。其实我一点都不会。。#include#includ...
分类:
其他好文 时间:
2015-07-13 00:34:34
阅读次数:
110
Mixing Milkhttp://www.wzoi.org/usaco/11%5C302.asp水贪心,肯定优先选单价小的#include using namespace std;const int N = 5005;typedef long long ll;struct point{ i...
分类:
其他好文 时间:
2015-07-13 00:33:27
阅读次数:
143
题意:有一段路,已知起点和终点的速度、总时间和每秒之间速度差值的上限,求这段路最长能是多少
分析:思维
代码:
#include
#include
using namespace std;
int main()
{
int s,e,t,d;
int a[200];
while(cin>>s>>e){
cin>>t>>d;
memset(a,0,sizeof(a));
a[1...
分类:
其他好文 时间:
2015-07-12 23:26:07
阅读次数:
296
1、第一个小程序:产生20个30-70之间的随机数,并计算他们的和,用到arc4random()函数,产生【x y】之间的随机数,arc4random()%(y-x+1) + x 需要添加头文件stdlib.h#include#includeint main(){ int a[20]={0}; .....
分类:
编程语言 时间:
2015-07-12 23:18:44
阅读次数:
161
题目链接:http://poj.org/problem?id=1321题目大意和N皇后类似,只不过可能出现K 2 #include 3 4 const int MAXN=8; 5 char m[MAXN][MAXN]; //记录棋盘 6 int vis[MAXN]; //标记每一列是否访问过 7.....
分类:
其他好文 时间:
2015-07-12 23:02:26
阅读次数:
150
题意:有10万个点,10万个询问,没有更新,求L1 abs(a.t); }这样; 1 #include 2 using namespace std; 3 const int N = 100005; 4 5 #define lson l,mid,rt> 1 8 #define root 1,(...
分类:
其他好文 时间:
2015-07-12 22:57:07
阅读次数:
172
#include #include "sys.h"//表偏移地址//NVIC_VectTab:基址//Offset:偏移量//CHECK OK//091207void MY_NVIC_SetVectorTable(u32 NVIC_VectTab, u32 Offset){ //检查參数合法性ass...
分类:
其他好文 时间:
2015-07-12 21:39:45
阅读次数:
324