随笔分类 - 数学
摘要:Consider a network G=(V,E) G=(V,E) with source s s and sink t t . An s-t cut is a partition of nodes set V V into two parts such that s s and t t belo
阅读全文
摘要:Given you a sequence of number a 1, a 2, ..., a n, which is a permutation of 1...n. You need to answer some queries, each with the following format: G
阅读全文
摘要:The math department has been having problems lately. Due to immense amount of unsolicited automated programs which were crawling across their pages, t
阅读全文
摘要:一个包含四个点的完全图,可以在任意节点出发,可以在任意节点结束,给出每个点被经过的次数,求有多少种合法的遍历序列。如果两个序列至少有一位是不同的,则认为它们不相同。 Input Sample Output 题意:给a个A,b个B,c个C,d个D,求有少种排列,使得相邻的两个不同。 思路:用容斥来做,
阅读全文
摘要:There is a nonnegative integer sequence a 1...n a1...n of length n n . HazelFan wants to do a type of transformation called prefix-XOR, which means a
阅读全文
摘要:XOR is a kind of bit operator, we define that as follow: for two binary base number A and B, let C=A XOR B, then for each bit of C, we can get its val
阅读全文
摘要:题意:给出N,K,M,P。求有多少长度为K的序列A,满足:(1)首项为正整数;(2)递增数列;(3)相邻两项的差小于等于m;(4)最后一个数小于等于N。 思路:根据差分来算数量。
阅读全文
摘要:A cellular automaton is a collection of cells on a grid of specified shape that evolves through a number of discrete time steps according to a set of
阅读全文
摘要:JRY wants to drag racing along a long road. There are nn sections on the road, the ii-th section has a non-negative integer length sisi. JRY will choo
阅读全文
摘要:There are well-known formulas: , , . Also mathematicians found similar formulas for higher degrees. Find the value of the sum modulo 109 + 7 (so you s
阅读全文
摘要:Tiny Wong the chef used to be a mathematics teacher in a senior high school. At that time, he always used to tell his students that when there is a sq
阅读全文
摘要:Let's call a non-empty sequence of positive integers a1, a2... ak coprime if the greatest common divisor of all elements of this sequence is equal to
阅读全文
摘要:You are given n points on Cartesian plane. Every point is a lattice point (i. e. both of its coordinates are integers), and all points are distinct. Y
阅读全文
摘要:Little Petya likes to draw. He drew N red and M blue points on the plane in such a way that no three points lie on the same line. Now he wonders what
阅读全文
摘要:题意:给定N个点,用矩形将所有点覆盖,要求矩形宽度最小。 思路:裸体,旋转卡壳去rotate即可。 最远距离是点到点;宽度是点到边。
阅读全文
摘要:You are given n points with integer coordinates on the plane. Points are given in a way such that there is no triangle, formed by any three of these n
阅读全文
摘要:Given n distinct points on a plane, your task is to find the triangle that have the maximum area, whose vertices are from the given points. Input The
阅读全文
摘要:Bessie, Farmer John's prize cow, has just won first place in a bovine beauty contest, earning the title 'Miss Cow World'. As a result, Bessie will mak
阅读全文
摘要:Count the number of distinct sequences a1, a2, ..., an (1 ≤ ai) consisting of positive integers such that gcd(a1, a2, ..., an) = x and . As this numbe
阅读全文
摘要:Lakhesh loves to make movies, so Nephren helps her run a cinema. We may call it No. 68 Cinema. However, one day, the No. 68 Cinema runs out of changes
阅读全文

浙公网安备 33010602011771号