
acm
小杨小杨爱晒太阳
Enter for a new start.
展开
-
codeforces 977F Consecutive Subsequence
从后向前处理,保证了处理每个数时,它的下一个数都包含最优信息原创 2018-05-07 19:09:07 · 417 阅读 · 0 评论 -
nowcoder 115 H 小P的数学问题
大数阶乘取模,使用打表预先算好一些阶乘,那么实际上每个输入只要从基础上开始算就好了原创 2018-04-21 16:39:54 · 224 阅读 · 0 评论 -
hdu1166 敌兵布阵 - 树状数组学习
树状数组在更新时以lowbit[]不断向右移动,求和时以lowbit[]向左移动,把复杂度控制在了O(log(n))原创 2018-04-28 16:43:24 · 171 阅读 · 0 评论 -
codeforces 967 C Stairs and Elevators
找最近的楼梯或电梯,特判同一层楼的情况原创 2018-04-30 11:55:14 · 584 阅读 · 2 评论 -
codeforces 913 D. Too Easy Problems
逆向思索分析问题的解,二分查找和vector的巧妙使用原创 2018-04-19 00:17:27 · 277 阅读 · 0 评论 -
codeforces 909 D. Colorful Points
字符串的压缩操作,以及不断减少过程中的合并原创 2018-04-13 00:04:29 · 484 阅读 · 0 评论 -
codeforces 909 C. Python Indentation
dp: 把暴力搜索会重复做的转移整合起来一次性完成原创 2018-04-12 23:36:25 · 455 阅读 · 0 评论 -
codeforces 911 E. Stack Sorting
关于栈排序可以引发很多的思考,跟着题解做了一遍真的很妙啊原创 2018-04-12 11:30:10 · 277 阅读 · 0 评论 -
2018 CCCC L1 001 天梯赛座位分配
看似混乱的打表问题,需要静下心来思考原创 2018-04-04 00:18:03 · 306 阅读 · 0 评论 -
2018 CCCC天梯赛 L2 04 秀恩爱分得快
所以说,秀恩爱真的让人头大orz原创 2018-04-03 20:06:52 · 773 阅读 · 0 评论 -
codeforces 915 D Almost Acyclic Graph
DescriptionYou are given a directed graph consisting of n vertices and m edges (each edge is directed, so it can be traversed in only one direction). You are allowed to remove at most one edge from ...原创 2018-04-08 22:56:41 · 213 阅读 · 0 评论 -
nowcoder 90 K 密码
字符串输出样式的控制原创 2018-03-24 20:38:15 · 299 阅读 · 0 评论 -
codeforces 976 C Nested Segments(树状数组BIT复习)
把删除过的都删除掉,并利用BIT高效完成删除操作,这样的思想其实挺常用的,适合用于高效的计数。原创 2018-05-01 13:16:55 · 303 阅读 · 0 评论 -
nowcoder 90 E-回旋星空
两个点到一个点的距离相同,可以求一个距离矩阵,并按距离排序,相同的距离就被整理到了一起,计数很方便原创 2018-03-24 19:41:43 · 227 阅读 · 0 评论 -
codeforces 977C Less or Equal
相同的数如果小于,就都小于,所以k的变化是不连续的;需要对0的特判原创 2018-05-07 16:51:22 · 290 阅读 · 0 评论 -
nowcoder 84 B 漂亮的树
建立与答案序列有相同性质的辅助序列,比较起来就十分方便原创 2018-04-27 21:53:38 · 303 阅读 · 0 评论 -
牛客网 106 J-Various Tree (BFS复习)
总状态数只有1e6时,要搜索一个状态到另一个状态需要转移的次数,总共需要搜索的状态最多只有n个,完全可以直接搜索原创 2018-04-29 15:16:08 · 150 阅读 · 0 评论 -
codeforces 977D Divide by three, multiply by two
有向图上,找一个经过所有点的路径。复杂度O(n^2)原创 2018-05-07 16:11:20 · 246 阅读 · 0 评论 -
codeforces 977E Cyclic Components
简单环是一个很强的定义,判断条件很简单原创 2018-05-07 15:24:43 · 444 阅读 · 2 评论 -
Codeforces round #481(Div.3) 题解
Div. 3 :思考时间+写代码时间+Debug时间,哪一环慢了都不行啊原创 2018-05-13 22:11:00 · 327 阅读 · 0 评论 -
牛客练习赛17 C 操作数(矩阵快速幂)
没错,这道题就是可以用矩阵快速幂来做原创 2018-05-05 02:15:03 · 305 阅读 · 0 评论 -
Wannafly挑战赛15 B - 车辆安排
贪心:每次尽可能的把人数大的拼到同一辆车原创 2018-05-11 21:51:41 · 255 阅读 · 0 评论 -
CF 954C Matrix Walk
当直接判断两个点的连接是否正确很繁琐时,不妨把从一个点出发能转移到的点全部计算出来,再去判断这个点集里有没有另一个点的存在。原创 2018-05-04 18:06:41 · 276 阅读 · 0 评论 -
codeforces 967 D Resource Distribution
短板*数量,选好短板以后就只关心数量。遍历短板的位置,并在大于短板的范围寻找可能的解原创 2018-05-03 22:22:46 · 567 阅读 · 3 评论 -
codeforces 962 D. Merge Equals
使用优先队列处理反复删除和插入过程中最小值的查找原创 2018-04-20 18:14:39 · 202 阅读 · 0 评论 -
codeforces 962 C. Make a Square
把一个数不断缩短的过程,是一个在三角形上的搜索,利用set把重复搜索的状态重叠起来,把计算次数从10!降低到了2^10原创 2018-04-20 12:23:08 · 291 阅读 · 0 评论 -
codeforces 961 E Tufurama
处理-删除 的思想,使得处理的数据始终是全部有效的,并利用高效的数据结构完成删除操作以及数据的更新。原创 2018-05-01 19:54:19 · 311 阅读 · 0 评论 -
nowcoder 90 L-用来作弊的药水
判断两个很大的幂是否相等,不用计算出结果也可以比较。原创 2018-03-24 18:27:45 · 204 阅读 · 0 评论 -
nowcoder 68 A-圆圆
比较圆被圆上两点分成的两段弧的长短,需要注意的是小数点的精度原创 2018-03-13 21:45:19 · 173 阅读 · 0 评论 -
codeforces 931 C. Laboratory Work
阅读量稍大的一道题目,理清关系后其实不难原创 2018-03-05 17:23:56 · 437 阅读 · 0 评论 -
nowcoder 67 F 大吉大利,今晚吃鸡——跑毒篇
一道模拟题,只要不断更新状态以及最后一次更新的时候不需要保证状态值大于0原创 2018-01-29 21:53:37 · 294 阅读 · 0 评论 -
codeforces 922 C Cave Painting
能同时满足n mod i = i -1 (i = 1, 2, 3, ..., k)的n有多少个呢?原创 2018-02-08 14:04:12 · 796 阅读 · 2 评论 -
codeforces 916 A Jamie and Alarm Snooze
一道很简单的模拟题。原创 2018-01-20 00:52:46 · 772 阅读 · 0 评论 -
codeforces 148 B Escape
又一道模拟题,把关系理清楚就好做啦原创 2018-01-27 20:16:19 · 239 阅读 · 0 评论 -
codeforces 915 C Permute Digits
Description You are given two positive integer numbers a and b. Permute (change order) of the digits of a to construct maximal number not exceeding b. No number in input and/or output can start with原创 2018-01-18 16:56:52 · 326 阅读 · 0 评论 -
HDU 1698 E just a hook 线段树区间更新+lzy
In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the same length.Now Pudge原创 2018-01-09 22:09:11 · 202 阅读 · 0 评论 -
POJ 2528 Mayor's posters 线段树区间更新+端点离散化
DescriptionThe citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city council has原创 2018-01-09 16:25:36 · 244 阅读 · 0 评论 -
CS Round#65 B Count 4-cycles
DescriptionYou are given two trees of NN nodes each, T1T_1 and T2T_2. Suppose NN additional bidirectional edges are added: the ithi^{\text{th}} edge will join nodes ii from T1T_1 and ii from T2T_2 ,原创 2018-01-18 01:28:12 · 158 阅读 · 0 评论 -
POJ 3468 A Simple Problem with Integers-利用lzy进行区间更新的线段树
You have N integers, A1,A2,...,ANA_1, A_2, ... , A_N. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other is原创 2017-12-23 17:04:22 · 190 阅读 · 0 评论 -
codeforce 915 B Browser
Luba is surfing the Internet. She currently has n opened tabs in her browser, indexed from 1 to n from left to right. The mouse cursor is currently located at the pos-th tab. Luba needs to use the tab原创 2018-01-14 00:42:23 · 733 阅读 · 0 评论