- 博客(60)
- 收藏
- 关注
原创 【Tarjan缩点+贪心】HDU - 1827 I - Summer Holiday
I - Summer Holiday HDU - 1827 To see a World in a Grain of Sand And a Heaven in a Wild Flower, Hold Infinity in the palm of your hand And Eternity in an hour. —— William Blake ...
2018-08-31 01:03:05 247
原创 【Tarjan+SPFA】POJ - 3114 G - Countries in War
G - Countries in War POJ - 3114 In the year 2050, after different attempts of the UN to maintain peace in the world, the third world war broke out. The importance of industrial, commercial and milit...
2018-08-30 23:10:35 192
原创 【Tarjan求汇点】POJ - 2553 F - The Bottom of a Graph
F - The Bottom of a Graph POJ - 2553e will use the following (standard) definitions from graph theory. Let V be a nonempty and finite set, its elements being called vertices (or nodes). Let E be a s...
2018-08-30 02:14:56 143
原创 【LCA离线算法Tarjan】POJ - 1330 D - Nearest Common Ancestors
D - Nearest Common Ancestors POJ - 1330A rooted tree is a well-known data structure in computer science and engineering. An example is shown below: In the figure, each node is labeled with an inte...
2018-08-30 01:43:50 110
原创 【强联通分量缩点+二分图思想】 POJ - 1904 C - King's Quest
C - King's Quest POJ - 1904 Once upon a time there lived a king and he had N sons. And there were N beautiful girls in the kingdom and the king knew about each of his sons which of those girls he d...
2018-08-29 12:07:55 154
原创 【Tarjan缩点+缩点后的入度出度】POJ - 1236 B - Network of Schools
B - Network of Schools POJ - 1236A number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools to which it dis...
2018-08-28 22:01:20 125
原创 【并查集 基环树】 Educational Codeforces Round 49 (Rated for Div. 2) D. Mouse Hunt
D. Mouse Hunttime limit per test 2 seconds memory limit per test 256 megabytesMedicine faculty of Berland State University has just finished their admission campaign. As usual, ...
2018-08-28 15:52:49 170
原创 【强连通分量缩点 经典好题】POJ - 2186 A - Popular Cows
A - Popular Cows POJ - 2186 Every cow's dream is to become the most popular cow in the herd. In a herd of N (1 <= N <= 10,000) cows, you are given up to M (1 <= M <= 50,000) ordered pai...
2018-08-23 15:36:14 209
原创 【强联通分量有向图模板】
#include<cstdio>#include<cstring>#include<algorithm>using namespace std;const int maxn=20010;const int maxm=50010;struct edge{ int to,nxt;}edge[maxm];int head[maxn],tot;...
2018-08-23 11:12:50 97
原创 【java大数模板+C++2的n次方模板】hdu 2018 多校第十场 Problem H. Pow hdu 6433
Problem H. PowTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 0 Accepted Submission(s): 0Problem DescriptionThere are n numbers 3^0,...
2018-08-22 20:28:32 251
原创 【公式题+打表】hdu 2018 多校第十场 1007 Problem G. Cyclic hdu 6432
Problem G. Cyclic Problem DescriptionCount the number of cyclic permutations of length n with no continuous subsequence [i, i + 1 mod n].Output the answer modulo 998244353.InputThe first line...
2018-08-22 20:24:13 744 1
原创 【概率dp+状压】HDU - 4336 E - Card Collector
E - Card Collector HDU - 4336In your childhood, do you crazy for collecting the beautiful cards in the snacks? They said that, for example, if you collect all the 108 people in the famous novel Wate...
2018-08-21 21:35:54 150
原创 【概率dp+位运算判相邻小技巧】POJ - 3071 D - Football
D - Football POJ - 3071 Consider a single-elimination football tournament involving 2n teams, denoted 1, 2, …, 2n. In each round of the tournament, all teams still in the tournament are placed in a...
2018-08-21 14:02:58 212
原创 【概率dp求期望】POJ - 2096 C - Collecting Bugs
C - Collecting Bugs POJ - 2096 Ivan is fond of collecting. Unlike other people who collect post stamps, coins or other material stuff, he collects software bugs. When Ivan gets a new program, he cl...
2018-08-21 11:20:23 163
原创 【概率dp】HDU - 3853 A - LOOPS
A - LOOPS HDU - 3853 Akemi Homura is a Mahou Shoujo (Puella Magi/Magical Girl). Homura wants to help her friend Madoka save the world. But because of the plot of the Boss Incubator, she is trapped...
2018-08-20 21:08:18 154
原创 【乱推公式】 hdu 2018 多校第九场 1004 Rikka with Stone-Paper-Scissors hdu 6418
Rikka with Stone-Paper-ScissorsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 1 Accepted Submission(s): 1 Problem DescriptionDid y...
2018-08-20 19:40:35 449
原创 【快速幂+组合】hdu 2018 多校第九场 1011 Rikka with Badminton hdu6425
Rikka with BadmintonTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 53 Accepted Submission(s): 44Problem DescriptionIn the last seme...
2018-08-20 19:36:42 307 4
原创 【dp+组合数学】hdu 2018 多校第九场 1001 Rikka with Nash Equilibrium hdu 6415
Rikka with Nash EquilibriumTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 0 Accepted Submission(s): 0Problem DescriptionNash Equil...
2018-08-20 19:27:25 520
原创 【数位dp+状态压缩】HDU - 4352 B - XHXJ's LIS
B - XHXJ's LIS HDU - 4352 #define xhxj (Xin Hang senior sister(学姐)) If you do not know xhxj, then carefully reading the entire description is very important. As the strongest fighting force in UES...
2018-08-19 17:13:13 107
原创 【数位dp+计算平方和+恶心又好】HDU - 4507 J - 吉哥系列故事――恨7不成妻
J - 吉哥系列故事――恨7不成妻 HDU - 4507 单身! 依然单身! 吉哥依然单身! DS级码农吉哥依然单身! 所以,他生平最恨情人节,不管是214还是77,他都讨厌! 吉哥观察了214和77这两个数,发现: 2+1+4=7 7+7=7*2 77=7*11 最终,他发现原来这一切归根到底都是因为和7有关!所以,他现在甚...
2018-08-19 10:47:04 187
原创 【数位dp+状态压缩成三进制】SPOJ - BALNUM K - Balanced Numbers
K - Balanced Numbers SPOJ - BALNUMBalanced numbers have been used by mathematicians for centuries. A positive integer is considered a balanced number if:1) Every even digit appears an odd nu...
2018-08-18 19:25:40 242 1
原创 【数位dp】 HDU - 3709 F - Balanced Number
F - Balanced Number HDU - 3709A balanced number is a non-negative integer that can be balanced if a pivot is placed at some digit. More specifically, imagine each digit as a box with weight indicate...
2018-08-18 17:51:35 216
原创 【数位dp 离散化】CodeForces - 55D A - Beautiful numbers
A - Beautiful numbers CodeForces - 55D Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if and only if it is divisible by each of i...
2018-08-18 13:36:40 160
原创 【数位dp 好题】HDU - 4734 H - F(x)
H - F(x) HDU - 4734 For a decimal number x with n digits (A nA n-1A n-2 ... A 2A 1), we define its weight as F(x) = A n * 2 n-1 + A n-1 * 2 n-2 + ... + A 2 * 2 + A 1 * 1. Now you are given two numb...
2018-08-16 22:11:51 382
原创 【数位dp】POJ - 3252 E - Round Numbers
E - Round Numbers POJ - 3252 The cows, as you know, have no fingers or thumbs and thus are unable to play Scissors, Paper, Stone' (also known as 'Rock, Paper, Scissors', 'Ro, Sham, Bo', and a host o...
2018-08-16 20:58:40 119
原创 【数位dp】 HDU - 3652 G - B-number
G - B-number HDU - 3652 A wqb-number, or B-number for short, is a non-negative integer whose decimal form contains the sub- string "13" and can be divided by 13. For example, 130 and 2613 are wqb-n...
2018-08-16 18:58:00 260
原创 【数位dp】 HDU - 3555 D - Bomb
D - Bomb HDU - 3555 The counter-terrorists found a time bomb in the dust. But this time the terrorists improve on the time bomb. The number sequence of the time bomb counts from 1 to N. If the curre...
2018-08-16 13:42:59 166
原创 【数位dp】HDU - 2089 C - 不要62
C - 不要62 HDU - 2089杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。 杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。 不吉利的数字为所有含有4或62的号码。例如: 62315 73418 88914 都属于不吉利号码。但是,61152虽然含有6...
2018-08-16 10:36:09 115
原创 【拆点+最大流】HDU - 2732 K - Leapin' Lizards
K - Leapin' Lizards HDU - 2732Your platoon of wandering lizards has entered a strange room in the labyrinth you are exploring. As you are looking around for hidden treasures, one of the rookies ste...
2018-08-14 19:30:35 148
原创 fread 输入挂模板 + 用法
//fread 输入挂模板namespace fastIO { #define BUF_SIZE 100000 //fread -> read bool IOerror = 0; inline char nc() { static char buf[BUF_SIZE], *p1 = buf + BUF_SIZE, *pend = buf +...
2018-08-14 14:31:25 777
原创 【最短路Dijstla+最大流Dinic】HDU - 3416 O - Marriage Match IV
O - Marriage Match IV HDU - 3416 Do not sincere non-interference。 Like that show, now starvae also take part in a show, but it take place between city A and B. Starvae is in city A and girls are i...
2018-08-14 14:29:08 265
原创 【输入挂模板fread+pair】HDU 多校第七场 1011 Swordsman
SwordsmanTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 860 Accepted Submission(s): 248Problem DescriptionLawson is a magic swordsm...
2018-08-13 23:55:56 222
原创 【最大流Dinic】HDU - 3605 M - Escape
M - Escape 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 stars, who can live, but some people do not fit to live some of the ...
2018-08-12 21:29:41 106
原创 【并查集】 百度之星 2018 初赛B 1001 degree
degreeProblem Description度度熊最近似乎在研究图论。给定一个有 N 个点 (vertex) 以及 M 条边 (edge) 的无向简单图 (undirected simple graph),此图中保证没有任何圈 (cycle) 存在。现在你可以对此图依序进行以下的操作:移除至多 K 条边。 在保持此图是没有圈的无向简单图的条件下,自由的添加边至此图中。请问...
2018-08-12 21:13:38 103
原创 【二分+判断】百度之星 2018 初赛B 1004 p1m2
p1m2Problem Description度度熊很喜欢数组!!我们称一个整数数组为稳定的,若且唯若其同时符合以下两个条件:数组里面的元素都是非负整数。 数组里面最大的元素跟最小的元素的差值不超过 1。举例而言,[1, 2, 1, 2][1,2,1,2] 是稳定的,而 [-1, 0, -1][−1,0,−1] 跟 [1, 2, 3][1,2,3] 都不是。现在,定义一个在...
2018-08-12 21:10:37 158
原创 【最小割输出路径】 UVA - 10480 J - Sabotage
J - Sabotage UVA - 10480 SabotageThe regime of a small but wealthy dictatorship has been abruptly overthrown by an unexpected rebellion. Because of the enormous disturbances this is causing in wo...
2018-08-12 21:00:02 243
原创 【最小割最大流Dinic】 HDU - 4289 I - Control
I - Control HDU - 4289 You, the head of Department of Security, recently received a top-secret information that a group of terrorists is planning to transport some WMD 1 from one city (the source...
2018-08-12 19:16:14 192
原创 【最大流Dinic和ISAP比较】HDU - 4280 G - Island Transport
G - Island Transport HDU - 4280 In the vast waters far far away, there are many islands. People are living on the islands, and all the transport among the islands relies on the ships. You ha...
2018-08-12 13:48:05 338
原创 【最大流Dinic】POJ - 1459 F - Power Network
F - Power Network POJ - 1459 A power network consists of nodes (power stations, consumers and dispatchers) connected by power transport lines. A node u may be supplied with an amount s(u) >= 0 o...
2018-08-12 12:05:33 197
原创 【k次最小费用流】 POJ - 2516 E - Minimum Cost
E - Minimum Cost POJ - 2516Dearboy, a goods victualer, now comes to a big problem, and he needs your help. In his sale area there are N shopkeepers (marked from 1 to N) which stocks goods from him.D...
2018-08-11 13:10:22 148
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人