脑洞
文章平均质量分 69
lifelikes
这个作者很懒,什么都没留下…
展开
-
GYM 101550 && CSUOJ 2017 Highest Tower 思维 模型转换
DescriptionOni loved to build tall towers of blocks. Her parents were not as amused though. They were on the verge of going crazy over that annoying loud noise when- ever a tower fell to the ground,...原创 2018-04-04 20:26:49 · 269 阅读 · 0 评论 -
zoj 4061 Magic Multiplication 构造 找规律 脑洞 青岛区域赛 2018
点我看题题意 给出一种运算方式的定义给出结果串 和 A串 B串的长度要你构造出字典序最小的A串和B串。解题思路:遇到这种题,应该把相关的表尽量打出来。上来先打个 九九乘法表发现 对于每一位数字xy =z 通过z的首位数字,就可以判断z的长度。除0外 可以通过x 和z唯一确定y。 这样的话 就可在9nm的复杂度内得出答案。又发现,虽然nm有1e10 这么多,但是 对于有解的n*...原创 2018-11-07 20:01:26 · 234 阅读 · 0 评论 -
Counting Cycles Aizu - 1388 虚树 模板题
点我看题题意 给出一个图 ,问其中有多少个简单环。边数最多比点数多15解题思路边数最多比点数多15。 这是一个很经典的条件。 1.想到状压枚举,2.想到建出生成树,然后暴力加边。思考枚举边的时候如何判断是否有环。这是一个图论小技巧,将选出来的边的端点 往上异或边异或到根节点, 异或完成后,所有值等于1的边就是应该要选的边。然后暴力判断这些边是否能构成一个简单环即可。 但这样 复杂度会...原创 2018-10-20 22:56:52 · 313 阅读 · 0 评论 -
codeforce 802 H. Fake News (medium) 构造 套路题
H. Fake News (medium)time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThanks to your help, Heidi is confident that no one can fool her. She has now ...原创 2018-10-06 13:44:09 · 603 阅读 · 0 评论 -
Educational Codeforces Round 25 F. String Compression KMP找循环节+简单
F. String Compressiontime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputIvan wants to write a letter to his friend. The letter is a string s con...原创 2018-10-05 17:50:38 · 212 阅读 · 0 评论 -
codeforce 1041 E. Tree Reconstruction 思维题
E. Tree Reconstructiontime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMonocarp has drawn a tree (an undirected connected acyclic graph) and then ha...原创 2018-10-11 20:04:29 · 242 阅读 · 0 评论 -
HDU 6405 Make ZYB Happy 后缀自动机 前缀和优化
**为这场多校的出题人点赞,题目很有趣!!!,质量很高**Make ZYB HappyTime Limit: 2000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 43 Accepted Submission(s): 22Probl...原创 2018-08-16 10:19:44 · 619 阅读 · 0 评论 -
HDU 6356 Glad You Came 反向 更新ST表
Glad You Came Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 795 Accepted Submission(s): 279Problem Description Steve has an intege...原创 2018-08-06 21:56:17 · 234 阅读 · 0 评论 -
HDU - 6333 Harvest of Apples 分块暴力查询 莫队
Problem Description There are n apples on a tree, numbered from 1 to n. Count the number of ways to pick at most m apples.Input The first line of the input contains an integer T (1≤T≤105) denotin...原创 2018-08-01 20:31:33 · 458 阅读 · 0 评论 -
牛客网暑期ACM多校训练营(第三场) G-Coloring Tree 计数,思维题
Christmas is coming! Eddy has received a Christmas tree as gift. Not surprisingly, the tree consists of N vertices and N-1 edges and magically remains connected. Currently, all the vertex of the tree...原创 2018-07-27 15:46:03 · 216 阅读 · 0 评论 -
牛客网暑期ACM多校训练营(第一场) E Removal dp递推
时间限制:C/C++ 2秒,其他语言4秒空间限制:C/C++ 524288K,其他语言1048576K 64bit IO Format: %lld题目描述Bobo has a sequence of integers s1, s2, …, sn where 1 ≤ si ≤ k. Find out the number of distinct sequences m...原创 2018-07-20 21:05:34 · 278 阅读 · 0 评论 -
牛客网暑期ACM多校训练营(第一场) I Substring 求字符串子串数+脑洞
时间限制:C/C++ 2秒,其他语言4秒空间限制:C/C++ 524288K,其他语言1048576K 64bit IO Format: %lld题目描述Two strings u1 u2 … uk and v1 v2 … vl are isomorphic if and only if k = l and there exists a injection g su...原创 2018-07-20 15:01:25 · 511 阅读 · 0 评论 -
HDU6315 Naive Operations 线段树 区间更新
Naive Operations Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 502768/502768 K (Java/Others) Total Submission(s): 266 Accepted Submission(s): 69Problem Description In a galaxy far, f...原创 2018-07-25 19:09:41 · 200 阅读 · 1 评论 -
牛客网暑期ACM多校训练营(第一场) B Symmetric Matrix
时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 524288K,其他语言1048576K 64bit IO Format: %lld题目描述Count the number of n x n matrices A satisfying the following condition modulo m. * Ai, j ∈ {0, 1, 2} for all...原创 2018-07-19 22:23:16 · 469 阅读 · 2 评论 -
2018 Multi-University Training Contest 1 Chiaki Sequence Revisited 找规律
Chiaki Sequence RevisitedTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 493    Accepted Submiss原创 2018-07-23 22:39:30 · 290 阅读 · 0 评论 -
CSUOJ 2128: Wells's Travel Plan 倍增ST表 dp递推
Description Wells来到了一个未知的梦幻国度,这个国度有 2N 个城市,分布为一个 2*N 的矩阵。有些城市是无法到达的。一个城市可以到达与之曼哈顿距离为 1 的城市。大家都知道打acm没有太多的自由时间出去玩,但Wells仍然想知道,如果在从第 l 个城市出发到第 r 个...原创 2018-06-06 21:54:39 · 296 阅读 · 1 评论 -
codeforce 990E E. Post Lamps 暴力
E. Post Lampstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAdilbek’s house is located on a street which can be represented as the OX ax...原创 2018-06-11 20:22:12 · 623 阅读 · 0 评论 -
山东农业大学校赛 K wyh的数列 循环节 巨坑 水题
链接:https://www.nowcoder.com/acm/contest/93/K 来源:牛客网题目描述wyh学长特别喜欢斐波那契数列,F(0)=0,F(1)=1,F(n)=F(n-1)+F(n-2)(n>=2)一天他突发奇想,想求F(a^b)%c 输入描述:输入第一行一个整数T(1<=T<=100),代表测试组数 接下来T行,每行三个数 a,b,c ...原创 2018-04-05 19:51:23 · 223 阅读 · 0 评论 -
Wannafly挑战赛28 B msc和mcc DP
点我看题解题思路:很容易想到,合法的序列不是很多。打个表发现只有8个。定义dp[i][j] 表示从第i位开始 第一次出现标号为j的字符的位置是什么。 美名曰 序列自动机然后暴力匹配八个串,枚举所有的(x,y) 最后再大力去重就可以了。(遇到了写蜜(shu)汁(zu)bug(yue jie))#include<bits/stdc++.h>#define lson l,m,...原创 2018-11-18 11:42:09 · 181 阅读 · 0 评论