不说了,上代码,太简单。 1 #include 2 #include 3 using namespace std; 4 int main() 5 { 6 int n; 7 cin>>n; 8 int a[100000]; 9 int b=0,k=-99999999;1...
分类:
其他好文 时间:
2014-10-29 18:45:43
阅读次数:
192
题目:求一个串的最小循环节。
分析:暴力,字符串。数据量较小,直接使用枚举法。
枚举循环节的长度,匹配判断,找到第一组解即为最小。
说明:(⊙_⊙)。
#include
#include
#include
#include
using namespace std;
char str[104];
int main()
{
int n;
while (...
分类:
其他好文 时间:
2014-10-29 17:12:47
阅读次数:
161
ai = (ai-1 + ai) %2 然后构造个 n*n的矩阵A, 时间K之后的状态就是 A^k * B(给出的字符串)#include #include #include #include typedef long long LL;using namespace std;int n;struct...
分类:
其他好文 时间:
2014-10-29 16:51:17
阅读次数:
207
#include "stdafx.h"#include using namespace std;int main(){ cout << "hello world" <<endl; cin.get(); return 0;}ctrl+f5
分类:
编程语言 时间:
2014-10-29 16:48:27
阅读次数:
155
#include #include#include #include using namespace std;using namespace cv;void resizePic(char *destFile, char *srcFile);int main(int argc, char *argv[...
分类:
其他好文 时间:
2014-10-29 16:47:13
阅读次数:
178
原题模型:两者(A,B)不能同时取 1 #include "cstdio" 2 #include "vector" 3 #include "stack" 4 #include "cstring" 5 using namespace std; 6 #define maxn 2010 7 ...
分类:
其他好文 时间:
2014-10-29 16:40:15
阅读次数:
230
分块LCA什么的,意外地快呢……就是对询问的3个点两两求LCA,若其中两组LCA相等,则答案为第三者。然后用深度减一减什么的就求出距离了。 1 #include 2 #include 3 #include 4 using namespace std; 5 #define maxn 500001 6 ...
分类:
其他好文 时间:
2014-10-29 16:28:09
阅读次数:
205
//index 控制器中的代码
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ThoughtWorks.QRCode.Codec;
namespace MyQrCode.C...
分类:
Web程序 时间:
2014-10-29 14:52:53
阅读次数:
646
又搞了个模板,这个模板应该ok,足以应付各种网络流了
题意:给n个点m 条边,其中每条边的流量有两个限制不能大于r不能小于l,求是否有可行解,如有输出每条边的流量
#include
#include
#include
#include
using namespace std;
const int maxn = 1000000;
const int oo = 0x3777777;
struct ...
分类:
其他好文 时间:
2014-10-29 14:49:09
阅读次数:
261
判断i到j 是否k步可达。#include #include #include #include typedef long long LL;using namespace std;int n;int x[100], y[100];struct Matrix{ int m[40][40];...
分类:
其他好文 时间:
2014-10-29 14:42:44
阅读次数:
206