- 博客(26)
- 资源 (1)
- 收藏
- 关注
原创 UVA - 103 Stacking Boxes
题目: Stacking Boxes BackgroundSome concepts in Mathematics and Computer Science are simple in one or two dimensions but become more complex when extended to arbitr
2014-11-27 21:37:48 509
原创 UVA - 111 History Grading
History Grading BackgroundMany problems in Computer Science involve maximizing some measure according to constraints.Consider a history exam in which students are asked to put severa
2014-11-27 21:33:05 496
原创 有向图的打印
#include #include #include #include #define N 100using namespace std;struct EdgeNode{ // 表节点 里面有邻接区域 adjvex(存放vi 和 vj 相连的序号) 和 链区域next(将所以表的节点链 放在一起) int adjvex; char data; EdgeNode *next; /
2014-11-25 00:33:12 615
原创 UVA - 10487 Closest Sums
Problem DClosest SumsInput: standard inputOutput: standard outputTime Limit: 3 seconds Given is a set of integers and then a sequence of queries. A query gives you a number and asks to fin
2014-11-24 00:06:10 469
原创 FZU 2111 Min Number
J - Min NumberTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit Status Practice FZU 2111DescriptionNow you are given one non-negative integer n in
2014-11-23 23:03:37 489
原创 FZU 2104 C - Floor problem
DescriptionIn this problem, we have f(n,x)=Floor[n/x]. Here Floor[x] is the biggest integer such that no larger than x. For example, Floor[1.1]=Floor[1.9]=1, Floor[2.0]=2.You are given 3 posit
2014-11-23 21:13:35 456
原创 FZU 2102 Solve equation
You are given two positive integers A and B in Base C. For the equation:A=k*B+dWe know there always existing many non-negative pairs (k, d) that satisfy the equation above. Now in this problem
2014-11-23 21:05:01 424
原创 FZU - 2110 Star
DescriptionOverpower often go to the playground with classmates. They play and chat on the playground. One day, there are a lot of stars in the sky. Suddenly, one of Overpower’s classmates ask him
2014-11-23 20:24:29 470
原创 UVA - 10706 Number Sequence
Problem BNumber SequenceInput: standard inputOutput: standard outputTime Limit: 1 secondA single positive integer iis given. Write a program to find the digit located in the position iin
2014-11-22 20:12:59 372
原创 UVA - 10057 A mid-summer night's dream.
Problem CA mid-summer night’s dreamInput: standard inputOutput: standard output This is year 2200AD. Science has progressed a lot in two hundred years. Two hundred years is mentioned here
2014-11-21 20:57:26 514
原创 计算表达式(前辍表达式变为后辍表达式之后,利用栈来做)
#include#include#include#include#include using namespace std;char a[1010];char b[1010];stack s1;stack s2;int i,j,n,m,t;float x,y,z;int fun(char x){ switch(x) { case '+' : case
2014-11-21 18:31:40 721 1
原创 查找数字的三种算法的时间
#include #include typedef struct Node { int data; Node *left,*right; Node *parent;}BinTreeNode, *BinTree;void insert(BinTree *root,int key) { BinTree p = (BinTree)malloc(sizeof(BinTreeNode));
2014-11-21 18:18:47 801
原创 UVA - 270 Lining Up
Lining Up ``How am I ever going to solve this problem?" said the pilot.Indeed, the pilot was not facing an easy task. She had to drop packages at specific points scattered in a dangero
2014-11-20 23:56:09 580
原创 UVA - 10132 File Fragmentation
Question 2: File FragmentationThe ProblemYour friend, a biochemistry major, tripped while carrying a tray of computer files through the lab. All of the files fell to the ground and broke. Your f
2014-11-19 23:49:34 446
原创 UVA - 10763 Foreign Exchange
Problem EForeign ExchangeInput: standard inputOutput: standard outputTime Limit: 1 secondYour non-profit organization (iCORE - international Confederation of Revolver Enthusiasts) coordi
2014-11-18 23:18:30 372
原创 UVA - 10905 Children's Game
4thIIUCInter-University Programming Contest, 2005AChildren’s GameInput: standard inputOutput: standard outputProblemsetter: Md. KamruzzamanThere
2014-11-18 22:12:04 388
原创 UVA - 10591 Happy Number
题目:#include #include #include #include #define ll long long int using namespace std;int vis[100000000];ll bit(int u) { ll sum = 0; while (u) { int v = u %10; sum += v * v; u = u / 1
2014-11-08 20:08:08 447
原创 UVA - 141 The Spot Game
The Spot Game The game of Spot is played on an NxN board as shown below for N = 4. During the game, alternate players may either place a black counter (spot) in an empty square or remove
2014-11-07 19:56:25 663
原创 UVA - 10887 Concatenation of Languages
Problem AConcatenation of LanguagesInput File: Standard InputOutput: Standard Output A language is a set of strings. And the concatenation of two languages is the set of all strings that are
2014-11-07 16:21:55 390
原创 UVA - 10125 Sumsets
#include #include #include #include #include #include using namespace std; const int MAXN = 10000003; const int MAXSIZE = 1030; int n; int rear; struct node {
2014-11-06 22:40:12 394
原创 树的建立以及遍历
#include #include #include #include #include #include #define MAX 100using namespace std;typedef struct BinTreeNode { char data; BinTreeNode *left, *right;}BinTreeNode,*BinTree;BinTree C
2014-11-04 01:15:41 640
原创 UVA - 10391 Compound Words
Problem E: Compound WordsYou are to find all the two-word compound words in a dictionary. A two-word compound word is a word in the dictionary that is the concatenation of exactly two other words in
2014-11-04 00:04:08 414
原创 UVA - 10282 Babelfish
Problem C: BabelfishYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you underst
2014-11-03 23:11:06 452
原创 uva 10603 Fill
FILL There are three jugs with a volume of a, b and c liters. (a, b, and c are positive integers not greater than 200). The first and the second jug are initially empty, while the third
2014-11-03 00:17:06 405
原创 FZU 2037
解题方法:推公式 第一个答案公式f(n) = (n-1)!+f(n-1)+(n-1)*f(n-1); 第二个答案公式 f(n) = f(n-1)+1/n;
2014-11-02 22:52:36 447
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人