摘要:题目: 描述 给定一张N个点M条边的有向无环图,分别统计从每个点出发能够到达的点的数量。N,M≤30000。 输入格式 第一行两个整数N,M,接下来M行每行两个整数x,y,表示从x到y的一条有向边。 输出格式 共N行,表示每个点能够到达的点的数量。 样例输入 10 10 3 8 2 3 2 5 5
阅读全文
摘要:Ultra-QuickSort Time Limit: 7000MS Memory Limit: 65536K Total Submissions: 80412 Accepted: 30110 Description In this problem, you have to analyze a pa
阅读全文
摘要:内容来源《算法竞赛进阶指南》date of submission:20191121tags:归排description modelling:你一定玩过八数码游戏,它实际上是在一个3*3的网格中进行的,1个空格和1~8这8个数字恰好不重不漏地分布在这3*3的网格中。例如:5 2 81 3 _4 6 7
阅读全文
摘要:Moscow is hosting a major international conference, which is attended by n scientists from different countries. Each of the scientists knows exactly o
阅读全文
摘要:Best Cow Fences Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 16945 Accepted: 5425 Description Farmer John's farm consists of a long row
阅读全文
摘要:0304 IncDec Sequence 0x00「基本算法」例题 描述 给定一个长度为 n(n≤10^5 ) 的数列 {a_1,a_2,…,a_n},每次可以选择一个区间 [l,r],使下标在这个区间内的数都加一或者都减一。 求至少需要多少次操作才能使数列中的所有数都一样,并求出在保证最少次数的前
阅读全文
摘要:Tallest Cow Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 5425 Accepted: 2500 Description FJ's N (1 ≤ N ≤ 10,000) cows conveniently index
阅读全文
摘要:To the Max Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 56579 Accepted: 29921 Description Given a two-dimensional array of positive and
阅读全文
摘要:激光炸弹 HYSBZ - 1218Time limit:10000 msMemory limit:165888 kBOS:LinuxSource:HNOI2003 一种新型的激光炸弹,可以摧毁一个边长为R的正方形内的所有的目标。现在地图上有n(N<=10000)个目标,用整数Xi,Yi(其值在[0,
阅读全文
摘要:Counting Cliques HDU - 5952 OJ-ID: hdu-5952author:Caution_Xdate of submission:20191110tags:dfs,graphdescription modelling:给定点数,边数,问包含有x个点的完全图种类数major
阅读全文
摘要:Nearest Common Ancestors POJ - 1330 A rooted tree is a well-known data structure in computer science and engineering. An example is shown below: In th
阅读全文
摘要:E - Long Jumps CodeForces - 479D Valery is a PE teacher at a school in Berland. Soon the students are going to take a test in long jumps, and Valery h
阅读全文
摘要:Nearest Common Ancestors Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 39816 Accepted: 19722 Description A rooted tree is a well-known da
阅读全文
摘要:E - One-Dimensional Battle Ships CodeForces - 567D Alice and Bob love playing one-dimensional battle ships. They play on the field in the form of a li
阅读全文
摘要:K - Vanya and Scales CodeForces - 552C Vanya has a scales for weighing loads and weights of masses w0, w1, w2, ..., w100 grams where w is some integer
阅读全文
摘要:C - King Arthur's Birthday Celebration POJ - 3682 King Arthur is an narcissist who intends to spare no coins to celebrate his coming K-th birthday. Th
阅读全文
摘要:D - Ugly Problem HDU - 5920 Everyone hates ugly problems. You are given a positive integer. You must represent that number by sum of palindromic numbe
阅读全文
摘要:Recently, Valery have come across an entirely new programming language. Most of all the language attracted him with template functions and procedures.
阅读全文
摘要:A - A Simple Math Problem HDU - 5974 Given two positive integers a and b,find suitable X and Y to meet the conditions: X+Y=a Least Common Multiple (X,
阅读全文
摘要:Beautiful Now HDU - 6351 Anton has a positive integer n, however, it quite looks like a mess, so he wants to make it beautiful after k swaps of digits
阅读全文