uva 133

題目類型:迴圈鏈表題目:一個迴圈的圈,由兩個人從頭尾開始尋找,分別將第m,第n的人刪除,(兩人是同時進行的),即是數完了才刪除的,遇到相同的只輸出一個,否則都輸出,然後重新開始數,直至全部輸完解題曆程:看題目看了很久,也許之前不仔細有陰影,這次還是看了但依然有點不是很清楚地,總而言之,有點。。。。把題目看懂,手工類比一遍,寫演算法(可惜有漏洞。。。就是沒考慮刪除一次後將指標重設時可能出現指標的下一位可能會被刪除。。。。,要同時出現最後只有兩個人的情況)心得:考慮一定要全面,

UVa Problem Solution: 10194 – Football (aka Soccer)

Nothing worthy to mention.Code:/************************************************************************* * Copyright (C) 2008 by liukaipeng                                      * * liukaipeng at gmail dot com                                         

UVa Problem Solution: 10127 – Ones

We can solve this problem by simulating the calculating process of multiply two numbers on the paper, yet we've already known the product. We guess the least significant digit of one number, multiply it with the other number to get a 1 of the least

UVa Problem Solution: 10035 – Primary Arithmatic

Simple problem. Just count it.Code:/************************************************************************* * Copyright (C) 2008 by liukaipeng                                      * * liukaipeng at gmail dot com                                     

UVa Problem Solution: 10026 – Shoemaker’s Problem

Simply sort will do the job. Given to jobs, j1 and j2. which should be done first? Do j1 first will cause a total fine to j2 of j1.time * j2.fine and do j2 first will cause a total fine to j1 of j2.time * j1.fine.Code:/*******************************

UVa Problem Solution: 120 – Stacks of Flapjacks

I just simulate the flipping. We are not required to find the optimal solution, so I choose a way easy to understand. I find the biggest cake in the unsorted stack, and then check its position. If it is at the bottom of the stack, then nothing need

UVa Problem Solution: 10033 – Interpreter

Straight forward simulating.Code:/************************************************************************* * Copyright (C) 2008 by liukaipeng                                      * * liukaipeng at gmail dot com                                       

uva 127

題目類型:棧類比解題經曆:崩潰。。。。題目:(摘自星星之火的百度空間)你的任務是類比一種叫「Accordian」的紙牌遊戲,他的遊戲規則如下:

UVa Problem Solution: 10152 – ShellSort

Let the required stack to be the sorted sequence, and the original stack to be the sequence to sort. A turtle is numbered by its position in the required stack: the top is 0, the second is 1, and so on. A turtle is said in reverse order if its

UVa Problem Solution: 10142 – Australian Voting

I just simulate the electing process. The RT is very slow.Code:/************************************************************************* * Copyright (C) 2008 by liukaipeng                                      * * liukaipeng at gmail dot com         

uva 116

問題描述:找出最短路徑,加權的解法:典型的dp中#include<cstdio>#include<cstdlib>#include<cmath>#include<string>#include<vector>using namespace std;const int MAXHASHSIZE=10000003;const int MAXN=13;const int MAXS=30005;long long f[MAXS];const

[轉載]—[觀點]成為編程巨星的唯一秘訣

 http://sd.csdn.net/a/20110808/302760.html導讀:本文是從《The Singular Secret of the Rockstar

uva 10130

問題描述:幾個人的01背包問題問題解法:看看147那道,就知道一樣的#include<cstdio>#include<cstdlib>#include<string>using namespace std;const int maxp=105*1000;const int maxn=1001;int v[105];long long d[maxp];int p[maxn],w[maxn];int main(){ int S,n; int

UVa Problem Solution: 10041 – Vito’s Family

Vito should live on the street which is the median of his

uva 107

題目類型:數學解題思路:本題可轉化為:求N^i=num,(N+1)^i=H;然後求等比數列的和,注意:等比因子q等於1時要分開討論。。。。本人就是卡在這裡,還有當輸入為(2*k+1),1時輸出結果應為:0,H;(也是本人卡題原因),解題心得:      1 注意邊界考慮。。。。      2 浮點數比較:     fabs(a,b)<eps      3

uva 674

問題描述:給出5種硬幣,面值分別為{1,5,10,25,50},然後給出金額,要求能用這五種硬幣湊出金額的種類數類型:經典dp,做法:首先,d(i,s)表示用V(i),V(i+1),...V(5)這幾種硬幣湊成S的方法有多少種,那麼d(i,S)=d(i+1,S-V[i]*j)   (0<=j

UVa Problem Solution: 10018 – Reverse and Add

Do what you are told to do.Code:/************************************************************************* * Copyright (C) 2008 by liukaipeng                                      * * liukaipeng at gmail dot com                                        

uva 101

題目類型:類比題考查:資料結構題目經曆:1TLE,2Y解題思路:用鏈棧進行解答,類比全操作,即可。。。代碼:#include<stdio.h>#include<string.h>#include<malloc.h>int num;typedef struct node{ int data; struct node *next;}node,*stacklist;//鏈棧stacklist s[25];int create(stacklist

UVa Problem Solution: 701 – The Archaeologist’s Dilemma

Let P denotes the prefix, T denotes the # of lost digits. We are searching for N, that the prefix of 2^N is P. We have an inequlity of    P*10^T <= 2^N < (P+1)*10^Tthus    log2(P*10^T) <= log2(2^N) < log2((P+1)*10^T),which is   

uva 147

#include<cstdio>#include<cstdlib>#include<cmath>#include<string>#include<vector>using namespace std;const int MAXHASHSIZE=10000003;const int MAXN=13;const int MAXS=30005;long long f[MAXS];const int v[12]={0,5,10,20,50,10

總頁數: 61357 1 .... 24176 24177 24178 24179 24180 .... 61357 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.