这题最难得地方在于把题目看懂,简单的dfs,没什么好说的
#include
#include
#define maxn 15+1
using namespace std;
int maxx;
int mapp[maxn][maxn];
int visit[maxn];
int n;
void dfs(int x,int time,int num)
{
for(int i=1;i<=n;i++)...
分类:
其他好文 时间:
2015-04-17 01:19:00
阅读次数:
142
题目大意:组合数取模,n和m并不算大,p比较大且是合数。思路:暴力分解+快速幂注:暴力也是有区别的,分解质因数时可以用以下work函数,写的非常巧妙,摘录自互联网。 1 #include 2 #include 3 using namespace std; 4 5 typedef long lo...
分类:
其他好文 时间:
2015-04-17 01:09:05
阅读次数:
187
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data.SqlClient;using System.Data;namespace 线程{ class...
分类:
数据库 时间:
2015-04-17 01:07:30
阅读次数:
123
有过C++开发经验的人会发现,我们可以将0作为false,非零作为true。一个函数即使是bool类型的,但是我们还是可以返回int类型的,并且自动将0转换成false,非零转换成true。代码实例如下:
#include
#include
using namespace std;
bool fun()//函数返回类型是bool,但是我们在函数中可以返回int类型。
{
return ...
分类:
编程语言 时间:
2015-04-16 23:50:32
阅读次数:
287
#include
#include
#include
#include
#include
using namespace std;
const int maxn = 1000010;
__int64 sum[maxn] ;
__int64 num[maxn];
__int64 ans[maxn];
__int64 vis[maxn] ;
__int64 query;
__i...
分类:
其他好文 时间:
2015-04-16 23:49:50
阅读次数:
258
#include
using namespace std;
class btree
{
public:
btree *left;
btree *right;
int data;
btree(int i):left(NULL),right(NULL),data(i){}
~btree();
void insert(int a);
static void inorder(...
分类:
编程语言 时间:
2015-04-16 23:49:18
阅读次数:
372
#include
#include
#include
using namespace std ;
const int maxn = 1010;
const int inf = 0x3f3f3f3f ;
int dp[maxn][2] ;
char str[maxn][maxn] ;
int num[maxn];
int sum_b[maxn];
int sum_w[maxn];
int main(...
分类:
其他好文 时间:
2015-04-16 23:48:07
阅读次数:
228
#include
#include
#include
using namespace std ;
const int maxn = 110 ;
int sum_r[maxn] ;
int sum_c[maxn] ;
int vis_c[maxn] ;int vis_r[maxn] ;
int ans_c[maxn] ;int ans_r[maxn] ;
int table[max...
分类:
其他好文 时间:
2015-04-16 23:47:29
阅读次数:
153
/** * @author Direction *//** * JALJA 命名空间 namespace */var JALJA= {} ;/** * Interface Class * 接口类需要2个参数 * 参数1: 接口的名字 (string) * 参数2: 接受方法名称的集合(数组) (.....
分类:
Web程序 时间:
2015-04-16 23:40:41
阅读次数:
211
之前的答案错误问题已经解决了,现在还有运行超时的问题,先贴上之前的代码 1 #include 2 #include 3 using namespace std; 4 5 int main() 6 { 7 int count, renum; 8 string add; 9 ...
分类:
编程语言 时间:
2015-04-16 23:40:30
阅读次数:
267