码迷,mamicode.com
首页 >  
搜索关键字:std    ( 41627个结果
JSOI2008星球大战(并查集)
膜拜HZWER大牛的编码能力!附上他的代码(我的代码不知为何一直莫名出错……)#include#include#includeusing namespace std;int tot,n,m,d,father[400001],head[400001],q[400001],ans[400001],cnt...
分类:Web程序   时间:2014-06-02 11:06:31    阅读次数:306
OpenGL【2 坐标变换】
// OpenGL.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include #include #include using namespace std; void init(void) { glClearColor(1.0,1.0,1.0,1.0); glClear(GL_COLOR_BUFFER_BIT); glShadeMod...
分类:其他好文   时间:2014-06-02 11:02:18    阅读次数:282
背包与构造
题目:给定一个数,,求它最少可以用多少个包含字符串"61"的数字来表示,并输出这些数。   分析:对于大于6161的任何一个整数,都有如下表示               对于小于1616的数,直接背包即可。   代码: #include #include #include using namespace std; typedef long long LL; const...
分类:其他好文   时间:2014-06-02 10:35:40    阅读次数:223
1+2+3+...+n不能用while、for、if else等实现
问题描述 求 1+2+ … +n ,要求不能使用乘除法、 for 、 while 、 if 、 else 、 switch 、 case 等关键字以及条件判断语句。 实际意义不大,题目涉及的知识还是不错的! 方法1 用构造函数求解。 #include using namespace std; class Plus { public: Plu...
分类:其他好文   时间:2014-06-02 10:29:11    阅读次数:208
POJ3984 迷宫问题【水BFS】
#include #include #include #include #include #include #include #include using namespace std; mapmymap; map::iterator it; #define LEN 1111 bool visited[LEN]; //bool arc[LEN][LEN]; vector arc[5...
分类:其他好文   时间:2014-06-02 07:07:58    阅读次数:205
POJ2491 Scavenger Hunt【裸map】
#include #include #include #include #include #include #include #include using namespace std; int main() { #ifndef ONLINE_JUDGE freopen("D:/1.txt","r",stdin); freopen("D:/2.txt","w",stdout...
分类:其他好文   时间:2014-06-02 07:02:20    阅读次数:253
【HDOJ】1043 Eight
这道题目最开始做的时候wa+TLE。后面知道需要状态压缩,最近A掉。并且练习一下各种搜索算法。1. 逆向BFS+康拓展开。 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 ...
分类:其他好文   时间:2014-06-02 05:39:04    阅读次数:259
HDU - 4815 Little Tiger vs. Deep Monkey (长春赛区C题)
题意:有A,B两个人,n道题目,每题有对应的分数,B答对题目的概率是0.5,求A不输给B的概率不小于P要拿的最低分数 思路:DP,dp[i][j]来表示B答了前i题后分数为j的概率,,然后通过B的概率求A的最低分数#include #include #include #include using namespace std; const int MAXN = 40010; int a[...
分类:其他好文   时间:2014-06-02 02:25:20    阅读次数:243
vc++字符转换
测试环境: vs2008开发语言:C++#include #include #include // wchar_t to stringvoid Wchar_tToString(std::string& szDst, wchar_t *wchar){wchar_t * wText = wchar;DW...
分类:编程语言   时间:2014-06-02 01:43:35    阅读次数:289
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!