自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

原创 Codeforces Round #622 (Div. 2)

Codeforces Round #622 (Div. 2) http://codeforces.com/contest/1313 A - Fast Food Restaurant #include<bits/stdc++.h> using namespace std; int t,a...

2020-02-25 00:51:40

阅读数 15

评论数 0

原创 C2 - Skyscrapers (hard version),Codeforces Round #622 (Div. 2),单调栈

C2 - Skyscrapers (hard version) http://codeforces.com/contest/1313/problem/C2 思路:首先枚举最高楼,由题意可知最高楼的两边都是递减的,现假设最高楼的下标为1,算出最优方案,之后每次将最高楼的下标向右平移,假设当前平移到i...

2020-02-25 00:51:23

阅读数 12

评论数 0

原创 Kanade's convolution,HDU - 6057,FWT

Kanade’s convolution,HDU - 6057 https://vjudge.net/problem/HDU-6057/origin Give you two arrays A[0…2m−1] and B[0…2m−1]. Please calculate array C[0…2m...

2020-02-19 14:43:03

阅读数 8

评论数 0

原创 Binary Table,CodeForces - 662C,FWT,状压

Binary Table,CodeForces - 662C https://vjudge.net/problem/CodeForces-662C/origin You are given a table consisting of n rows and m columns. Each cell ...

2020-02-19 13:12:11

阅读数 8

评论数 0

原创 Super Rooks on Chessboard,UVA - 12633,FFT

Super Rooks on Chessboard,UVA - 12633 https://vjudge.net/problem/UVA-12633/origin Let’s assume there is a new chess piece named Super-rook. When plac...

2020-02-19 12:34:33

阅读数 10

评论数 0

原创 Hard Nim,HYSBZ - 4589,Nim博弈,FWT

Hard Nim,HYSBZ - 4589 https://vjudge.net/problem/HYSBZ-4589/origin Claris和NanoApe在玩石子游戏,他们有n堆石子,规则如下: Claris和NanoApe两个人轮流拿石子,Claris先拿。 每次只能从一堆中取若干个,...

2020-02-19 12:13:39

阅读数 17

评论数 0

原创 A+B Problem,Kattis - aplusb,FFT

A+B Problem,Kattis - aplusb Given N integers in the range [−50000,50000], how many ways are there to pick three integers ai, aj, ak, such that i, j, ...

2020-02-19 12:05:54

阅读数 24

评论数 0

原创 HDU - 4609 ,3-idiots,FFT

HDU - 4609 ,3-idiots https://vjudge.net/problem/HDU-4609/origin King OMeGa catched three men who had been streaking in the street. Looking as idiots ...

2020-02-19 00:14:18

阅读数 15

评论数 0

原创 HDU - 1402,A * B Problem Plus,FFT板

HDU - 1402,A * B Problem Plus https://vjudge.net/problem/HDU-1402/origin Calculate A * B. 思路:FFT板题,贴个常数很小的板子 #include<bits/stdc++.h> #define ll...

2020-02-18 23:47:20

阅读数 11

评论数 0

原创 Tree,2017 ACM-ICPC 亚洲区(西安赛区)网络赛A,点分治

2017 ACM-ICPC 亚洲区(西安赛区)网络赛 A Tree https://nanti.jisuanke.com/t/A1267 There is a tree with nn nodes, at which attach a binary 64*6464∗64 matrix M_i (1...

2020-02-18 21:54:25

阅读数 13

评论数 0

原创 Codeforces Round #620 (Div. 2)

Codeforces Round #620 (Div. 2) https://codeforces.com/contest/1304 A - Two Rabbits 思路:注意特判a+b等于0的情况就好 #include<bits/stdc++.h> using namespace s...

2020-02-15 23:33:28

阅读数 9

评论数 0

原创 Codeforces Round #619 (Div. 2)

Codeforces Round #619 (Div. 2) https://codeforces.com/contest/1301 A - Three Strings 思路:只要a[i],b[i]中的一个和c[i]相等,直接把另一个和c[i]换就好 #include<bits/stdc++...

2020-02-15 13:34:32

阅读数 42

评论数 0

原创 E. Xenon's Attack on the Gangs,Codeforces Round #614 (Div. 2),树形dp

E. Xenon’s Attack on the Gangs http://codeforces.com/contest/1293/problem/E On another floor of the A.R.C. Markland-N, the young man Simon “Xenon” Ja...

2020-02-14 21:23:28

阅读数 33

评论数 0

原创 Educational Codeforces Round 82 (Rated for Div. 2)

Educational Codeforces Round 82 (Rated for Div. 2) https://codeforces.com/contest/1303 A - Erasing Zeroes 思路:直接看最左边和最右边的1中间有多少个0 #include<bits/std...

2020-02-13 00:56:43

阅读数 14

评论数 0

原创 E - Water Balance,Codeforces Round #618 (Div. 2),单调栈

E - Water Balance https://codeforces.com/contest/1300/problem/E outputstandard output There are n water tanks in a row, i-th of them contains ai lite...

2020-02-12 01:33:38

阅读数 11

评论数 0

原创 Codeforces Round #618 (Div. 2)

Codeforces Round #618 (Div. 2) http://codeforces.com/contest/1300 A - Non-zero 思路:首先0就加到1,然后如果总和为0的话肯定有正数,将其中任意一个加1就好 #include<bits/stdc++.h> #...

2020-02-10 00:42:13

阅读数 18

评论数 0

原创 E. Prefix Enlightenment,Codeforces Round #616 (Div. 2),拆点并查集

E. Prefix Enlightenment http://codeforces.com/contest/1291/problem/E 题意:有一个01字符串s,长度为n,有k个集合 A1,A2,...AkA_1,A_2,...A_kA1​,A2​,...Ak​ ,他们都是{ 1,2,...,n...

2020-02-08 02:22:19

阅读数 12

评论数 0

原创 Codeforces Round #617 (Div. 3)

Codeforces Round #617 (Div. 3) A - Array with Odd Sum 思路:有奇偶数同时存在YES,只有奇数是n是奇数为YES,否则NO #include<bits/stdc++.h> #define MAXN 2005 using namespa...

2020-02-05 00:53:35

阅读数 1159

评论数 0

原创 Codeforces Round #616 (Div. 2)

http://codeforces.com/contest/1291/my A - Even But Not Even 思路:先把末尾的偶数全部去掉,然后长度不为0的话看剩下的数字和是否为偶数,是的话直接输出,否则找一个奇数删去,注意不要有前导0 #include<bits/stdc++.h...

2020-02-03 01:39:03

阅读数 24

评论数 0

原创 E. Permutation Separation,Educational Codeforces Round 81 (Rated for Div. 2),线段树

E. Permutation Separation http://codeforces.com/contest/1295/problem/E You are given a permutation p1,p2,…,pn (an array where each integer from 1 to ...

2020-01-30 19:01:44

阅读数 495

评论数 2

原创 D. Same GCDs, Educational Codeforces Round 81 (Rated for Div. 2),欧拉函数

D. Same GCDs, Educational Codeforces Round 81 (Rated for Div. 2) You are given two integers a and m. Calculate the number of integers x such that 0≤x...

2020-01-30 01:23:05

阅读数 163

评论数 0

原创 Educational Codeforces Round 81 (Rated for Div. 2)

Educational Codeforces Round 81 (Rated for Div. 2) http://codeforces.com/contest/1295 A. Display The Number 思路:首先位数越多越好,那么直接不断的填1,但是只剩3段可以点亮时在首位填个7比较...

2020-01-30 01:20:58

阅读数 2913

评论数 0

原创 HDU - 6035,点分治,组合计数

Colorful Tree https://vjudge.net/problem/938230/origin There is a tree with n nodes, each of which has a type of color represented by an integer, whe...

2020-01-18 18:43:37

阅读数 152

评论数 0

原创 HDU - 4812,点分治

D Tree https://vjudge.net/problem/48318/origin There is a skyscraping tree standing on the playground of Nanjing University of Science and Technology...

2020-01-18 12:43:22

阅读数 130

评论数 0

原创 HDU - 5469,点分治,hash,先处理子树

Antonidas https://vjudge.net/problem/HDU-5469 Given a tree with N vertices and N−1 edges. Each vertex has a single letter Ci. Given a string S, you a...

2020-01-18 10:29:32

阅读数 111

评论数 0

原创 CodeChef PRIMEDST,点分治,FFT

Prime Distance On Tree https://vjudge.net/problem/149908/origin Problem description. You are given a tree. If we select 2 distinct nodes uniformly at...

2020-01-17 11:06:35

阅读数 43

评论数 0

原创 HDU - 5977,点分治,状压

Garden of Eden https://vjudge.net/problem/550645/origin When God made the first man, he put him on a beautiful garden, the Garden of Eden. Here Adam ...

2020-01-16 21:20:49

阅读数 31

评论数 0

原创 HYSBZ 2152,点分治

聪聪可可 聪聪和可可是兄弟俩,他们俩经常为了一些琐事打起来,例如家中只剩下最后一根冰棍而两人都想吃、两个人都想玩儿电脑(可是他们家只有一台电脑)……遇到这种问题,一般情况下石头剪刀布就好了,可是他们已经玩儿腻了这种低智商的游戏。他们的爸爸快被他们的争吵烦死了,所以他发明了一个新游戏:由爸爸在纸上画...

2020-01-16 17:21:56

阅读数 24

评论数 0

原创 POJ - 2114,点分治

Boatherds Boatherds Inc. is a sailing company operating in the country of Trabantustan and offering boat trips on Trabantian rivers. All the rivers o...

2020-01-16 17:00:53

阅读数 42

评论数 0

原创 POJ - 1741,点分治

A - Tree Give a tree with n vertices,each edge has a length(positive integer less than 1001). Define dist(u,v)=The min distance between node u and v....

2020-01-16 16:11:01

阅读数 25

评论数 0

原创 P3806 【模板】点分治1

P3806 【模板】点分治1 给定一棵有 nn 个点的树。 询问树上距离为 kk 的点对是否存在。 思路:点分治,先选取一个重心root,算出每个点到它的距离,从而可以通过枚举两条路径能够组成的 询问距离 的次数,但是这样会将同一子树上的两条路径算上(即路径长度加上了两倍子节点到root的距离),...

2020-01-16 15:39:56

阅读数 30

评论数 0

原创 A. Deadline,数论分块

Educational Codeforces Round 80 (Rated for Div. 2) A. Deadline https://codeforces.com/contest/1288/problem/A 思路:⌈dx+1⌉=⌊d+xx+1⌋=1+⌊d−1x+1⌋\lceil \fr...

2020-01-16 10:21:53

阅读数 45

评论数 0

原创 C. Two Arrays,组合数学

C. Two Arrays https://codeforces.com/contest/1288/problem/C You are given two integers n and m. Calculate the number of pairs of arrays (a,b) such th...

2020-01-16 10:18:41

阅读数 50

评论数 0

原创 Gym 101190D,上下界区间覆盖

Delight for a Cat A cat is going on an adventure. Each hour, the cat can be either sleeping or eating. The cat cannot be doing both actions at the sa...

2020-01-15 23:13:45

阅读数 28

评论数 0

原创 POJ - 1815,动态修改容量最大流,字典序最小割集

Friendship In modern society, each person has his own friends. Since all the people are very busy, they communicate with each other only by phone. Yo...

2020-01-15 19:37:14

阅读数 36

评论数 0

原创 POJ - 1815,字典序最小割集

Friendship In modern society, each person has his own friends. Since all the people are very busy, they communicate with each other only by phone. Yo...

2020-01-15 16:44:41

阅读数 37

评论数 0

原创 HYSBZ 1061,线性规划转最小费用流

志愿者招募 申奥成功后,布布经过不懈努力,终于成为奥组委下属公司人力资源部门的主管。布布刚上任就遇到了一个难 题:为即将启动的奥运新项目招募一批短期志愿者。经过估算,这个项目需要N 天才能完成,其中第i 天至少需要 Ai 个人。 布布通过了解得知,一共有M 类志愿者可以招募。其中第i 类可以从第S...

2020-01-15 11:34:18

阅读数 28

评论数 0

原创 Educational Codeforces Round 80 (Rated for Div. 2)

Educational Codeforces Round 80 (Rated for Div. 2) https://codeforces.com/contest/1288 A. Deadline 思路:先不看取顶符号,求一次导发现大概在d\sqrt{d}d​左右达到最小值,再在两边找最小值即可 ...

2020-01-15 01:07:59

阅读数 42

评论数 0

原创 HYSBZ 1061,单纯形&对偶原理

志愿者招募 申奥成功后,布布经过不懈努力,终于成为奥组委下属公司人力资源部门的主管。布布刚上任就遇到了一个难 题:为即将启动的奥运新项目招募一批短期志愿者。经过估算,这个项目需要N 天才能完成,其中第i 天至少需要 Ai 个人。 布布通过了解得知,一共有M 类志愿者可以招募。其中第i 类可以从第S...

2020-01-14 21:48:37

阅读数 44

评论数 0

原创 UVALive - 3231,二分&最大流

Fair Share You are given N processors and M jobs to be processed. Two processors are specified to each job. To process the job, the job should be all...

2020-01-14 21:38:00

阅读数 36

评论数 0

提示
确定要删除当前文章?
取消 删除