sdut2167 Mathman Bank

這種題考的是細心strcmp()和memcpy()都能實現字串的複製,但兩者還是有明顯區別的,詳見http://www.cnblogs.com/stoneJin/archive/2011/09/16/2179248.html#include<iostream>#include<cstring>#include<cstdio>using namespace std;struct cell{char name[15];char mima[15];int

sdut1916 字串擴充

#include<iostream>#include<cstdio>#include<cstring>using namespace std;char a[1005];int main(){int t;int len;int i,j;scanf("%d",&t);getchar();while(t--){gets(a);len=strlen(a);printf("%c",a[0]);for(i=1;i<len;i++){if(a[i]=='-'&

poj1251 hdu 1301 Jungle Roads

#include<iostream>#include<cstring>#include<cstdio>using namespace std;int dis[28][28];int cost[28];int n;int prim(int s){int i,j;for(i=0;i<n;i++)cost[i]=dis[s][i];cost[s]=-1;int sum=0;int

免費圖書網址

中國數字圖書館 http://www.d-library.com.cn/ ; 權威的線上圖書館。 瑞德超星線上圖書館 http://www.rol.cn.net/library ;規模大,藏書豐富,包括社會科學、人文科學、自然科學等領域的著作和曆史文獻等。可是…下載圖書要花錢噢。  全景中文圖書 http://www.cnovel.com/ ; 中文圖書收集下載。 E書時空 (推薦) http://www.eshunet.com/ ; 大量圖書免費下載,門類繁多,而且不花錢! 大唐中文書庫

經典的25句話

1、記住該記住的,忘記該忘記的。改變能改變的,接受不能改變的。2、能沖刷一切的除了眼淚,就是時間,以時間來推移感情,時間越長,衝突越淡,彷彿不斷稀釋的茶。3、怨言是上天得至人類最大的供物,也是人類禱告中最真誠的部分。4、智慧的代價是矛盾。這是人生對人生觀開的玩笑。5、世上的姑娘總以為自己是驕傲的公主(除了少數極醜和少數極聰明的姑娘例外)6、如果敵人讓你生氣,那說明你還沒有勝他的把握。7、如果朋友讓你生氣,那說明你仍然在意他的友情。8、令狐沖說“有些事情本身我們無法控制,只好控制自己。”

sdnuoj1012 區間合并

1012.區間合并Time Limit: 1000 MS    Memory Limit: 32768 KBTotal Submission(s): 75    Accepted Submission(s): 15Description給定n個開區間,合并他們中的重合者,輸出合并後的區間數量。Input第一行:n(1 <= n <= 1000)第2至第n+1行:每行兩個整數,第i行的兩個整數表示第i-1個區間的左邊界和右邊界。Output合并後所剩餘的區間數量。Sample

sdnuoj1011 盒子與球

1011.盒子與球Time Limit: 1000 MS    Memory Limit: 32768 KBTotal Submission(s): 39    Accepted Submission(s): 14Description現有r個互不相同的盒子和n個互不相同的球,要將這n個球放入r個盒子中,且不允許有空盒子。則有多少种放法?Inputn, r(0 <= n, r <= 10)。Output有多少种放法。Sample Input3 2Sample Output6斯特靈數,

高階冪模數問題

056.A ^ B PROBLEMTime Limit: 1000 MS    Memory Limit: 32768 KBTotal Submission(s): 80    Accepted Submission(s): 25Description給定三個數A, B, K, 求 A的B次方除以K的餘數 。Input輸入只有一行,為三個正整數A(1 <= A <= 2000000000), B(1 <= B <= 2000000000), K(1 <= K

HDU1202 無語題

        這一題WA了8次。再看討論時,罵聲一片!個人也覺得這題出的不好。貼在這,供後來者借鑒。 #include<iostream>#include<iomanip>using namespace std;double judge_score(int tem) //分數對應的點數,題目給出的只是整數,所以調用時要強制類型轉化{if(tem>=90 && tem<=100)return 4.0;else if(tem>=80

sdut2164 Binomial Coeffcients

不懂的太多了!對於此題:1. c [i] [j] = c [i-1] [j-1] + c [i-1] [j] 2. mod操作滿足加法性質,即(a + b) mod c = ( (a mod c) + (b mod c) ) mod

sdut2157 Greatest Number

Greatest NumberTime Limit: 1000ms   Memory limit: 65536K 題目描述    Saya likes math, because she think math can make her cleverer.    One day, Kudo invited a very simple game:    Given N integers, then the players choose no more than four integers from

poj2236 Wireless Network

#include<iostream>#include<cstring>#include<cstdio>using namespace std;struct cell{bool set;int x;int y;}a[1010];bool vis[1010][1010];int root[1010];int n,d;bool dis(cell a,cell b){if((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y)<=d*d)

HDU1205 吃糖果

這題通過率不是很高,所以把自己的代碼貼在這,供大家交流!我的解題思路:總共n種糖果,每種a[i]個。那麼可以這樣解決問題。如果某種糖果個數越多則先吃。比如5種糖果,個數如下5 1 1 1 1。如果先吃個數為1的糖果,那麼個數為5的那種糖果肯定吃不完;如果先吃個數為5的那種糖果,那麼將能夠吃完。(個人理解,無法確切證明!!!)代碼大概:①用堆排序按每種糖果個數減排序排列a[n]。②函數judge_eat()則來判斷能否吃完。方法是:tem用來記錄每兩種吃剩下的糖果,開始賦值為0。如果tem>

HDU1248 1407 for迴圈暴力

           這兩題解題思想相同,貼在這做個對照。           都是三重for自動計算。           1248寒冰王座/*給小費最少,買東西花費最多即可*/#include<iostream>using namespace std;int main(){int t,n;int a,b,c;cin>>t;while(t--){cin>>n;a=n/150;b=n/200;c=n/350;int max=-1;int

hdu4513 吉哥系列故事——完美隊形II

終於AC了,最長迴文串的變形#include<iostream>#include<cstring>#include<cstdio>using namespace std;int a[200010];int p[200010];int cnt;int manacher(){ int i,mx=0,id,ans=-1; for(i=1;i<=cnt;i++){ if(mx>i) p[i]=min(p[2*

zoj1008-gnome tetravex

#include<iostream>#include<cstdio>#include<cstring>using namespace std;int box[25][4],f[25][4],icon[25];int n,qcur;bool ans;void dfs(int cur){if(cur==n*n||ans){ //沒有判斷ans為真時返回,導致狂TLE,打擊深重ans=1;return;}int i;if(cur<n){for(i=0;i&

hdu3068 最長迴文 poj3974 Palindrome(Manacher演算法)

#include<iostream>#include<cstring>#include<cstdio>#include<string>using namespace std;char a[110005],str[220010];int p[220010];int cnt;void Manacher(){ int i,mx=0,id; for(i=1;i<cnt;i++){ if(mx>i)

【模板】最長公用上升子序列

Description:給定兩個序列A,B,其長度分別為N,M,現在要你求出這兩個序列中最長的一個公用子序列,並使這個子序列遞增。比如數列{1,2,0,4,5}和{1,0,4,5,2},其最長公用上升子序列就是{1,4,5},長度為3。Input:第一行:一個N;第二行:N個數,為數列A;第三行:一個M;第四行:M個數,為數列B。Output:一個數,為最長公用上升子序列的長度。Sample Input:51 2 0 4 551 0 4 5 2Sample Output:       

sdut2151 Phone Number

用trie樹做的#include<iostream>#include<cstring>#include<cstdio>using namespace std;struct node{bool set;node *next[10];node(){set=0;memset(next,NULL,sizeof(next));}};char a[1010];bool flag=0;void insert(char str[],node *root){node

hdu4427 Math Magic

#include<iostream>#include<cstring>#include<cstdio>using namespace std;const int MOD=1000000007;int dp[2][1010][1010];int num[1000],LCM[1010][1010];int gcd(int a,int b){ if(b==0) return a; return gcd(b,a%b);}int lcm(int a,int

總頁數: 61357 1 .... 17150 17151 17152 17153 17154 .... 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.