上一页 1 2 3 4 5 6 7 ··· 11 下一页
摘要: 题目:给你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 小小泽 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 想法: 將問題簡化為求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 小小泽 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 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 小小泽 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 题目大意:给出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 小小泽 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 題目意思:讀取一數字,此數字最大有1000位。計算該數字是否為九的倍數?如是,再計算其階層數。 ※判斷是否為九的倍數:所有位數相加 ÷ 9=0,即為九的倍數。 ※計算階層數:所有位數相加後得出的第一個總和為一階,依此類推直到該數字無法再計算總和。 Example 1: 999 => 27(9+9+... 阅读全文
posted @ 2016-01-23 12:05 小小泽 阅读(269) 评论(0) 推荐(0) 编辑
摘要: 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 小小泽 阅读(348) 评论(0) 推荐(0) 编辑
摘要: 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 小小泽 阅读(412) 评论(0) 推荐(0) 编辑
摘要: 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 小小泽 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 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 小小泽 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 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 小小泽 阅读(217) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 11 下一页