[轉載]WinEdt提示

1. 在WinEdt中,輸入完“begin{ xxx }”後,不忙著按斷行符號去寫其它內容,緊接著最後的“ }”後面,再輸入一個“ }”(也就是鍵入“begin{ xxx } }”),這時WinEdt會自動將“end{ xxx }”補上,同時將游標停在兩者之間的空白行上,並且已經自動縮排。如果輸入begin{ xxx }時忘了這事兒,也沒有關係,輸入“end”後,連續輸入兩個“{ ”,即“end{ { ”,WinEdt會自動匹配最近一個未匹配的begin{ xxx },並將其補全。2.

poj-2948 Martian Mining

dpdp[i][j]表示(1,1)-(i,j)小矩陣的最大收穫,可以輕鬆得到dp方程:dp[i][j] = max( dp[i][j-1] + col[j][i], dp[i-1][j] + row[i][j]);其中row[i][j]表示第i行從第0列到j列的和,col[i][j]表示第i列從第0行到j行的和。#include <cstdio>#include <cstring>using namespace std;const int MAXN = 500 +

poj-1700-Crossing River **

/* * poj-1700-Crossing River.cpp * *貪心: * 最佳方案構造法:以下是構造N個人(N≥1)過橋最佳方案的方法: * 1) 如果N=1、2,所有人直接過橋。 * 2) 如果N=3,由最快的人往返一次把其他兩人送過河。 * 3) 如果N≥4,設A、B為走得最快和次快的旅行者,過橋所需時間分別為a(1)、a(2);而Z、Y為走得最慢和次慢的旅行者, * 過橋所需時間分別為a(n-1)、a(n)。 *

poj-1860 Currency Exchange **

/* * 匯率問題: Bellman_Ford演算法 , 判斷正環 * * 有個奇怪的問題: 如果把 d[i]初始化為 -inf 則 WA, 初始化為 0 或 -100 之類的值則AC~ 奇怪*/#include <iostream>#include <cstring>using namespace std;const int maxN = 100 + 5;int n, m, s;double v, r[maxN][maxN], c[maxN][maxN],

poj-1251 Jungle Roads *

/* * 1251.cpp * 純粹MST。。 Prim實現 * * Created on: 2011-9-2 * Author: * * 開始用scanf, WA, 後改成cin, AC了~ 不知怎麼回事 總之對C的輸入輸出理解的還不夠好~*/#include <cstdio>#include <iostream>usingnamespace std;constint maxN =27+5;constint inf =100000000;int

poj-1925 Spiderman

dpd[i] 表示從apartment到 橫座標 i 最少需跳幾步。。  p[i] 建築物 i 的橫座標, h[i]建築物i的縱座標注意 由對稱性,spiderman的縱座標始終是 apartment 的高度!! 所以不需要管縱座標!!遍曆每個建築物。。     從橫座標 j 能跳過建築物 i 需滿足: (p[i] - j)^2 <= h[i] ^ 2  - (h[i] - h[1]) ^2      從橫座標 j 經建築物 i 後 到達橫座標 2 * p[i] - j。。  綜上, d[

CEOI 2000 Day 2 Problem 3—Enlightened landscape

ProblemEnlightened landscapeConsider a landscape composed of connected line segments:Above the landscape, N light bulbs are hang at the same height Tin various horizontal positions. The purpose of these light bulbs is to light up the entire

poj-2313 Sequence ***

/* * 貪心: * 但自己沒想出來, 看了網上的解法。。似乎也不太懂。 。 網上給的解法倒是可以證明是對的,但不知道是怎麼想的 * 先給網上的解法: * //開始假設b[i] = a[i](1 <= i <= n) * //顯然b[i]對於最後最優值產生影響的有三項|a[i]-b[i]|,|b[i]-b[i-1]|,|b[i]-b[i+1]| * //反應在數軸上要使得這三項最小,那麼取值應該是這三數置中的那個 * //若存在i使 b[i] <

poj-3034 Whac-a-Mole

dp先自己寫了一個。。 n次WA後搞成TLE~ 。。。  忍無可忍。。 後來參考了網上的代碼。 最終AC~先貼人家的代碼吧~【轉】思路:DP。改了要一天,很糾結的一道題。DP部分,dp[t][x][y]表示第t時間把鎚子停在(x,y)上最多能夠打到的地鼠數量。則dp[t][x][y]=

poj-2777 Count Color *

//蠻水的線段樹//2777//用scanf() 用位元運算#include <cstdio>#include <cstring>using namespace std;const int MAXL = 100000 + 5;const int MAXT = 30 + 5;int L, T, O, a, b, c, ans;bool vis[MAXT * 3];char cmd;struct node{int l, r;int c;};node tree[MAXL *

我理解的邏輯地址、線性地址、物理地址和虛擬位址

【轉】http://bbs.chinaunix.net/thread-2083672-1-1.html    要過年了,發個年終總結貼,只是個人理解,不包正確哈。 本貼涉及的硬體平台是X86,如果是其它平台,嘻嘻,不保證能一一對號入座,但是舉一反三,我想是完全可行的。 一、概念 物理地址(physical address)

UVa-10382 Watering Grass **

/* * Uva-10382-Watering Grass.cpp *  特別注意精度。。(感覺這道題的判題有問題,開始怎麼交都WA,,過兩天什麼都沒改,再交就AC了 , 汗。。 * * 詳細代碼注釋: http://apps.hi.baidu.com/share/detail/24628400 * * Created on: 2011-10-3 * Author: */#include <cstdio>#include <cmath>#include

POI-step traversing a tree 樹的隔三遍曆(題目)

http://smalloj.com/problem.php?pid=19  Step Traversing a TreeTime Limit:1000msMemory Limit:64000KiBAccepted:0Submitted:0  POI II Stage 3 Problem 2Step Traversing a TreeA graph is a pair (V, E), where V is a finite set of elements called vertices of

poj-1837 Balance ***

/* [轉] * * d[i][j]表示在掛上前i個物體的時,平衡度為j * (j>0時表示左邊重,j=0時表示天平平衡,j<0時表示右邊重)時掛法的數量, * 而根據題意可以確定j的取值範圍為:[-7500,7500],於是可以得到狀態轉移方程為: * d[i][j]+=(d[i-1][j-weigh[k]*pos[i]]), * weigh[k]表示第k個掛鈎的位置,pos[i]為第i個砝碼的重量 *

poj-1703 Find them, Catch them ***

【轉】解析:並查集的題目,並查集的拓展。一般的思路是先初始化,各個數自成一個組,然後是兩個gangs自成一個組,但由於兩個給定元素有三種關係: Inthe same gang;  Indifferent gangs;  Notsure

將WIN8裝入隨身碟和移動硬碟教程

將WIN8裝入隨身碟和移動硬碟教程      在前面得文章裡我們向大家先容了Windows8(以下簡稱Win8)各種新特性,其中一個顯著的特性就是:Win8開始支援在USB裝置上啟動。這就意味著以後我們可以將Win8隨身攜帶。固然Win8還沒有正式發布,但我們也可以提前體驗Win8這個新特性。       移動Win8原理解析     

演算法導論-22.3-6 用棧實現DFS

自己寫的一個:#include <iostream>#include <stack>using namespace std;const int maxV = 100, white = 0, gray = 1, black = 2;int v, itime;struct SNode{ //節點 int color, d, f, num; SNode *p;};struct SAdj{ //鄰接表 int num;

poj-1459 Power Network *

/* * 最大流 Edmonds-Karp * * 加入兩個節點 S 和 T * S 與 所有 power stations相連 ; 所有 consumers 與 T 相連 **/#include <iostream>#include <cstring>using namespace std;const int inf = 100000000;const int maxN = 100 + 5;int n, np, nc, m, l[maxN][maxN], s,

poj-1195 Mobile phones *

/* 難得的1A題~~ 標準的樹狀數組 * 1195.cpp * 注意座標從0開始, 應處理成從1開始 * Created on: 2011-7-11 * Author:*/#include <cstdio>using namespace std;const int MAXS = 1024 + 5;int map[MAXS][MAXS] = {};int c[MAXS][MAXS] = {};int s, x, y , a, l, r, b, t,

UVa-10020 Minimal coverage **

1 /* 2 * Uva-10020 最少區間覆蓋-貪心 3 * 4 * 很直接的貪心。。 詳見劉汝佳 《奧賽入門經典》 5 * 6 * 測試資料: http://www.algorithmist.com/index.php/UVa_10020#Input 7 * 8 */ 9 10 #include <cstdio>11 #include <algorithm>12 using namespace std;13 14 const int maxN =

總頁數: 61357 1 .... 10331 10332 10333 10334 10335 .... 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.