
ACM__数学
文章平均质量分 73
Element-YoNg
每天晚上疲劳的睡在床上时,才感觉真真切切地过了一天。压力不是有人比你努力,而是比你牛逼几倍的人依然比你努力。即使看不到未来,也依然相信,自己选的人生错不了。第二天叫醒我的不是闹钟,其实,还是梦想。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU 2132 An easy problem
Problem DescriptionWe once did a lot of recursional problem . I think some of them is easy for you and some if hard for you.Now there is a very easy problem . I think you can AC it. We ca原创 2014-04-15 19:45:40 · 883 阅读 · 0 评论 -
Codeforces Round #305 (Div. 2) C. Mike and Frog
链接 :http://codeforces.com/contest/548/problem/C首先分别找出两个序列的循环节 和 循环节的起始位置,如果找到了循环节 终点却没有出现,那么进入循环节终点再也不能出现了。如果在循环节内 我的做法就是算m次之后的每个值,在循环节之前就只有一个值。#include #include #include #include原创 2015-05-27 15:54:36 · 628 阅读 · 0 评论 -
ZOJ 3593 One Person Game (扩展欧几里得)
There is an interesting and simple one person game. Suppose there is a number axis under your feet. You are at pointA at first and your aim is point B. There are 6 kinds of operations you can perfor原创 2015-05-06 01:52:07 · 646 阅读 · 0 评论 -
ZOJ 3868 GCD Expectation 和 BC39 HDU 5212 Code
这两道题目的类型感觉是一样的 都是利用了容斥的思想 从后往前推然后去重。HDU 5212 题意 :给n个数 求出每个数与这n个数分别F(i)的和, F(i) = gcd(a[i], a[j]) * (gcd(a[i], a[j]) - 1).可以这样考虑 ai与aj互质的时候F()的值是等于0 没必要计算。只要计算以i为gcd的所有的数对的个数 就好了 (1#include原创 2015-04-27 20:04:58 · 649 阅读 · 0 评论 -
求出所有的正整数对 使他们最大公约数为n,最小公倍数为m
题目大概是这样的:点击打开链接大意就是 求出所有的正整数对 使他们最大公约数为n,最小公倍数为m。(1 可以将问题转化为 : 设a,b就是那个整数对,n, a, b, m, 这4个数都是可以被n整除的,可以都除以n, 题目转化为求出 最大公约数为1, 最小公倍数为m/n的对数 。也就是求出在1到m/n里 乘积为m/n且互质的对数。可以在O(sqrt (m/n) )内解决。原创 2015-03-18 20:35:14 · 957 阅读 · 0 评论 -
Codeforces Round #271 (Div. 2) D. Flowers (递推 预处理)
We saw the little game Marmot made for Mole's lunch. Now it's Marmot's dinner time and, as we all know, Marmot eats flowers. At every dinner he eats some red and white flowers. Therefore a dinner can原创 2014-10-08 14:56:41 · 762 阅读 · 0 评论 -
UVa 679 - Dropping Balls
A number of K balls are dropped one by one from the root of a fully binary tree structure FBT. Each time the ball being dropped first visits a non-terminal node. It then keeps moving down, either foll原创 2014-09-28 12:17:12 · 758 阅读 · 0 评论 -
HDU 2045 不容易系列之(3)—— LELE的RPG难题
Problem Description人称“AC女之杀手”的超级偶像LELE最近忽然玩起了深沉,这可急坏了众多“Cole”(LELE的粉丝,即"可乐"),经过多方打探,某资深Cole终于知道了原因,原来,LELE最近研究起了著名的RPG难题:有排成一行的n个方格,用红(Red)、粉(Pink)、绿(Green)三色涂每个格子,每格涂一色,要求任何相邻的方格不能同色,且首尾两格也不同色.原创 2014-09-22 23:32:30 · 578 阅读 · 0 评论 -
Codeforces Round #250 (Div. 2) C. The Child and Toy 详解
outputstandard outputOn Children's Day, the child got a toy from Delayyy as a present. However, the child is so naughty that he can't wait to destroy the toy.The toy consists of n parts and原创 2014-09-23 01:00:22 · 1444 阅读 · 0 评论 -
Uva 11489 - Integer Game
Two players, S and T, are playing a game where they make alternate moves. S plays first. In this game, they start with an integer N. In each move, a player removes one digit from the integer and p原创 2014-06-09 21:52:49 · 672 阅读 · 0 评论 -
扩展欧几里得求最小非负整数解 (POJ 1061 青蛙约会为例)
Description两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对方的。但是除非这两只青蛙在同一时间跳到同一点上,不然是永远都不可能碰面原创 2014-05-23 11:30:47 · 1436 阅读 · 0 评论 -
求数论求约数和 与 互质和算法 (分解质因数与欧拉函数)
DescriptionOne day, Qz met an easy problem. But after a 5-hout-long contest in CSU, he became very tired and he wanted to call his girlfriend as soon as possible. As we all know, Qz is a genius in原创 2014-05-22 00:08:13 · 1539 阅读 · 0 评论 -
Binary System
DescriptionUsually we use number in the decimal system, for it is so convenient for us to remember and calculate.But it is not the same in the computer world where numbers are always stored in the原创 2014-04-25 01:25:21 · 1360 阅读 · 0 评论 -
HDU 2274 Magic WisKey
Problem DescriptionOn New Year Festival, Liu Qian’s magic impressed on little WisKey’s heart and he wants to learn some magic to make himself stronger. One day, he met a cowman named LinLe. Lin原创 2014-04-23 14:01:34 · 882 阅读 · 0 评论 -
HDU 2132 An easy problem
Problem DescriptionWe once did a lot of recursional problem . I think some of them is easy for you and some if hard for you.Now there is a very easy problem . I think you can AC it. We can de原创 2014-04-23 14:07:59 · 758 阅读 · 0 评论 -
HDU 4497 GCD and LCM (分解质因数)
链接 :http://acm.hdu.edu.cn/showproblem.php?pid=4497如果G不是L的约数 就不可能找到三个数。L的所有素因子一定包含G的所有素因子 并且次方数一定大于等于G的。只需要三个数 对于每一个素因子的次方数 三个的最小值是G的,最大值是L的。考虑三个对应的次方数都不一样,那么其中两个是确定的 一个是G的一个是L的 剩下的一个在G和L的之间。原创 2015-06-03 14:14:05 · 650 阅读 · 0 评论