数学
文章平均质量分 81
i-unique
擅长各种姿势划水
展开
-
POJ 2886 Who Gets the Most Candies?(反素数+数学推导+模拟+线段树||树状数组+二分)
N children are sitting in a circle to play a game. The children are numbered from 1 to N in clockwise order. Each of them has a card with a non-zero integer on it in his/her hand. The game starts from the K-th child, who tells all the others the integer on原创 2017-08-09 17:33:47 · 429 阅读 · 0 评论 -
CodeForces 185A Plant(公式推导+快速幂)
Dwarfs have planted a very interesting plant, which is a triangle directed "upwards". This plant has an amusing feature. After one year a triangle plant directed "upwards" divides into four triangle plants: three of them will point "upwards" and one will p原创 2017-12-26 21:47:20 · 349 阅读 · 0 评论 -
Codeforces 151C Quantity of Strings(快速幂+数学分情况)
Just in case somebody missed it: this winter is totally cold in Nvodsk! It is so cold that one gets funny thoughts. For example, let's say there are strings with the length exactly n, based on the alphabet of size m. Any its substring with length equal to原创 2017-12-07 22:59:24 · 333 阅读 · 0 评论 -
CodeForces 150A Win or Freeze(素筛+分情况)
You can't possibly imagine how cold our friends are this winter in Nvodsk! Two of them play the following game to warm up: initially a piece of paper has an integer q. During a move a player should write any integer number that is a non-trivialdivisor of t原创 2017-12-07 22:53:02 · 407 阅读 · 0 评论 -
SPOJ PROOT Primitive Root (数学找规律)
PROOT - Primitive Root原创 2017-12-03 22:46:33 · 443 阅读 · 0 评论 -
UVa 11401 Triangle Countin(找规律)
Triangle Counting Input: Standard Input Output: Standard Output You are given n rods of length 1, 2…, n. You have to pick any 3 of them & build a triangle. How many distinct triangle原创 2017-12-03 22:39:41 · 263 阅读 · 0 评论 -
CodeForces 165C Another Problem on Strings(公式推导)
A string is binary, if it consists only of characters "0" and "1". String v is a substring of string w if it has a non-zero length and can be read starting from some position in string w. For example, string "010" has six substrings: "0", "1", "0", "01", "原创 2017-12-19 22:45:55 · 512 阅读 · 0 评论 -
Codeforces Round #431 (Div. 2) B. Tell Your World(技巧性模拟+精度坑死人系列)
Connect the countless points with lines, till we reach the faraway yonder. There are n points on a coordinate plane, the i-th of which being (i, yi). Determine whether it's possible to draw two parallel and non-overlapping lines, such that every point in原创 2017-09-02 20:16:46 · 363 阅读 · 0 评论 -
Codeforces Round #431 (Div. 2) A. Odds and Ends(找规律)
Where do odds begin, and where do they end? Where does hope emerge, and will they ever break? Given an integer sequence a1, a2, ..., an of length n. Decide whether it is possible to divide it into an odd number of non-empty subsegments, the each of which原创 2017-09-02 11:52:35 · 474 阅读 · 0 评论 -
LightOJ 1052 String Growth(数学递推+矩阵快速幂求斐波拉契数列)
Zibon just started his courses in Computer science. After having some lectures on programming courses he fell in love with strings. He started to play with strings and experiments on them. One day he started a string of arbitrary (of course positive) lengt原创 2017-09-01 21:42:33 · 395 阅读 · 0 评论 -
2017 ACM-ICPC 亚洲区(西安赛区)网络赛 C.Sum(找规律)
Define the function S(x)S(x) for xx is a positive integer. S(x)S(x) equals to the sum of all digit of the decimal expression of xx. Please find a positive integer kk that S(k*x)\%233=0S(k∗x)%233=0.原创 2017-09-16 17:49:33 · 796 阅读 · 0 评论 -
模板总结
属于自己的模板。。。比赛防忘记赛前复习向原创 2017-07-24 10:25:30 · 1551 阅读 · 1 评论 -
Codeforces Round #432 (Div. 2) B. Arpa and an exam about geometry(数学水题)
Arpa is taking a geometry exam. Here is the last problem of the exam. You are given three points a, b, c. Find a point and an angle such that if we rotate the page around the point by the angle, the new position of a is the same as the old position of b,原创 2017-09-04 23:28:08 · 1103 阅读 · 4 评论 -
CCPC网赛 CaoHaha's staff(找规律+模拟扩展正方形)
"You shall not pass!" After shouted out that,the Force Staff appered in CaoHaha's hand. As we all know,the Force Staff is a staff with infinity power.If you can use it skillful,it may help you to do whatever you want. But now,his new owner,CaoHaha,is a原创 2017-08-19 21:07:48 · 751 阅读 · 0 评论 -
WUST I could run!(素数筛法+欧拉函数的运用+稍微的递推)
ahm001 is running a function but always get TLE. long long calc (int n){ long long res=0; for(int i=1;i<=n;i++) for(int j=i+1;j<=n;j++) { if (gcd(i,j)==1) res+=j; } return res; } But he just can't get an AC. Can you help him?原创 2017-07-09 13:24:17 · 386 阅读 · 0 评论 -
HDU 2152 Fruit (母函数+模板)
转眼到了收获的季节,由于有TT的专业指导,Lele获得了大丰收。特别是水果,Lele一共种了N种水果,有苹果,梨子,香蕉,西瓜……不但味道好吃,样子更是好看。 于是,很多人们慕名而来,找Lele买水果。 甚至连大名鼎鼎的HDU ACM总教头 lcy 也来了。lcy抛出一打百元大钞,"我要买由M个水果组成的水果拼盘,不过我有个小小的要求,对于每种水果,个数上我有限制,既不能少于某个特定值,也不能大于某个特定值。而且我不要两份一样的拼盘。你随意搭配,你能组出多少种不同的方案,我就买多少份!" 现在就原创 2017-07-12 08:31:37 · 564 阅读 · 0 评论 -
UVa 3882 And Then There Was One(stl+有技巧的模拟||数学方法+约瑟夫问题)
Let’s play a stone removing game. Initially, n stones are arranged on a circle and numbered 1, …, n clockwise (Figure 1). You are also given two numbers k and m. From this state, remove stones one by one following the rules explained below, until only one原创 2017-08-09 10:47:47 · 657 阅读 · 0 评论 -
CodeForces 195D. Analyzing Polyline(stl)
As Valeric and Valerko were watching one of the last Euro Championship games in a sports bar, they broke a mug. Of course, the guys paid for it but the barman said that he will let them watch football原创 2018-01-02 22:11:21 · 327 阅读 · 0 评论