ACM
文章平均质量分 93
OVS98
尽管走下去,不必逗留着,去采鲜花来保存,因为在路上,花会继续开放。
展开
-
UVA 458
The Decoder Write a complete program that will correctly decode a set of characters into a valid message. Your program should read a given file of a simple coded set of characters and print the原创 2014-03-12 14:01:15 · 531 阅读 · 0 评论 -
Integer Inquiry
题目来自杭电:http://acm.hdu.edu.cn/showproblem.php?pid=1047 Integer Inquiry Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 15361 Accepted Submi转载 2015-08-02 08:26:22 · 404 阅读 · 0 评论 -
Exponentiation
题目来自杭电:http://acm.hdu.edu.cn/showproblem.php?pid=1063 Exponentiation Time Limit: 2000/500 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 8101 Acce原创 2015-08-04 13:28:25 · 341 阅读 · 0 评论 -
How Many Fibs?
题目来自杭电:http://acm.hdu.edu.cn/showproblem.php?pid=1316 How Many Fibs?Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 5214 Accepted Submissio转载 2015-08-05 13:37:11 · 604 阅读 · 0 评论 -
大明A+B
题目来自杭电:http://acm.hdu.edu.cn/showproblem.php?pid=1753 大明A+BTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 10214 Accepted Submission(s): 36原创 2015-08-05 17:22:43 · 360 阅读 · 0 评论 -
Ignatius and the Princess II
题目来自杭电:http://acm.hdu.edu.cn/showproblem.php?pid=1027 Ignatius and the Princess IITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 5768 Acce原创 2015-08-06 10:45:54 · 434 阅读 · 1 评论 -
Holding Bin-Laden Captive!
题目来自杭电:http://acm.hdu.edu.cn/showproblem.php?pid=1085 Holding Bin-Laden Captive!Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 17440 Accep原创 2015-08-06 13:19:15 · 365 阅读 · 0 评论 -
微软面试、经典算法、编程艺术、红黑树4大系列总结
本文系转载:http://blog.csdn.net/sunboy_2050/article/details/6553545转载 2015-08-06 13:51:41 · 425 阅读 · 0 评论 -
冒泡排序
原文链接:http://blog.csdn.net/morewindows/article/details/6657829 简单void BubbleSort1(int *a,int n){ int i,j; for(i = 0;i < n;i++) for(j = 1;j < n - i;j++) if(a[j - 1] > a[j])转载 2015-09-19 16:41:44 · 231 阅读 · 0 评论 -
选择排序
原文链接:http://blog.csdn.net/morewindows/article/details/6671824void SelectSort(int *a,int n){ int i,j; int nMinIndex; for(i = 0;i < n;i++){ nMinIndex = i; for(j = i + 1;j < n;j转载 2015-09-20 09:32:44 · 227 阅读 · 0 评论 -
堆与堆排序
原文链接:http://blog.csdn.net/morewindows/article/details/6709644void MinHeapFixup1(int *a,int i){ int j; int temp; j = (i - 1) / 2; temp = a[i]; while(j >= 0 && i != 0){ if(a[j]转载 2015-09-20 20:12:23 · 234 阅读 · 0 评论 -
希尔排序
原文链接:http://blog.csdn.net/morewindows/article/details/6668714 简单void ShellSort(int *a,int n){ int i,j,k; int temp; int gap; for(gap = n / 2;gap > 0;gap /= 2) for(i = 0;i < gap;i转载 2015-09-20 09:02:51 · 235 阅读 · 0 评论 -
归并排序
原文链接:http://blog.csdn.net/morewindows/article/details/6678165void MergeArray(int *a,int first,int mid,int last,int temp){ int i = first,j = mid + a; int m = mid,n = last; while(i <= m && j <转载 2015-09-20 10:48:03 · 259 阅读 · 0 评论 -
插入排序
原文链接:http://blog.csdn.net/morewindows/article/details/6665714 简单InsertSort(int *a,int n){ int i,j,k; for(i = 1;i < n;i++){ for(j = i - 1;j >= 0;j--){ if(a[j] < a[i])转载 2015-09-19 18:04:08 · 220 阅读 · 0 评论 -
快速排序
void QuickSort(int *a,int l,int r){ if(l < r){ int i = l,j = r; temp = a[l]; while(i < j){ while(a[j] >= temp && i < j) j--; if(i转载 2015-09-20 11:11:46 · 229 阅读 · 0 评论 -
HOJ Delta-wave
题目链接Problem Description A triangle field is numbered with successive integers in the way shown on the picture below. The traveller needs to go from the cell with number M to the cell with number N. Th原创 2015-11-21 16:15:05 · 305 阅读 · 0 评论 -
HOJ Computer Transformation
题目链接Problem Description A binary search tree is a binary tree with root k such that any node v reachable from its left has label (v) #include <iostream>const int MAX = 1000 + 1;const int LENGTH = 30原创 2015-11-21 21:53:01 · 297 阅读 · 0 评论 -
0-1背包问题
0-1背包问题: 有N件物品和一个容量为V的背包。第i件物品的费用是c[i],价值是w[i]。求解将哪些物品装入背包可使这些物品的费用总和不超过背包容量,且价值总和最大。这个问题的特点是:每种物品只有一件,可以选择放或者不放。算法基本思想:利用动态规划思想 ,子问题为:f[i][v]表示前i件物品恰放入一个容量为v的背包可以获得的最大价值。其状态转移方程是:f[i][v]=max{f[i-1][v]转载 2015-11-23 21:35:49 · 305 阅读 · 0 评论 -
N!
题目来自杭电:http://acm.hdu.edu.cn/showproblem.php?pid=1042 Problem DescriptionGiven an integer N(0 ≤ N ≤ 10000), your task is to calculate N!InputOne N in one line, process to the end of file.OutputFor eac原创 2015-07-31 17:09:58 · 441 阅读 · 0 评论 -
大数阶乘
原文链接:http://blog.csdn.net/whdugh/article/details/9364245 菜鸟篇 程序1,一个最直接的计算阶乘的程序include “stdio.h”include “stdlib.h”int main(int argc, char* argv[]) { long i,n,p; printf(“n=?”);转载 2015-07-31 16:15:18 · 1750 阅读 · 0 评论 -
UVA 10300
Ecological PremiumInput:standard inputOutput:standard outputTime Limit: 1 secondMemory Limit:32 MBGerman farmers are given a premium depending on the conditions at their farmyard.原创 2014-03-12 13:42:40 · 452 阅读 · 0 评论 -
uva volume1 100
The 3n + 1 problem BackgroundProblems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will原创 2014-01-17 16:23:17 · 578 阅读 · 0 评论 -
UVA 10055
Problem AHashmat the brave warriorInput:standard inputOutput:standard output Hashmat is a brave warrior who with his group of young soldiers moves from one place to another to原创 2014-03-11 23:35:52 · 492 阅读 · 0 评论 -
UVA 10071
Problem BBack to High School PhysicsInput:standard inputOutput:standard output A particle has initial velocity and constant acceleration. If its velocity after certain time is v then原创 2014-03-11 23:44:44 · 483 阅读 · 0 评论 -
UVA 414
Machined Surfaces An imaging device furnishes digital images of two machined surfaces that eventually will be assembled in contact with each other. The roughness of this final contact is to be e原创 2014-03-16 22:16:14 · 8248 阅读 · 0 评论 -
uva 494
Kindergarten Counting Game Everybody sit down in a circle. Ok. Listen to me carefully. ``Woooooo, you scwewy wabbit!'' Now, could someone tell me how many words I just said? Input and Ou原创 2014-03-16 13:26:00 · 593 阅读 · 0 评论 -
uva 457 Linear Cellular Automata
A biologist is experimenting with DNA modification of bacterial colonies being grown in a linear array of culture dishes. By changing the DNA, he is able ``program" the bacteria to原创 2014-05-02 21:49:12 · 486 阅读 · 0 评论 -
uva 694
The Collatz Sequence An algorithm given by Lothar Collatz produces sequences of integers, and isdescribed as follows:Step 1:Choose an arbitrary positive integer A as the fi原创 2014-05-02 19:36:10 · 699 阅读 · 0 评论 -
uva 10010 Where's Waldorf?
Where's Waldorf? Given a m by n grid of letters, (), and a listof words, find the location in the grid at which the word can be found.A word matches a straight, uninterrupt转载 2014-05-03 17:09:46 · 497 阅读 · 1 评论 -
UVA 445
Marvelous Mazes Your mission, if you decide to accept it, is to create a maze drawing program. A maze will consist of the alphabetic charactersA-Z, * (asterisk), and spaces. Input and Outp原创 2014-03-22 18:01:23 · 624 阅读 · 0 评论 -
uva 490
Rotating Sentences In ``Rotating Sentences,'' you are asked to rotate a series of input sentences 90 degrees clockwise. So instead of displaying the input sentences from left to right and top to原创 2014-03-22 18:19:19 · 474 阅读 · 0 评论 -
uva 488
Triangle Wave In this problem you are to generate a triangular wave form according to a specified pair of Amplitude and Frequency.Input and OutputThe input begins with a s原创 2014-03-22 19:19:43 · 1173 阅读 · 0 评论 -
UVA 489
Hangman Judge In ``Hangman Judge,'' you are to write a program that judges a series of Hangman games. For each game, the answer to the puzzle is given as well as the guesses. Rules are the same原创 2014-03-25 21:02:38 · 500 阅读 · 0 评论 -
uva 537
Artificial Intelligence? Physics teachers in high school often think that problems given as text are more demanding than pure computations. After all, the pupils have to read and understan原创 2014-05-20 01:01:12 · 372 阅读 · 0 评论 -
UVA 409 Excuses, Excuses!
Excuses, Excuses! Judge Ito is having a problem with people subpoenaed for jury duty giving rather lame excuses in order to avoid serving. In order to reduce the amount of time required li原创 2014-05-20 15:34:18 · 453 阅读 · 0 评论 -
A + B Problem II
题目来自杭电http://acm.hdu.edu.cn/showproblem.php?pid=1002 A + B Problem II Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 262063 Accepted Subm原创 2015-07-31 11:05:34 · 365 阅读 · 0 评论 -
HOJ Train Problem II
题目链接Train Problem II Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 7186 Accepted Submission(s): 3876Problem DescriptionAs we all know the原创 2015-11-19 20:14:27 · 253 阅读 · 0 评论