poj 2993 Emag eht htiw Em Pleh

//這一題就是2996的逆轉輸出!這題需要注意的地方是:輸入的white和black的順序可以搗亂!在第一次做這題的時候,我竟然因為代碼太長而提交不了,哈哈哈,第一次出現這樣的情況//第一次做的時候,主要是因為沒有應用到map容器,所以My Code就是一堆的if...else if...。在寫的時候我都覺得不妥的了,//但是硬著頭皮去試試啦,既然想到了,不可能不寫出來的! #include <iostream>#include <string>#include <

poj 3505 Tower Parking

#include <iostream>//這題如果讀不懂題意,就很難對資料進行處理!題意:塔式停車場,每一層都可以停車,當顧客需要取車的時候,升降機就會升降到停車的//樓層,然後傳輸帶就可以順時針或者逆時針地進行轉動,直到車的所在位置,然後升降機就降到出口處,完成取車的任務!不過過程需要注意//升降機的升降位置就在上次的取車的位置開始! #include <algorithm>#include <memory.h>#include

poj 1316 Self Numbers

#include <iostream> #include <memory.h>using namespace std;int self_number[100000];//剛開始的時候,因為數組開得太小了,貢獻了3次RE,慘!因為它的相加之和會大於10000的! int main(){ int i, tmp, ans; memset(self_number, 0, sizeof(self_number)); for (i = 1; i <= 1000

poj 2339 Rock, Scissors, Paper

//開始做這一題的時候,讀題都讀了很久,完全沒有讀懂,感覺這一題也出得太爛了,題意的疑點成千上萬,讓人無從下手!//最後只有看別人的解題報告才知道!題意:在一個二維方格中,有三種物種:P,S,R 他們會互相進行攻擊,P可以打敗R,S可//打敗P,R可打敗S,他們每天都會發生戰爭,別打敗的物種的方格會別打勝的物種霸佔,問經過n天之後,方格上的物種位置情況如何!//這一題需要注意的是:

poj 1248 Safecracker

//5個for迴圈,直接暴力就可以過了,對一些重複的字元不進行選擇! #include <iostream>#include <string>#include <map>#include <cmath>using namespace std;map<char, int> m;int main(){ int target, i, j, k, l, n, len, temp; string str, ans, tmp;

poj 2302 Traditional BINGO

//就是按下面的數一個一個處理,如果是已有的牌則標記上,如果有任意橫排,豎排,或斜排的數都被標記了則遊戲結束#include <iostream>using namespace std;int bingo[5][5];int num[75];int main(){ int tc, i, j, k, c; bool flag1, flag2, flag3, flag4; cin >> tc; while (tc--) {

poj 1450 Gridland

//簡單題,經過分析只要將m*n的積分奇數和偶數討論就可以了! #include <iostream>#include <cstdio>#include <cmath>using namespace std;int main(){ int tc, m, n, c = 0; double sum; cin >> tc; while (tc--) { c++; cin >>

poj 1323 Game Prediction

//這一題根本上就不用考慮有多少個人來玩,只是考慮有兩手牌就可以了,一組是給出的牌,一組是除了給出的牌之外,剩下的牌就可以//將兩手牌分別儲存在兩個數組中,然後從小排序,最後運用貪心就可以了! #include <iostream>#include <memory.h>#include <algorithm>using namespace std;int card1[1010], card2[1010], card3[1010];int main(){

poj 1250 Tanning Salon

#include <iostream>#include <vector>#include <string>#include <algorithm>using namespace std;vector<char> v; vector<char>::iterator it;int main(){ int customers, i, len, ans, size; string str; while (cin &

poj 2051 Argus

//這道題就是說,給你個id號,給你個周期,然後每個周期就會輸出一次id,對於測試範例,200先輸出一次2004,然後300輸出2005,400的時候就是2004,600時候兩個都要輸出,那麼按id的升序輸出2004然後2005,輸出了5個資料了,結束了···//前面說的全是廢話,但是需要注意其周期為0的時候,就相當於優先順序是最高的,所以總是輸出其周期為0的且id號最小的那個! #include <iostream>#include <string>#include &

poj 2924 Gauß in Elementary School

#include <iostream>#include <cstdio>#include <cmath>using namespace std;int main(){ int tc, c = 0; long long sum, tmp1, tmp2, n , m; cin >> tc; while (tc--){ c++; cin >> n >> m;

poj 1350 Cabric Number Problem

//這一題的陷阱多多,貢獻了2次OLE,一次WA!哎!陷阱:需要保證輸入的數必須為4位,不能大於或小於4位,要不就OLE! 輸出的是No,Ok而不是no ,ok #include <iostream>#include <string>#include <sstream>#include <algorithm>using namespace std;bool cmp(char a, char b){ return a > b;}int

poj 2424 Flo’s Restaurant

//這題類比題搞死人了:首先桌子是分類的,如果你來的人數是1或者2,只可以坐 two-seat tables類型,如果你來的人數是2或者3人,只可以坐// four-seat tables 類型,如果來的人數是5或者6人,只可以坐 six-seat tables類型,就算其他的桌子類型有空出來了,你也不可以坐,你只可以//等你所需要的那種類型;第二個值得注意的地方就是:they have to wait until some suitable table is free and //there

poj 2909 Goldbach’s Conjecture

//給出一個偶數,要求在這個偶數的範圍內,有幾對素數和是等於這個偶數的,注意素數對的不重複性! #include <iostream>#include <cmath>using namespace std;bool is_primer(int n){ if (n == 1) return 0; int i, m; m = sqrt(float(n)); for (i = 2; i <= m; i++) if (n %

poj 1234 Ball Toss

//貢獻了一次WA,原因是忽略了下面這句話:“Note that classmate number 1 initially has the ball and tosses it to classmate k. //Thus, number 1 has not yet been tossed the ball and so does not switch the direction he is thinking. ”

poj 1595 Prime Cuts

//給出一個數,需要你求出其區間中的所有素數,然後再分素數個數的奇偶性,從素數列表的中間開始輸出即可! #include <iostream>#include <cmath>#include <memory.h>using namespace std;int primer[1000];bool is_primer(int n){ if (n == 1) return 1; int tmp = sqrt(float(n)); for

poj 1575 Easier Done Than Said?

#include <iostream>#include <string>using namespace std;int main(){ int i, len; string str; bool flag1, flag2, flag3, flag4; while (cin >> str) { if (str == "end") break; len = str.length();

poj 1656 Counting Black

//簡單的類比題,按部就班地按照題目的意思做就很容易了,給定一定範圍,將這範圍內的地方塗黑或者塗白,最後統計黑色方格的個數! #include <iostream>#include <string>using namespace std;int grid[105][105];int main(){ int i, j, tc, x, y, l, boardx, boardy, ans = 0; string str; for (i = 1; i <=

poj 1580 String Matching

//注意:要讀懂題意:不是隨便地從兩個字串中找出相同的字元就可以,而是在字串進行逐個逐個比較的過程中找出! #include <iostream>#include <string>#include <algorithm>using namespace std;int gcd(int a, int b){ while (b%a) { int t = a; a = b % a; b = t;

poj 2304 Combination Lock

//這題讀懂題意就可以:題目是所鎖上面的紅色的那個刻度走過了的度數是多少?! #include <iostream>using namespace std;int main(){ int pos1, pos2, pos3, pos4, ans; while (cin >> pos1 >> pos2 >> pos3 >> pos4) { if (pos1 == 0 && pos2 ==

總頁數: 61357 1 .... 19892 19893 19894 19895 19896 .... 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.