其他:思维
文章平均质量分 77
其他:思维
LSD20164388
如果你过几天就忘了,那么你并没有真正的掌握。
展开
-
2019-2020 ICPC香港 A. Axis of Symmetry (思维+结论)
传送门题意TTT组数据,每组数据给你一个正整数nnn,然后给你笛卡尔坐标系下nnn个矩形的左下角和右上角的点的坐标(xi1,yi1),(xi2,yi2)(x_{i_1},y_{i_1}),(x_{i_2},y_{i_2})(xi1,yi1),(xi2,yi2),保证矩形之间不会有重叠,求出所有的对称轴。输出格式:第一行一个整数szszsz,表示对称轴数量。接下来一行输出若干条对称轴的三个参数,一条对称轴的三个参数形式为 aaa bbb ccc,表示对称轴ax+by=cax+by=c原创 2020-12-16 14:22:33 · 1595 阅读 · 0 评论 -
2020 China Collegiate Programming Contest - Mianyang Site 2020 CCPC 绵阳站 B. Building Blocks(dp)
传送门题意TTT组数据,每组数据给你三个正整数n,m,kn,m,kn,m,k,其中n,mn,mn,m分别为积木的长和宽(积木由若干个1×1×11\times1\times11×1×1的小方块组成),再给你左前视图(如图所示)每一部分的最终高度aia_iai(共n+mn+mn+m部分),接下来kkk行,每行三个正整数x,y,hx,y,hx,y,h,表示第xxx行yyy列的高度指定为正整数hhh,问你合法的积木总数,对109+710^9+7109+7取模。数据范围:1⩽T,n,m,k⩽105,原创 2020-11-30 18:48:19 · 769 阅读 · 0 评论 -
Educational Codeforces Round 97 (Rated for Div. 2) G. Death DBMS (AC自动机)
传送门G. Death DBMStime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputFor the simplicity, let’s say that the “Death Note” is a notebook that kills a person when their name is written in it.It’s easy to原创 2020-11-10 15:05:25 · 295 阅读 · 0 评论 -
2020 China Collegiate Programming Contest Qinhuangdao Site B. Bounding Wall(思维+并查集)
传送门B. Bounding Walltime limit per test4.0 smemory limit per test512 megabytesinputstandard inputoutputstandard outputAlex is a professional computer game player.These days, Alex is playing a war strategy game. His land is a rectangular grid with n r原创 2020-10-28 22:17:17 · 486 阅读 · 0 评论 -
Educational Codeforces Round 90 (Rated for Div. 2) G. Pawns (线段树)
G. Pawnstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a chessboard consisting ofnnrows andnncolumns. Rows are numbered from bottom to top from11tonn. Columns are...原创 2020-07-03 14:30:08 · 290 阅读 · 0 评论 -
Educational Codeforces Round 90 (Rated for Div. 2) F. Network Coverage(二分 or 思维)
F. Network Coveragetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe government of Berland decided to improve network coverage in his country. Berland has a unique structure: the cap原创 2020-07-01 20:52:15 · 361 阅读 · 0 评论 -
Codeforces Global Round 8 E. Ski Accidents (思维)
E. Ski Accidentstime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputArthur owns a ski resort on a mountain. There arennlanding spots on the mountain numbered from11tonnfrom the top t...原创 2020-06-28 20:58:33 · 350 阅读 · 0 评论 -
ZOJ 3984 Graph Generator(2017CCPC秦皇岛 D)可撤销并查集+思维
题目传送门题意:T组数据,每组数据给你n(<=1e5)个点,m(<=min(1e5,n*(n-1)/2))条无向边,你需要构造一个合法的序列,其中每一项输出三个数:点x,你选择的点集的大小,然后给出这些点。(初始为空图,之后系统会增加一个新点x,并将x与你给出的这些点所在的连通块的每一个结点连边!)最后形成题中给你的图。问你是否存在合法方案,如果存在输出Yes和任意一种方案,否则输出No。思路:直接正着做找合法序列太难了,我们考虑从原图往下一个一个拆点,拆成一个合原创 2020-06-24 22:07:04 · 418 阅读 · 0 评论 -
Codeforces Round #651 (Div. 2) F2. The Hidden Pair (Hard Version) (二分+剪枝)
F2. The Hidden Pair (Hard Version)time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputNote that the only difference between the easy and hard version is the constraint on the number of que原创 2020-06-24 20:03:43 · 292 阅读 · 0 评论 -
HDU 6231 K-th Number (2017CCPC哈尔滨 B)离散化+二分
K-th NumberTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 3111Accepted Submission(s): 1126Problem DescriptionAlice are given an arrayA[1..N]withNnumbers.Now Alice want to build an...原创 2020-06-16 22:30:22 · 238 阅读 · 0 评论 -
Pangu and Stones HihoCoder - 1636 (ICPC 2017 北京 J) 区间dp
传送门:https://hihocoder.com/problemset/problem/1636题意:给你n(<=100)堆石子,再给你两个数L,R(2<=L<=R<=n),表示你只能将连续的x(L<=x<=R)堆石子合并成为一堆,费用为这x堆石子的总数。求将这n堆石子合并成1堆的最小花费,如果不能合并成一堆输出0。思路:这题跟区间dp的入门很像,但是暴力枚举[i,k][k+1,j]区间的同时还要考虑两个子区间的石子数量,直接枚举的复杂度就成了O(n^5),原创 2020-06-12 14:45:59 · 217 阅读 · 0 评论 -
Puzzle Game HihoCoder - 1634(ICPC 北京 2017 H )最大子矩阵+思维
传送门:https://hihocoder.com/problemset/problem/1634题意:给你一个n*m(n,m<=150)的数字矩阵,每个元素val(-1000<=val<=1000),以及一个数字p(-1000<=p<=1000)。你现在最多可以修改矩阵中的一个数字,改成p,求最大子矩阵的最小值思路:其实关键还是想到,对于某个点(i,j),要么最大子矩阵(设值为ma)经过了这个点,要么没有经过这个点。如果没有经过这个点,我们只需要统计其上下左右四个部分原创 2020-06-12 14:28:50 · 253 阅读 · 0 评论 -
Codeforces Round #647 (Div. 2) - Thanks, Algo Muse! F. Johnny and Megan’s Necklace(思维+欧拉回路)
F. Johnny and Megan's Necklacetime limit per test3 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputJohnny's younger sister Megan had a birthday recently. Her brother has bought her a box signed as "Your be原创 2020-06-10 17:40:15 · 477 阅读 · 0 评论 -
牛客练习赛63 F 牛牛的树行棋 (SG函数+树差分)
链接:https://ac.nowcoder.com/acm/contest/5531/F来源:牛客网牛牛的树行棋时间限制:C/C++ 2秒,其他语言4秒空间限制:C/C++ 524288K,其他语言1048576K64bit IO Format: %lld题目描述牛牛和牛妹是一对好朋友,这天他们俩决定在树上玩一个游戏。游戏的名字是“树行棋”,规则如下:给定一个含有n个节点分别从1到n编号且以节点1为根的树,一开始每个节点各有1个棋子。牛牛和牛妹轮流进行操作,且牛..原创 2020-05-09 17:02:22 · 466 阅读 · 0 评论 -
Wannafly挑战赛19-C-多彩的树(状压+容斥)
链接:https://www.nowcoder.com/acm/contest/131/C来源:牛客网多彩的树时间限制:C/C++ 5秒,其他语言10秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述有一棵树包含 N 个节点,节点编号从 1 到 N。节点总共有 K 种颜色,颜色编号从 1 到 K。第 i 个节点的颜...原创 2020-05-05 22:22:48 · 457 阅读 · 0 评论 -
Codeforces Round #635 (Div. 2) C - Linova and Kingdom(树形dp+思维)
Linova and Kingdomtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputWriting light novels is the most important thing in Linova's l...原创 2020-04-18 12:54:34 · 288 阅读 · 0 评论 -
Educational Codeforces Round 85 (Rated for Div. 2)E. Divisor Paths(数论,思维)
E. Divisor Pathstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a positive integerDD. Let's build the following g...原创 2020-04-16 22:13:27 · 263 阅读 · 0 评论 -
Codeforces Round #633 (Div. 2) E. Perfect Triples (打表找规律)
E. Perfect Triplestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputConsider the infinite sequencessof positive integers, create...原创 2020-04-15 14:58:28 · 497 阅读 · 0 评论 -
Codeforces Round #631 (Div. 2) - Thanks, Denis aramis Shitov! D. Dreamoon Likes Sequences(打表找规律)
D. Dreamoon Likes Sequencestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputDreamoon likes sequences very much. So he created a pr...原创 2020-04-05 21:14:18 · 493 阅读 · 0 评论 -
Codeforces Round #628 (Div. 2) E. Ehab's REAL Number Theory Problem(思维+BFS)
题目传送门E. Ehab's REAL Number Theory Problemtime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an arrayaaof lengthn...原创 2020-03-16 18:29:12 · 226 阅读 · 0 评论 -
Codeforces Round #626 (Div. 2, based on Moscow Open Olympiad in Informatics) D. Present(思维)
题目传送门D. Presenttime limit per test3 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputCatherine received an array of integers as a gift for March 8. ...原创 2020-03-11 11:03:37 · 286 阅读 · 0 评论 -
Codeforces Round #615 (Div. 3) F. Three Paths on a Tree (DFS)
题目链接F. Three Paths on a Treetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an unweighted tree withnnvertices....原创 2020-01-23 18:23:58 · 529 阅读 · 0 评论 -
Codeforces Round #615 (Div. 3) E Obtain a Permutation (思维)
题目链接E. Obtain a Permutationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a rectangular matrix of sizen×mn×mc...原创 2020-01-23 18:13:47 · 990 阅读 · 0 评论 -
HDU 5348 MZL's endless loop (dfs+思维)
MZL's endless loopTime Limit: 3000/1500 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 3134 Accepted Submission(s): 741Special Judge Problem Description...原创 2018-07-31 11:11:11 · 281 阅读 · 0 评论 -
2019年华南理工大学程序设计竞赛(春季赛) H Parco_Love_GCD(思维)
链接:https://ac.nowcoder.com/acm/contest/625/H来源:牛客网时间限制:C/C++ 3秒,其他语言6秒空间限制:C/C++ 131072K,其他语言262144K64bit IO Format: %lld题目描述众所周知,在算法竞赛中,出题人对他出的题的难度往往存在错误的估计。比如出题人本想出个中等题,没想到却出成了简单题;本想出个自闭题...原创 2019-04-15 19:03:36 · 724 阅读 · 0 评论 -
LightOJ - 1095 - Arrange the Numbers(组合数+错排公式)
1095 - Arrange the Numbers PDF (English) Statistics Forum Time Limit:2 second(s) Memory Limit:32 MB Consider this sequence{1, 2, 3 ... N}, as an initial sequence of firstNnat...原创 2019-04-07 17:07:15 · 410 阅读 · 0 评论 -
LightOJ - 1102 - Problem Makes Problem(快速幂+隔板法)
1102 - Problem Makes Problem PDF (English) Statistics Forum Time Limit:2 second(s) Memory Limit:32 MB As I am fond of making easier problems, I discovered a problem. Actually, t...原创 2019-04-07 16:50:23 · 262 阅读 · 0 评论 -
LightOJ - 1170 - Counting Perfect BST (思维+卡特兰数)
1170 - Counting Perfect BST PDF (English) Statistics Forum Time Limit:2 second(s) Memory Limit:32 MB BST is the acronymfor Binary Search Tree. A BST is a tree data structure wi...原创 2019-04-07 16:40:21 · 395 阅读 · 0 评论 -
POJ 1971 Parallelogram Counting (思维)
Parallelogram CountingTime Limit:5000MS Memory Limit:65536K Total Submissions:6969 Accepted:2446 DescriptionThere are n distinct points in the plane, given by their integer...原创 2019-03-23 10:51:45 · 251 阅读 · 0 评论 -
2019年2月13日训练日记
思维题小结:思维题算是所有题目类型中最有趣的题目,一般不会太难,经常作为铜牌题以下。最裸的思维题不需要任何的其他知识算法,仅凭你对c/c++的理解就可以做。稍微难一点的可以涉及到一些基础知识算法中的一些性质,看你是否真正理解了这个东西并且能灵活运用,无论什么时候,做思维题都是极好的。而这种思维性也被应用到一些难题的初始化中,如多校训练,经常会拐个弯问你,这个时候思维灵活性就至关重要,你想不出来...原创 2019-02-14 08:41:34 · 208 阅读 · 0 评论 -
HDU 6059 Kanade's trio(思维+字典树,好题)
Kanade's trioTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 1478 Accepted Submission(s): 548 Problem DescriptionGive you an array ...原创 2019-02-19 12:07:04 · 330 阅读 · 0 评论 -
CCPC-Wannafly Winter Camp Day7 (Div2, onsite) F 逆序对! (01字典树的O(nlogn)做法)
思路:这道题其实还是偏思维,用O(n*n*logn)和O(n*n)的做法都可以过,但核心思想是一样的。对于任意两个数x,y(x!=y),不妨设x<y 要想使另一个数z使得x^z>y^z的条件是设 t为 x^y 的最高为1的位(则x的第t位为0,y的第t位为1)则z的第t位为1。好好思考一下上述过程。所以要求1~m中有多少个数能改变x y的大小关系,只需要求有...原创 2019-01-30 11:42:09 · 368 阅读 · 0 评论 -
2019年华南理工大学程序设计竞赛(春季赛) A NB群友 (记忆化搜索)
链接:https://ac.nowcoder.com/acm/contest/625/A来源:牛客网时间限制:C/C++ 2秒,其他语言4秒空间限制:C/C++ 131072K,其他语言262144K64bit IO Format: %lld题目描述CC是著名的算法竞赛选手,他不仅人长得帅,而且技术了得,自然而然就有了许多粉丝。为了能帮助粉丝们提高竞技水平,CC建立了一个粉...原创 2019-04-15 19:35:03 · 636 阅读 · 3 评论 -
The 19th Zhejiang University Programming Contest Sponsored by TuSimple - C Robot Cleaner I (模拟)
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=4092题意:给你一个n*m(n*m<=2000)的数字矩阵t,每个数字均为0,1,2其中之一.保证边界都是10表示该格子空1表示该格子有墙2表示该格子有一个垃圾一个机器人从点(x,y)出发,最多进行k(k<=1e18)次操作。...原创 2019-04-15 20:38:09 · 371 阅读 · 2 评论 -
2019年 ACM/ICPC 亚洲区域赛(徐州)网络赛M.Longest subsequence(思维+贪心)
String is a very useful thing and a subsequence of the same string is equally important.Now you have a stringsswith lengthnnand a stringttwith lengthmm. Find out the longest subsequence in th...原创 2019-09-07 20:43:10 · 1660 阅读 · 0 评论 -
CodeForces -226C - Anniversary(思维,数论,矩阵快速幂)
C. Anniversarytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are less than 60 years left till the 900-th birthday anniver...原创 2019-07-26 07:25:46 · 297 阅读 · 0 评论 -
ZOJ 4102 Array in the Pocket (贪心)
Array in the PocketTime Limit:2 Seconds Memory Limit:65536 KBBaoBao has just found an arrayofintegers in his left pocket. As BaoBao is bored, he decides to rearrange it into another arr...原创 2019-05-08 09:13:30 · 862 阅读 · 0 评论 -
ZOJ 3941 Kpop Music Party (贪心+思维+枚举)
Kpop Music PartyTime Limit:2 Seconds Memory Limit:65536 KBMarjar University often hosts Kpop music festival. A Kpop music festival will last several days. During a Kpop festival, there will...原创 2019-05-06 17:26:48 · 323 阅读 · 0 评论 -
HDU 6514 Monitor(二维前缀和)
MonitorTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 163840/163840 K (Java/Others)Total Submission(s): 192Accepted Submission(s): 47Problem DescriptionXiaoteng has a large area ...原创 2019-04-20 08:53:34 · 1259 阅读 · 5 评论 -
HDU 6518 Clumsy Keke (思维)
Clumsy KekeTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 88Accepted Submission(s): 30Problem DescriptionKeke is currently studyin...原创 2019-04-20 08:08:26 · 231 阅读 · 0 评论