会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
初见
解题是一种本领,就像游泳,滑雪,弹钢琴一样,你只能够靠模仿和实践才能学到它。 ——《数学的发现》波利亚
博客园
首页
新随笔
联系
管理
订阅
上一页
1
2
3
4
5
6
7
···
11
下一页
2016年1月24日
uva 101 - The Blocks Problem
摘要: 题目:给你n个方块,有四种操作: 1.move a onto b,把a和b上面的方块都放回原来位置,然后把a放到b上面; 2.move a over b,把a上面的放回原处,然后把a放在b所在的方块堆的上面; 3.pile a onto b,把b上面的放回原来位置,然后把a所在的堆...
阅读全文
posted @ 2016-01-24 17:36 小小泽
阅读(110)
评论(0)
推荐(0)
2016年1月23日
uva 11038 - How Many O's?
摘要: 想法: 將問題簡化為求1~m 0的總數,以及1~n 0的總數,然後最後再相減。 求1~n 0的總數,要將n分別算每個位數0的個數,舉例如30324:先從右邊第一位'4'開始,其左邊為3032,表示1~30320在"第一位"總共有3032*1=3032個0換第二位數'2',其左邊為303,表示總共...
阅读全文
posted @ 2016-01-23 17:32 小小泽
阅读(183)
评论(0)
推荐(0)
uva 498 - Polly the Polynomial
摘要: UVa 498: Polly the Polynomial | MathBlog 1 #include 2 #include 3 using namespace std; 4 5 int temp, c[10000]; 6 7 int main() 8 { 9 int n;10 ...
阅读全文
posted @ 2016-01-23 15:09 小小泽
阅读(239)
评论(0)
推荐(0)
uva 10609 - Fractal
摘要: 题目大意:给出A,B两个点的坐标,以及T,每次找到A、B的四等分点C,D,然后以AB/2为边长,C,D为顶点,构建一个等边三角形,E为另外一个顶点,然后再对C,E;E,D做同样的操作,直到构建的等边三角形的边长小于T时。输出所有过程中的点,按照x坐标排序,相同的按照y坐标。解题思路:dfs模拟,用a...
阅读全文
posted @ 2016-01-23 13:52 小小泽
阅读(253)
评论(0)
推荐(0)
uva 10922 - 2 the 9s
摘要: 題目意思:讀取一數字,此數字最大有1000位。計算該數字是否為九的倍數?如是,再計算其階層數。 ※判斷是否為九的倍數:所有位數相加 ÷ 9=0,即為九的倍數。 ※計算階層數:所有位數相加後得出的第一個總和為一階,依此類推直到該數字無法再計算總和。 Example 1: 999 => 27(9+9+...
阅读全文
posted @ 2016-01-23 12:05 小小泽
阅读(285)
评论(0)
推荐(0)
2016年1月21日
uva 10212 - The Last Non-zero Digit.
摘要: 1 #include 2 #define ll long long 3 4 const ll MOD = 1e9; 5 6 int main() 7 { 8 ll N, M; 9 while(scanf("%lld%lld", &N, &M) != EOF)10 {1...
阅读全文
posted @ 2016-01-21 18:37 小小泽
阅读(362)
评论(0)
推荐(0)
uva 10994 - Simple Addition
摘要: 1 //组合数学 2 //计算sum{i从右往左数的第一个非0数字,p 4 typedef long long ll; 5 6 ll sum(ll n) 7 { 8 ll ans = 0, x; 9 while(n)10 {11 x = n % 10;12...
阅读全文
posted @ 2016-01-21 12:59 小小泽
阅读(425)
评论(0)
推荐(0)
2016年1月20日
uva 371 - Ackermann Functions
摘要: 1 #include 2 3 int main() 4 { 5 long int F, S, I, Count, Value, Max, J; 6 while(scanf("%ld %ld", &F, &S) && F) 7 { 8 if(F > S) ...
阅读全文
posted @ 2016-01-20 13:12 小小泽
阅读(185)
评论(0)
推荐(0)
uva 100 - The 3n + 1 problem
摘要: 1 #include 2 #include 3 using namespace std; 4 5 void print(int i, int j) 6 { 7 if(i > j) { int temp = i; i = j; j = temp; } 8 9 int max ...
阅读全文
posted @ 2016-01-20 02:07 小小泽
阅读(134)
评论(0)
推荐(0)
uva 759 - The Return of the Roman Empire
摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 const int SIZE = 13; 7 const int value[] = {1, 4, 5, 9, 10, 40, 50, 90, 100, 400, 500...
阅读全文
posted @ 2016-01-20 01:21 小小泽
阅读(229)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
···
11
下一页
公告