#include #include #define Max 100005 void read (int &now) { now = 0; register char word = getchar (); while (word '9') word = getchar (); while (word ... ...
分类:
其他好文 时间:
2017-06-07 22:31:21
阅读次数:
347
[luogu1535]游荡的奶牛 题目描述 Searching for the very best grass, the cows are travelling about the pasture which is represented as a grid with N rows and M co ...
分类:
其他好文 时间:
2017-06-07 21:44:06
阅读次数:
223
搜索水题 哎 直接不行了 。 #include <ctype.h> #include <cstdio> void read(int &x) { x=0;char ch=getchar(); while(!isdigit(ch)) ch=getchar(); while(isdigit(ch)) {x ...
分类:
其他好文 时间:
2017-06-07 15:39:48
阅读次数:
172
OJ题号:ZHOJ1297 思路:搜索。 先预处理注定不能走的路径,然后dfs可以走的路径。 ...
分类:
其他好文 时间:
2017-06-07 11:13:24
阅读次数:
113
Description 给定实直线L 上n 个开区间组成的集合I,和一个正整数k,试设计一个算法,从开区间集合I 中选取出开区间集合S属于I,使得在实直线L 的任何一点x,S 中包含点x 的开区间个数不超过k,且sum(|z|)z属于S,达到最大。这样的集合S称为开区间集合I的最长k可重区间集。su ...
分类:
其他好文 时间:
2017-06-07 10:12:10
阅读次数:
176
简介:100个表示学生的结构体,有添加,浏览所有学生,根据学号查找、修改、删除的功能。具有自动学号查重的功能。 写这段代码收获; 1.if配合break跳循环很好用. 2.scanf里面要是用输入%s格式,如 就不要用scanf接受多个格式的变量了,这个scanf就专门用来接%s,因为如果不这样做, ...
分类:
其他好文 时间:
2017-06-06 23:37:36
阅读次数:
251
#include<cstdio> #include<cstring> #include<algorithm> #define maxn 100000000 int son[maxn],hson[maxn],top[maxn],deep[maxn],id[maxn],tree[maxn]; int t ...
分类:
其他好文 时间:
2017-06-05 23:42:19
阅读次数:
282
一、终端I/O 1.单字符I/O:getchar(),putchar() (1)单字符输入(get character): 【 int getchar();】 返回值为输入的字符(ASCII)。可以接受任何字符,包括非打印字符。当一次键入多个字符时按下回车键后getchar开始逐个读取所有字符(包括 ...
分类:
其他好文 时间:
2017-06-05 23:40:02
阅读次数:
202
这道题我写了两种写法 一种利用逆元 a/b%mod=a*c%mod; (c是b的逆元)易得2的逆元就是5~~~04; 一种是矩阵快速幂 利用递推式得出结论 #include<cstdio> #include<cstring> #include<algorithm> using namespace s ...
分类:
其他好文 时间:
2017-06-04 22:40:55
阅读次数:
274
其实很久以来我都把sam当成ac自动机了 ac自动机的建立比sam简单多了 直接暴力建字典树,然后暴力跑fail就好了 (挖个坑:去学fail树) 裸题A一道,岂不美哉 ...
分类:
其他好文 时间:
2017-06-04 18:29:10
阅读次数:
126