ACM
文章平均质量分 75
OtterVV
这个作者很懒,什么都没留下…
展开
-
RMQ POJ3264
RMQRMQ(Regional Maximize/Minmize Query)区间最值问题一般的处理方法是ST表,即对于序列A的每个位置i处理出一个数组dp[i][j] 表示 [i……i+(2^j)-1]这个区间的最值(也就是i往后走2^j步)(倍增思想)最小区间[i,i],显然dp[i][0] = a[i];继续往上推,dp[i][j]可以拆分为两个更小的部分dp[i][j-1]...原创 2018-08-21 11:27:12 · 198 阅读 · 0 评论 -
ACM-ICPC 2018 南京赛区网络预赛 The_writing_on_the_wall 单调栈 思路
The writing on the wall 2000ms 262144KFeeling hungry, a cute hamster decides to order some take-away food (like fried chicken for only 30 Yuan).However, his owner CXY thinks that take-away food...原创 2018-09-04 19:35:53 · 252 阅读 · 0 评论 -
BM线性递推杜教模板 //ACM-ICPC 2018 焦作赛区网络预赛 L 为什么大家都会 留下了菜鸡的泪水
#include <bits/stdc++.h>using namespace std;#define rep(i,a,n) for (long long i=a;i<n;i++)#define per(i,a,n) for (long long i=n-1;i>=a;i--)#define pb push_back#define mp make_pair#...转载 2018-09-15 17:29:45 · 305 阅读 · 0 评论 -
ACM-ICPC 2018 焦作赛区网络预赛 L Poor God Water 矩阵快速幂
Poor God Water 1000ms 65536KGod Water likes to eat meat, fish and chocolate very much, but unfortunately, the doctor tells him that some sequence of eating will make them poisonous.Every hour, ...原创 2018-09-15 21:59:16 · 568 阅读 · 0 评论 -
二分 POJ3104 最小化最大值 水题 注意细节
DryingTime Limit: 2000MS Memory Limit: 65536K Total Submissions: 22433 Accepted: 5676 DescriptionIt is very hard to wash and especially to dry clothes in winter. But Jane is a ...原创 2018-09-06 20:36:59 · 238 阅读 · 0 评论 -
博弈 Nim游戏
Nim游戏转载自:https://blog.csdn.net/summer__show_/article/details/70185470?utm_source=copyNim游戏是博弈论中最经典的模型,它又有着十分简单的规则和无比优美的结论。Nim游戏是组合游戏(Combinatorial Games)的一种,准确来说,属于“Impartial Combinatorial Games...转载 2018-09-23 21:16:37 · 1231 阅读 · 0 评论 -
数论 UVALive-7726 A Simple Math Problem
https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=5748Given two positive integers a and b, find suitableX and Y to meet the conditi...原创 2018-10-02 18:21:42 · 237 阅读 · 0 评论 -
数论 UVALive-7728 Detachment 阶乘逆元
https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=5750In a highly developed alien society, the habitats are almost infinite dimension...原创 2018-10-02 18:42:02 · 354 阅读 · 0 评论 -
码 博弈 UVALive-7725 Game of Taking Stones 大数 Java
https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=5747Two people face two piles of stones and make a game. They take turns to take st...转载 2018-10-02 18:45:43 · 220 阅读 · 0 评论 -
ACM-ICPC 2018 南京赛区网络预赛 签到水题
A An Olympian Math Problem 1000ms 65536KAlice, a student of grade 6, is thinking about an Olympian Math problem, but she feels so despair that she cries. And her classmate, Bob, has no idea about...原创 2018-09-01 23:22:01 · 236 阅读 · 0 评论 -
最短路 Dijkstra ACM-ICPC 2018 南京赛区网络预赛 K Magical Girl Haze
K Magical Girl HazeThere are N cities in the country, and M directional roads from u to v(1≤u,v≤n). Every road has a distance ci. Haze is a Magical Girl that lives in City 1, she can choose no more...原创 2018-09-01 22:52:55 · 346 阅读 · 0 评论 -
数论 HDU4990 快速幂模板
Reading comprehensionTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3106 Accepted Submission(s): 1218 Problem DescriptionRead the pr...原创 2018-08-21 16:19:37 · 234 阅读 · 0 评论 -
STL G UVA156 multimap
题意:对于给定的一个字典,‘#’结束,大小写混杂,按照字典序输出打乱顺序也无法得到另外一个字典里的单词(不区分大小写)的词(按照原本的大小写)。通过分析题意可知,需要有保留原貌的字符串,所以,以字符串的小写字典序为key值,原型为value进行multimap存储。count得到1的单词放入set中自动进行字典序排序,然后输出。上代码:#include <cstdio>...原创 2018-04-08 01:46:37 · 167 阅读 · 0 评论 -
CSU2112 Wells的明星生活 预处理&BFS&二分
为涛爷约会女朋友加油!\(` o ')/题目非常长了: Wells和小姐姐正在浪漫的约会呢,Wells猛然得到最新消息,有若干狗仔团队正闻讯蜂拥而来(Wells毕竟还是蛮很有名气的嘛)……Wells真是不理解现在这些人对八卦的渴望怎么那么大,连保密工作做的这么好的Wells都未能幸免,这真是……算了,别扯了,先溜吧,被狗仔队逮到可不好。但是,Wells最近心情真的不好,厌睡...原创 2018-05-29 01:38:32 · 352 阅读 · 0 评论 -
CSU2160 小Z的培养皿 并查集&SET
Description小Z高中的时候特别喜欢生物,在一次做实验的过程中,小Z配置了n个培养皿,每个培养皿中有着若干种类的细菌,但由于实验室的培养皿数量有限,老师要求小Z尽可能少地使用培养皿。为此,小Z只得将一些培养皿进行混合,但由于一些生物上的特殊要求,只有含有相同细菌的培养皿才能混合,否则细菌将全部死亡。这时候小Z想请求你——CSU(California State Universit...原创 2018-05-29 01:52:19 · 317 阅读 · 0 评论 -
HDU 2018暑假多校第一场 A Maximum Multiple
Maximum MultipleTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 0 Accepted Submission(s): 0 Problem DescriptionGiven an integer n, Ch...原创 2018-07-23 19:44:06 · 267 阅读 · 0 评论 -
递归递推 URAL1081 递归
1081. Binary Lexicographic SequenceTime limit: 0.5 secondMemory limit: 64 MBConsider all the sequences with length (0 < N < 44), containing only the elements 0 and 1, and no two ones are ad...原创 2018-07-30 00:13:22 · 182 阅读 · 0 评论 -
数论 POJ1061 扩展欧几里德
青蛙的约会Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 128770 Accepted: 28142 Description两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前...原创 2018-08-21 20:36:04 · 180 阅读 · 0 评论 -
数论 CSU2021 降幂公式 NCPC2016
2021: ExponialSubmit Page Summary Time Limit: 1 Sec Memory Limit: 512 Mb Submitted: 243 Solved: 98 DescriptionEverybody loves big numbers (if you do not, you might want to s...原创 2018-08-29 13:38:26 · 338 阅读 · 0 评论 -
CSU2089 状压BFS / 模拟&贪心
2089: Bit String ReorderingSubmit Page Summary Time Limit: 1 Sec Memory Limit: 512 Mb Submitted: 178 Solved: 83 DescriptionYou have to reorder a given bit string as specifie...原创 2018-08-29 17:52:49 · 255 阅读 · 0 评论 -
2016亚洲区域赛北京赛区K JiLi Number
Driver Ji likes the digit “1”. He has an accumulator which shows the sum of input number. He lists all of positive number no more than N and starts counting from one, two, three . . . Every time he co...原创 2018-10-24 16:13:07 · 397 阅读 · 0 评论 -
UVALive 7261 A Xiongnu's Land 二分&思路
Wei Qing (died 106 BC) was a military general of the Western Han dynasty whose campaigns against the Xiongnu earned him great acclaim. He was a relative of Emperor Wu because he was the younger half-b...原创 2018-10-24 16:32:33 · 244 阅读 · 0 评论 -
启发式合并 Codeforces1009F
F. Dominant Indicestime limit per test4.5 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputYou are given a rooted undirected tree consisting of nn ver...原创 2019-01-21 19:47:00 · 281 阅读 · 0 评论 -
HDU6109 并查集&set
数据分割Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2255 Accepted Submission(s): 666 Problem Description小w来到百度之星的赛场上,准备开始实现一个程序自动分析系统...原创 2019-01-21 19:59:46 · 292 阅读 · 1 评论 -
左偏树 HYSBZ2809
2809: [Apio2012]dispatchingTime Limit: 10 Sec Memory Limit: 128 MBSubmit: 5551 Solved: 2887[Submit][Status][Discuss]Description在一个忍者的帮派里,一些忍者们被选中派遣给顾客,然后依据自己的工作获取报偿。在这个帮派里,有一名忍者被称之为 Master。除...原创 2019-01-21 20:28:23 · 193 阅读 · 0 评论 -
ZOJ4029 预处理&二分&思路
Now Loading!!! ZOJ - 4029 题目大意:对于每次问询求那个公式的结果,最后输出每次问询*第几次的和。记得之前组队训练时遇到过一次,当时同队的学姐提出了log的预处理,我想到了log的范围只有1~30,但是没再想下去。顺着上面的想法,我们就会想到预处理出a数组在每个log情况下的前缀和。对于每次问询,处理p的每个次方段里的a数组,每段里分母一样,...原创 2019-01-21 20:46:47 · 249 阅读 · 0 评论 -
贪心&STL Codeforces1061D
D. TV Showstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are nn TV shows you want to watch. Suppose the whole time is sp...原创 2019-01-21 21:11:38 · 248 阅读 · 0 评论 -
Codeforces Round #533 (Div. 2) C递推 D有趣有毒的BFS
第一次还是第二次打CF,太有趣了!切水题的能力太弱,暴力过题,暴力是美丽的艺术~AB暴力过,想的太慢。 C递归递推莽就完了,然而我一直在想数学统计的方法orz…C. Ayoub and Lost Arraytime limit per test1 secondmemory limit per test256 megabytesinputstandard ...原创 2019-01-21 21:25:08 · 329 阅读 · 0 评论 -
Codeforces gym101933 I 大数(Java&C++) 超递增背包
I. Intergalactic Biddingtime limit per test2.0 smemory limit per test256 MBinputstandard inputoutputstandard outputToday the Intergalactic Council of Pebble Coins (ICPC) conducted an...原创 2019-03-31 11:01:58 · 467 阅读 · 0 评论 -
Codeforces 1138B——如何优雅地暴力
Codeforces 1138B——如何优雅地暴力题目大意马戏团有nnn(偶数)个艺术家,我们可知道,每个艺术家是否可以作为小丑表演,是否可以作为杂技演员表演。现需将其分成2个表演节目,每个表演节目的人数相等都为n/2n/2n/2,且要求第一个表演节目中能演小丑的人数与第二个表演节目中能演杂技演员的人数相等。输出一种方案。思路即艺术家们有4种:00,01,10,11。根据他们之间要求...原创 2019-07-25 17:08:50 · 250 阅读 · 0 评论 -
Codeforces_1187D 居然是线段树
Codeforces 1187D——居然是线段树题目大意给n个数的序列a和b,对序列a可以选择子序列排序,问a能否变成b。思路对a序列的每个出现的数字,用队列来存储每次出现的位置。对于b序列中每个数字,对应的那个数字到当前位进行操作,且影响最小,就是两两排序,将那个位置的数交换过来,前提是,当前位置到应该在该位置的数的位置间的数字都不小于当前所需数字。即,我们需要知道,区间(当前位置,...原创 2019-07-26 10:47:29 · 223 阅读 · 0 评论 -
启发式合并 Codeforces600E
E. Lomsat gelraltime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a rooted tree with root in vertex 1. Each vertex i...原创 2019-01-21 19:16:30 · 294 阅读 · 0 评论 -
FFT&容斥原理 HDU4609
3-idiotsTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 8695 Accepted Submission(s): 3010 Problem DescriptionKing OMeGa catched thre...原创 2019-01-24 21:33:54 · 284 阅读 · 0 评论 -
UVALive 7040 F Color 容斥&组合数&快速幂&阶乘逆元
Recently, Mr. Big recieved n owers from his fans. He wants to recolor those owers with m colors. The owers are put in a line. It is not allowed to color any adjacent owers with the same color. Flowers...原创 2018-10-24 16:57:29 · 274 阅读 · 0 评论 -
二分图 板题 HDU2444 判断是否为二分图&求二分图最大匹配
The Accomodation of StudentsTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9512 Accepted Submission(s): 4176 Problem DescriptionTher...原创 2018-11-16 17:23:21 · 221 阅读 · 0 评论 -
组合数学 HDU1808 鸽笼原理
太久没写题了菜的一匹。哭辽。Halloween treatsTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1383 Accepted Submission(s): 572Special Judge Problem D...原创 2018-12-01 20:30:07 · 451 阅读 · 0 评论 -
组合数学 CSU2049 象棋
2049: 象棋Submit Page Summary Time Limit: 1 Sec Memory Limit: 128 Mb Submitted: 188 Solved: 48 Description車是中国象棋中的一种棋子,它能攻击同一行或同一列中没有其他棋子阻隔的棋子。一天,小度在棋盘上摆起了许多車……他想知道,在一共N×M个点的矩...原创 2018-12-12 16:40:53 · 363 阅读 · 0 评论 -
计算几何 CSU1986 矩形相交问题
1986: 玄学Submit Page Summary Time Limit: 1 Sec Memory Limit: 128 Mb Submitted: 96 Solved: 16 Description阴阳师子浩君,最近从《初等数论》,《线性代数》,《组合数学》三大玄学宝典中,取得了玄学的精髓,发现,当画出两个矩形组成的样子的图案时候,就很...原创 2018-12-12 21:57:47 · 773 阅读 · 0 评论 -
贪心&公式推导 思路
MoneySubmit Page Time Limit: 1 Sec Memory Limit: 128 Mb Submitted: 11 Solved: 8 DescriptionZJ开公司,年年荣登315晚会。315当天,一大帮员工来ZJ公司讨工资。(显然又欠工资了囧)。员工们围成一个圈,把ZJ围在中间,打算用暴力手段讨取工资。机智如...原创 2018-12-09 15:18:55 · 478 阅读 · 2 评论 -
博弈论 (入门)CSU2209 记忆化搜索
2209: GameSubmit Page Summary Time Limit: 1 Sec Memory Limit: 256 Mb Submitted: 10 Solved: 5 Descriptionxrdog有一个有趣的算式 a^X+b*Y^2≥C现给定a,b和c,且初始的时候X=Y=0,xrdog和小砖准备玩一个游戏。游戏规则是...原创 2018-12-09 16:00:04 · 370 阅读 · 0 评论