自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

wood

本搏客已经停更,新地址:https://cbwood.github.io/

  • 博客(54)
  • 资源 (5)
  • 收藏
  • 关注

原创 UVA 11426 GCD - Extreme (II)

题目链接:点我题意:给你一个数n,求前n个数中任意两个数的 最小公倍数的和,思路:我们知道gcd(i, x) = t 可以得到gcd( i / t, x / t) = 1,所以我们只需要求与其互质对的数的个数,如何乘以i就可以了. 代码:#include<cstdio>#include<algorithm>#include<cstring>#include<cmath>#include<i

2017-07-29 15:49:17 197

原创 LightOJ 1138 Trailing Zeroes (III)

题目链接:点我You task is to find minimal natural number N, so that N! contains exactly Q zeroes on the trail in decimal notation. As you know N! = 1*2*...*N. For example, 5! = 120, 120 contains one zero on t

2017-07-29 11:42:40 305

原创 LightOJ 1197 Help Hanzo

题目链接:点我Amakusa, the evil spiritual leader has captured the beautiful princess Nakururu. The reason behind this is he had a little problem with Hanzo Hattori, the best ninja and the love of Nakururu. Af

2017-07-29 11:18:35 287

原创 LightOJ 1213 Fantasy of a Summation

题目链接:点我If you think codes, eat codes then sometimes you may get stressed. In your dreams you may see huge codes, as I have seen once. Here is the code I saw in my dream.#include <stdio.h>int cases, cas

2017-07-29 11:05:57 309

原创 LightOJ 1214 Large Division

题目链接:点我Given two integers, a and b, you should check whether a is divisible by b or not. We know that an integer a is divisible by an integer b if and only if there exists an integer c such that a = b

2017-07-29 10:50:31 232

原创 LightOJ 1220 Mysterious Bacteria

题目链接:点我Dr. Mob has just discovered a Deathly Bacteria. He named it RC-01. RC-01 has a very strange reproduction system. RC-01 lives exactly x days. Now RC-01 produces exactly p new deadly Bacteria wher

2017-07-29 10:42:50 256

原创 LightOJ 1234 Harmonic Number

题目链接:点我In mathematics, the nth harmonic number is the sum of the reciprocals of the first n natural numbers:In this problem, you are given n, you have to find Hn.InputInput starts with an integer T (≤

2017-07-29 10:32:04 399

原创 LightOJ 1236 Pairs Forming LCM

题目链接:点我Find the result of the following code:long long pairsFormLCM( int n ) { long long res = 0; for( int i = 1; i <= n; i++ ) for( int j = i; j <= n; j++ ) if( lcm(i, j) ==

2017-07-29 10:24:28 275

原创 LightOJ 1245 Harmonic Number (II)

题目链接:点我I was trying to solve problem '1234 - Harmonic Number', I wrote the following codelong long H( int n ) { long long res = 0; for( int i = 1; i <= n; i++ ) res = res + n / i; r

2017-07-28 23:19:50 180

原创 Goldbach`s Conjecture LightOJ 1259

题目链接:点我Goldbach's conjecture is one of the oldest unsolved problems in number theory and in all of mathematics. It states:Every even integer, greater than 2, can be expressed as the sum of two primes [

2017-07-28 23:05:24 258

原创 Leading and Trailing LightOJ 1282

题目链接: 点我You are given two integers: n and k, your task is to find the most significant three digits, and least significant three digits of nk.InputInput starts with an integer T (≤ 1000), denoting the

2017-07-28 22:58:55 337

原创 Sigma Function LightOJ 1336

题目链接:点我Sigma function is an interesting function in Number Theory. It is denoted by the Greek letter Sigma (σ). This function actually denotes the sum of all divisors of a number. For example σ(24) = 1

2017-07-28 22:28:01 379

原创 Aladdin and the Flying Carpet Light OJ 1341

题目链接:点我 It's said that Aladdin had to solve seven mysteries before getting the Magical Lamp which summons a powerful Genie. Here we are concerned about the first mystery. Aladdin was about to ent

2017-07-28 21:48:48 215

原创 超能粒子炮·改 HYSBZ - 4591

题目链接:点我 经发明了脑洞治疗仪&超能粒子炮的发明家SHTSC又公开了他的新发明:超能粒子炮·改--一种可以发射威力更加强大的粒子流的神秘装置。超能粒子炮·改相比超能粒子炮,在威力上有了本质的提升。它有三个参数n,k。它会向编号为0到k的位置发射威力为C(n,k) mod 2333的粒子流。现在SHTSC给出了他的超能粒子炮·改的参数,让你求其发射的粒子流的威力之和模2333。Input第

2017-07-24 22:51:28 329

原创 DP? HDU - 3944

题目链接:点我 Figure 1 shows the Yang Hui Triangle. We number the row from top to bottom 0,1,2,…and the column from left to right 0,1,2,….If using C(n,k) represents the number of row n, column k. The Yang

2017-07-24 22:38:57 275

原创 青蛙的约会 POJ - 1061

题目链接:点我 两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对方的。但是除非这两只青蛙在同一时间跳到同一点上,不然是永远都不可能碰面的。为了帮

2017-07-24 22:17:39 144

原创 C Looooops POJ - 2115

题目链接:点我 A Compiler Mystery: We are given a C-language style for loop of type for (variable = A; variable != B; variable += C) statement; I.e., a loop which starts by setting variable

2017-07-22 19:04:26 173

原创 The Balance POJ - 2142

题目链接:点我 Ms. Iyo Kiffa-Australis has a balance and only two kinds of weights to measure a dose of medicine. For example, to measure 200mg of aspirin using 300mg weights and 700mg weights, she can put

2017-07-22 18:51:50 285

原创 Saving Beans HDU - 3037

题目链接:点我 Although winter is far away, squirrels have to work day and night to save beans. They need plenty of food to get through those long cold days. After some time the squirrel family thinks that

2017-07-22 16:02:35 272

原创 Combinations LightOJ - 1067

题目链接:点我 Given n different objects, you want to take k of them. How many ways to can do it? For example, say there are 4 items; you want to take 2 of them. So, you can do it 6 ways.Take 1, 2Take

2017-07-22 10:51:15 228

原创 Non-negative Partial Sums HDU - 4193

题目链接:点我 You are given a sequence of n numbers a 0,..., a n-1. A cyclic shift by k positions (0<=k<=n-1) results in the following sequence: a k a k+1,..., a n-1, a 0, a 1,..., a k-1. How many of the

2017-07-22 10:24:28 258

原创 Max Sum of Max-K-sub-sequence HDU - 3415

题目链接:点我 Given a circle sequence A11,A22,A33......Ann. Circle sequence means the left neighbour of A11 is Ann , and the right neighbour of Ann is A11. Now your job is to calculate the max sum of

2017-07-22 10:16:26 300

原创 Sliding Window POJ - 2823

题目链接:点我 An array of size n ≤ 10 6 is given to you. There is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window

2017-07-22 10:08:25 299

原创 Bad Hair Day POJ - 3250

题目链接:点我 Some of Farmer John's N cows (1 ≤ N ≤ 80,000) are having a bad hair day! Since each cow is self-conscious about her messy hairstyle, FJ wants to count the number of other cows that can see t

2017-07-22 09:45:52 285

原创 Largest Submatrix of All 1’s POJ - 3494

题目链接:点我 Given a m-by-n (0,1)-matrix, of all its submatrices of all 1’s which is the largest? By largest we mean that the submatrix has the most elements.Input The input contains multiple test ca

2017-07-21 14:31:39 389

原创 Terrible Sets POJ - 2082

题目链接:点我 Let N be the set of all natural numbers {0 , 1 , 2 , . . . }, and R be the set of all real numbers. wi, hi for i = 1 . . . n are some elements in N, and w0 = 0. Define set B = {< x, y >

2017-07-21 14:23:36 302

原创 Ultra-QuickSort POJ - 2299

题目链接:点我 In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence elements until the sequence i

2017-07-21 13:54:25 235

原创 Necklace HDU - 3874

题目链接:点我 Mery has a beautiful necklace. The necklace is made up of N magic balls. Each ball has a beautiful value. The balls with the same beautiful value look the same, so if two or more balls have

2017-07-21 13:48:16 258

原创 Cows POJ - 2481

题目链接:点我 Farmer John's cows have discovered that the clover growing along the ridge of the hill (which we can think of as a one-dimensional number line) in his field is particularly good. Farmer

2017-07-21 13:35:47 226

原创 Stars POJ - 2352

题目链接:点我 Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star be an amount of the stars that are not h

2017-07-21 13:26:47 274

原创 Picture HDU 1828

题目链接:点这里 A number of rectangular posters, photographs and other pictures of the same shape are pasted on a wall. Their sides are all vertical or horizontal. Each rectangle can be partially or totall

2017-07-21 13:13:33 281

原创 Atlantis POJ 1151 HDU 1542

题目链接: POJ HDU There are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of parts of the island. But unfortunately, thes

2017-07-21 12:59:46 361

原创 Count Color POJ 2777

题目链接:点我 Chosen Problem Solving and Program design as an optional course, you are required to solve all kinds of problems. Here, we get a new problem. There is a very long board with length L cen

2017-07-21 12:37:07 245

原创 Hotel POJ 3667

题目链接:点我 The cows are journeying north to Thunder Bay in Canada to gain cultural enrichment and enjoy a vacation on the sunny shores of Lake Superior. Bessie, ever the competent travel agent, has nam

2017-07-21 11:25:00 237

原创 Minimum Inversion Number HDU 1394

题目链接:点我 The inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i < j and ai > aj. For a given sequence of numbers a1, a2, ..., an, if we mov

2017-07-20 14:34:36 210

原创 Billboard HDU 2795

题目链接:点我 At the entrance to the university, there is a huge rectangular billboard of size h*w (h is its height and w is its width). The board is the place where all possible announcements are posted:

2017-07-20 13:12:22 190

原创 敌兵布阵 HDU 1166

题目链接:点我 C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视。 中央情报局要

2017-07-20 11:40:10 216

原创 逃离迷宫 HDU - 1728

题目链接:点我  给定一个m × n (m行, n列)的迷宫,迷宫中有两个位置,gloria想从迷宫的一个位置走到另外一个位置,当然迷宫中有些地方是空地,gloria可以穿越,有些地方是障碍,她必须绕行,从迷宫的一个位置,只能走到与它相邻的4个位置中,当然在行走过程中,gloria不能走到迷宫外面去。令人头痛的是,gloria是个没什么方向感的人,因此,她在行走过程中,不能转太多弯了,否则她会

2017-07-20 11:09:07 197

原创 Catch That Cow POJ - 3278

题目链接:点我 Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (0 ≤

2017-07-20 11:02:39 198

原创 Ignatius and the Princess I HDU - 1026

题目链接:点我 The Princess has been abducted by the BEelzebub feng5166, our hero Ignatius has to rescue our pretty Princess. Now he gets into feng5166's castle. The castle is a large labyrinth. To make t

2017-07-20 10:56:55 264

数字逻辑与数字系统设计习题 卢建华版 参考答案

数字逻辑与数字系统设计习题 卢建华版 参考答案, 答案来自与网络, 为娄以后方便自己查找和分享给广大人民群众, 上传到网上

2017-12-07

acm数论概论

acm,算法,数论

2017-08-02

蓝桥杯基础数据结构

蓝桥杯 数据结构

2017-04-07

蓝桥杯基础算法

蓝桥杯的基础算法

2017-04-07

动态规划入门

dp算法

2017-04-07

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除