08 2019 档案
摘要:链接: https://loj.ac/problem/6285 题意: 给出一个长为 的数列,以及 个操作,操作涉及询问区间的最小众数。 思路: vector维护每个值的出现位置, 预处理第i快到第j块 的众数,然后对不成块的跑暴力, 数组开小了一直wa..找题解,好多题解代码也过不了... 代码:
阅读全文
摘要:链接: https://loj.ac/problem/6284 题意: 给出一个长为 的数列,以及 个操作,操作涉及区间询问等于一个数 的元素,并将这个区间的所有元素改为 。 思路: 维护一个分块是否全部等于一个值,不等于时跑暴力即可. 查询一段时先把对应的分块更新再查询和更改. 代码: c++ i
阅读全文
摘要:链接: https://loj.ac/problem/6283 题意: 给出一个长为 的数列,以及 个操作,操作涉及区间乘法,区间加法,单点询问。 思路: 考虑整块的乘法, 同时对整块的add标记也要乘,对单点操作时, 注意要对整块暴力修改完再操作. 代码: c++ include include
阅读全文
摘要:链接: https://loj.ac/problem/6282 题意: 给出一个长为 的数列,以及 个操作,操作涉及单点插入,单点询问,数据随机生成。 思路: vector 维护每个区间, 当某个区间的值太多时,重构一下. 代码: c++ include include include includ
阅读全文
摘要:链接: https://loj.ac/problem/6281 题意: 给出一个长为 的数列 ,以及 n个操作,操作涉及区间开方,区间求和。 思路: 考虑开方5次之后就为1, 即考虑一整个区间的开方次数,对小于5次的区间暴力开方,否则就不管他. 代码: c++ include include inc
阅读全文
摘要:链接: https://loj.ac/problem/6280 题意: 给出一个长为n 的数列,以及 n个操作,操作涉及区间加法,区间求和。 思路: sum维护区间和, tag维护每个区间多加的,不是一整块的暴力加进去,算的时候加上tag即可. 代码: c++ include include inc
阅读全文
摘要:多校结束了, 网络赛结束了.发现自己还是太菜了,多校基本就是爆零和签到徘徊,第一次打这种高强度的比赛, 全英文,知识点又很广,充分暴露了自己菜的事实,发现数学还是很重要的.还是要多刷题,少玩游戏. 网络赛也打的不好, 开场写01,先是思路错,再是没考虑特判,直接罚时爆炸,再是写06,题意又看错,看了
阅读全文
摘要:链接: https://loj.ac/problem/6279 题意: 给出一个长为 的数列,以及 个操作,操作涉及区间加法,询问区间内小于某个值 的前驱(比其小的最大元素)。 思路: 同样的分块加二分,只不过是更新值 代码: c++ include include include include
阅读全文
摘要:链接: https://loj.ac/problem/6278 题意: 给出一个长为 的数列,以及 个操作,操作涉及区间加法,询问区间内小于某个值 的元素个数。 思路: 分块,用vector维护每个区域的数值,每次通过二分去找满足的值. 每次单个修改时 代码: c++ include include
阅读全文
摘要:链接: https://loj.ac/problem/6277 题意: 给出一个长为 的数列,以及 个操作,操作涉及区间加法,单点查值。 思路: 线段树可以解决,用来学习分块. 分块概念就是,将序列分为sqrt(n)块,每次区间操作在满足一个快时操作块,最多sqrt(n)块, 处于边界时,直接对边界
阅读全文
摘要:链接: https://vjudge.net/problem/HYSBZ 4033 题意: 有一棵点数为N的树,树边有边权。给你一个在0~N之内的正整数K,你要在这棵树中选择K个点,将其染成黑色,并 将其他的N K个点染成白色。将所有点染色后,你会获得黑点两两之间的距离加上白点两两之间距离的和的收益
阅读全文
摘要:链接: https://vjudge.net/problem/CodeForces 916C 题意: Jamie has recently found undirected weighted graphs with the following properties very interesting:
阅读全文
摘要:链接: https://vjudge.net/problem/CodeForces 916B 题意: Jamie is preparing a Codeforces round. He has got an idea for a problem, but does not know how to s
阅读全文
摘要:链接: https://vjudge.net/problem/CodeForces 916A 题意: Jamie loves sleeping. One day, he decides that he needs to wake up at exactly hh: mm. However, he h
阅读全文
摘要:链接: https://vjudge.net/problem/CodeForces 721D 题意: Recently Maxim has found an array of n integers, needed by no one. He immediately come up with idea
阅读全文
摘要:链接: https://vjudge.net/problem/CodeForces 721C 题意: Recently Irina arrived to one of the most famous cities of Berland — the Berlatov city. There are n
阅读全文
摘要:链接: https://vjudge.net/problem/CodeForces 721B 题意: Vanya is managed to enter his favourite site Codehorses. Vanya uses n distinct passwords for sites
阅读全文
摘要:链接: https://vjudge.net/problem/CodeForces 721A 题意: Recently Adaltik discovered japanese crosswords. Japanese crossword is a picture, represented as a
阅读全文
摘要:链接: https://vjudge.net/problem/HDU 4803 题意: Jenny is a warehouse keeper. He writes down the entry records everyday. The record is shown on a screen, a
阅读全文
摘要:链接: https://vjudge.net/problem/HDU 4810 题意: Ms.Fang loves painting very much. She paints GFW(Great Funny Wall) every day. Every day before painting, s
阅读全文
摘要:链接: https://vjudge.net/problem/HDU 4811 题意: Jenny likes balls. He has some balls and he wants to arrange them in a row on the table. Each of those bal
阅读全文
摘要:链接: https://vjudge.net/problem/Gym 100923H 题意: Oberyn Martell and Gregor Clegane are dueling in a trial by combat. The fight is extremely important, a
阅读全文
摘要:链接: https://vjudge.net/problem/HDU 6669 题意: 度度熊在玩一个好玩的游戏。 游戏的主人公站在一根数轴上,他可以在数轴上任意移动,对于每次移动,他可以选择往左或往右走一格或两格。 现在他要依次完成 n 个任务,对于任务 i,只要他处于区间 [ai,bi] 上,就
阅读全文
摘要:链接: https://vjudge.net/problem/HDU 6668 题意: 度度熊最近学习了多项式和极限的概念。 现在他有两个多项式 f(x) 和 g(x),他想知道当 x 趋近无限大的时候,f(x)/g(x) 收敛于多少。 思路: 考虑次项最高的,因为洛必达之后,上下都乘以相同值,所以
阅读全文
摘要:链接: https://vjudge.net/problem/Gym 100923L 题意: Por Costel the pig, our programmer in training, has recently returned from the Petrozaporksk training c
阅读全文
摘要:链接: https://vjudge.net/problem/Gym 100923I 题意: We don't know how Por Costel the pig arrived at FMI's dance party. All we know is that he did. The danc
阅读全文
摘要:链接: https://vjudge.net/problem/Gym 100923A 题意: Por Costel the Pig has received a royal invitation to the palace of the Egg Emperor of Programming, Aze
阅读全文
摘要:链接: https://vjudge.net/problem/CodeForces 585B 题意: The mobile application store has a new game called "Subway Roller". The protagonist of the game Phi
阅读全文
摘要:链接: https://vjudge.net/problem/CodeForces 437C 题意: On Children's Day, the child got a toy from Delayyy as a present. However, the child is so naughty
阅读全文
摘要:链接: https://vjudge.net/problem/CodeForces 449B 题意: Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1
阅读全文
摘要:链接: https://vjudge.net/problem/CodeForces 687A 题意: Recently, Pari and Arya did some research about NP Hard problems and they found the minimum vertex
阅读全文
摘要:链接: https://vjudge.net/problem/CodeForces 682C 题意: Alyona decided to go on a diet and went to the forest to get some apples. There she unexpectedly fo
阅读全文
摘要:链接: https://vjudge.net/problem/CodeForces 707B 题意: Masha wants to open her own bakery and bake muffins in one of the n cities numbered from 1 to n. Th
阅读全文
摘要:链接: https://vjudge.net/problem/CodeForces 598D 题意: Igor is in the museum and he wants to see as many pictures as possible. Museum can be represented a
阅读全文
摘要:链接: https://vjudge.net/problem/CodeForces 1167C 题意: In some social network, there are n users communicating with each other in m groups of friends. Le
阅读全文
摘要:链接: https://vjudge.net/problem/CodeForces 939A 题意: As you could know there are no male planes nor female planes. However, each plane on Earth likes so
阅读全文
摘要:链接: https://vjudge.net/problem/HDU 3415 题意: Given a circle sequence A[1],A[2],A[3]......A[n]. Circle sequence means the left neighbour of A[1] is A[n]
阅读全文
摘要:链接: https://vjudge.net/problem/HDU 3416 题意: Do not sincere non interference。 Like that show, now starvae also take part in a show, but it take place b
阅读全文
摘要:链接: https://vjudge.net/problem/HDU 3081 题意: Presumably, you all have known the question of stable marriage match. A girl will choose a boy; it is simi
阅读全文
摘要:链接: https://vjudge.net/problem/HDU 3605 题意: 2012 If this is the end of the world how to do? I do not know how. But now scientists have found that some
阅读全文
摘要:链接: https://vjudge.net/problem/HDU 2732 题意: Your platoon of wandering lizards has entered a strange room in the labyrinth you are exploring. As you ar
阅读全文
摘要:链接: https://vjudge.net/problem/UVA 10480 题意: The regime of a small but wealthy dictatorship has been abruptly overthrown by an unexpected rebellion. B
阅读全文
摘要:链接: https://vjudge.net/problem/HDU 4289 题意: You, the head of Department of Security, recently received a top secret information that a group of terror
阅读全文
摘要:链接: https://vjudge.net/problem/HDU 4292 题意: You, a part time dining service worker in your college’s dining hall, are now confused with a new problem:
阅读全文
摘要:链接: https://vjudge.net/problem/HDU 4280 题意: In the vast waters far far away, there are many islands. People are living on the islands, and all the tra
阅读全文
摘要:链接: https://vjudge.net/problem/POJ 1459 题意: A power network consists of nodes (power stations, consumers and dispatchers) connected by power transport
阅读全文
摘要:链接: https://vjudge.net/problem/POJ 2516 题意: Dearboy, a goods victualer, now comes to a big problem, and he needs your help. In his sale area there are
阅读全文
摘要:链接: https://vjudge.net/problem/SPOJ GSS1 题意: You are given a sequence A[1], A[2], ..., A[N] . ( |A[i]| ≤ 15007 , 1 ≤ N ≤ 50000 ). A query is defined a
阅读全文
摘要:链接: https://vjudge.net/problem/POJ 2195 题意: 黄弘毅突然兴致大发准备免费送房子,m表示人,H表示房子,每个房子只能进一个人,房子数等于人数。黄弘毅为了方便起见决定要让所有人到自己的房子的距离和最小,请问这个距离和是多少? 思路: 最小费用最大流. 每个人连到
阅读全文
摘要:链接: https://vjudge.net/problem/POJ 3281 题意: 农夫为他的 N (1 ≤ N ≤ 100) 牛准备了 F (1 ≤ F ≤ 100)种食物和 D (1 ≤ D ≤ 100) 种饮料。每头牛都有各自喜欢的食物和饮料,而每种食物或饮料只能分配给一头牛。最多能有多少
阅读全文
摘要:链接: https://vjudge.net/problem/POJ 3436 author=0 题意: 为了追求ACM比赛的公平性,所有用作ACM比赛的电脑性能是一样的,而ACM董事会专门有一条生产线来生产这样的电脑,随着比赛规模的越来越大,生产线的生产能力不能满足需要,所以说ACM董事会想要重新
阅读全文