poj2362解題報告

SquareTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 12229 Accepted: 4223DescriptionGiven a set of sticks of various lengths, is it possible to join them end-to-end to form a square?InputThe first line of input contains N, the number of

分數運算式計算機

到了資料結構課程設計的時候了,我選了一個運算式計算機,但沒用老師要求的用堆棧結構運算,自己寫了一個直接對字串掃描運算的函數,以分數形式運算,結果為精確值,O(n)的複雜度,感覺比用堆棧的效率高。下面是主要部分代碼。。。  程式支援運算子為()+-*/   char in[200],out[20];int pos;int getgcd(int a,int b){if(!a)return b;return getgcd(b%a,a);}void yuefen(int &fenzi,int &

@synthesize obj=_obj的意義詳解 @property和@synthesize

我們在進行iOS開發時,經常會在類的聲明部分看見類似於@synthesize window=_window; 的語句,那麼,這個window是什麼,_ window又是什麼,兩個東西分別怎麼用,這是一個比較基本的問題,也關乎我們理解Objective-C中對類、類的屬性、類的存取器、類的局部變數的統一理解。在32位系統中,如果類的 @interface 部分沒有進行 ivar 聲明,但有 @property 聲明,在類的 @implementation 部分有響應的

poj1528解題報告

大水題。。。飄過   #include<iostream>#include<cmath>using namespace std;int s(int n){int i,sum=1;for(i=2;i<=(int)sqrt((double)n);i++)if(n%i==0)sum+=i+n/i;if((int)sqrt((double)n)*(int)sqrt((double)n)==n)sum-=(int)sqrt((double)n);return

POJ 1941 三角形分形

The Sierpinski FractalTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 2684 Accepted: 1240DescriptionConsider a regular triangular area, divide it into four equal triangles of half height and remove the one in the middle. Apply the same

poj3461解題報告

OulipoTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6114 Accepted: 2329DescriptionThe French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group. A quote from

求一個類的sizeof應考慮的問題

           昨天面試,面試官讓我說一說求一個類的sizeof應該考慮的問題,心想,太好了,之前sizeof可是做了不少功夫,就說了類的非靜態、非全域成員,如果有虛函數就要加上一個指向虛表的指標,4位元組大小,然後說,大概是這樣。面試官就問,虛函數的實現機制是?大概講了一下虛表之類的東東,然後他問,那如果是虛繼承呢,求sizeof還是一樣的嗎?先是一愣,心想,媽呀,什麼是虛繼承呢,然後還是淡定地回了,應該也是一樣的吧,都是用一個指標來指向續表,面試官便沒怎麼說。          

poj2780解題報告

LinearityTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 5999 Accepted: 1287DescriptionAlice often examines star maps where stars are represented by points in a plane and there is a Cartesian coordinate for each star. Let the Linearity of

人機對戰五子棋

  人機對戰五子棋,BOT的AI不太高,大約是初級的中等水平,,,等有時間再提升下BOT AI。。。。 操作:上下左右WSAD 斷行符號是下棋  #include<iostream>#include<conio.h>using namespace std;struct mov{int x,y;}mov[8]={-1,-1,-1,0,-1,1,0,1,1,1,1,0,1,-1,0,-1};class chessmap{int

nlogn求逆序數 POJ 2299解題報告

前幾天自己想出了利用歸併排序求逆序數的方法,找了一個求逆序數的題2299 交了300++MS水過... Ultra-QuickSortTime Limit: 7000MS Memory Limit: 65536KTotal Submissions: 19686 Accepted: 6959DescriptionIn this problem, you have to analyze a particular sorting algorithm. The algorithm processes

poj3083解題報告

Children of the Candy CornTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 4046 Accepted: 1838DescriptionThe cornfield maze is a popular Halloween treat. Visitors are shown the entrance and must wander through the maze facing zombies,

以前寫的小遊戲

兩人對戰的五子棋,上下左右為wsad  斷行符號為下棋。。。  #include<iostream>#include<conio.h>using namespace std;struct mov{ int x,y;}mov[8]={-1,-1,-1,0,-1,1,0,1,1,1,1,0,1,-1,0,-1};int map[20][20],step,X,Y;int dfs(int x,int y,int fang,int jige,int type){ if(x+mov[

一個字串的面試題

題目:         有一字串由M個單片語成單詞之間有空格隔開(只有空格,沒有其他標點符號),有N個關鍵字,現在要在字串中找出包含N個關鍵字(每個關鍵字至少出現一次,沒有說要不要按什麼順序)的最短子串。函數原型:String extractSummary(String description, String[] keywords)  思路:  想了一陣,想出了一個方法,設主串長n 關鍵字長m 則複雜度大致為nlogm舉個例子說下過程:例如主串: ab ba ad ba ab ef ba ab

poj2421解題報告

Constructing RoadsTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 12166 Accepted: 4831DescriptionThere are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect to each other.

俄羅斯方塊機器人版

沒事寫的,自動擺放演算法比較簡單,大約為新手水平,以後會繼續改進。。。 自動擺放演算法:盡量消行,盡量往低了放,盡量不留空。。 #include<iostream>#include<conio.h>#include<windows.h>#include <time.h>#pragma comment(lib, "winmm.lib")using namespace std;#define MAPSIZEH 20#define MAPSIZEL 15

poj2377解題報告

Bad CowtractorsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6456 Accepted: 2816DescriptionBessie has been hired to build a cheap internet network among Farmer John's N (2 <= N <= 1,000) barns that are conveniently numbered 1..N.

poj2407解題報告

RelativesTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6232 Accepted: 2786DescriptionGiven n, a positive integer, how many positive integers less than n are relatively prime to n? Two integers a and b are relatively prime if there are no

最近的總結。。

 前幾天學校就放假了,因為有點事情就留校幾天。我們學院的**老師想出一本叫做<<資料結構課程設計>>的破書,杯具的是這個任務壓到了我們頭上,我的工作是寫排序那一章的前半部分,本來沒有語言細胞忙活了兩天硬憋出了6000多個字兒,總算完成任務,唉,鬱悶,不過也好,大部分排序演算法自己都用自我感覺精簡的代碼實現了一遍,而且書上都用的我寫的代碼,這個感覺還不錯。。   我們下屆的同學可慘了,估計這個東西會被作為課程設計參考資料。。。汗。。  貼一下自認為寫的還算精簡的代碼(至少比

重寫的俄羅斯方塊。

重寫了一個俄羅斯方塊,主要代碼3~4個小時就寫完了,,自動下落的研究了好久才弄出來。。。。菜啊  不過現在回頭再看以前寫的俄羅斯方塊真是太垃圾了。。。。VC++6.0下編譯通過  #include<iostream>#include<conio.h>#include<windows.h>#include <time.h>#pragma comment(lib, "winmm.lib")using namespace std;#define

實現LED字幕左右移動函數

瞎研究..  #include<iostream>#include<windows.h>using namespace std;struct LIST{char str[3];LIST *up,*next;};class LED{public:LED();void rightmove(int speed,int loop=-1);void leftmove(int speed,int loop=-1);private:LIST *head;int lenth;};LED:

總頁數: 61357 1 .... 13833 13834 13835 13836 13837 .... 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.