原创 uva 843 Crypt Kicker

題目連接點擊打開鏈接 題意根據鑰匙解密,一對多時輸出(相同數)*,一對一時輸出解密信息 #include <iostream>#include <vector>#include <sstream> #include <algorithm>

原创 poj 2179

很基本的BFS題目。。。 不過開始畫紅線的部分沒有考慮到,結果RUNTIME ERROR了,悲劇。。     Catch That Cow Time Limit: 2000MS   Memory Limit: 65536K Total

原创 10132 - File Fragmentation

題意:n個相同的文件摔成2*n個文件碎片,而且每一個文件碎成二片!求原文件的序列,只有1與0 算法:貪心+暴力 連接:點擊打開鏈接 #include <stdio.h> #include <cstdlib> #include <iostr

原创 uva 10205 Stack 'em Up

題意  給你洗牌順序求洗牌後的結果 題目連接點擊打開鏈接 #include <stdio.h> struct list { int num[54]; }order[200]; void solve ( ) { int n, i,

原创 uva - 10198 - Counting

題意:有一個萌妹紙  分不清 1 和 4 (人家卡哇伊一點理解麼), 給你一個n, 有多少個每位相加的和等n的數,(人家特萌只喜歡1,2, 3, 4) 解法:簡單DP   dp[n] = dp[n-1] * 2 + dp[n-2] + d

原创 uva 10258 - Contest Scoreboard

題意  寫個rank 連接點擊打開鏈接 #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX 105 struct list { int nu

原创 uva 10082 - WERTYU

#include <stdio.h> #include <string.h> char str[1000000]; void solve ( char &ch ) { if ( '2' <= ch && ch <= '9' ) {

原创 uva 10044 Erdös Numbers

題意:有一個數學家名字是Erdos P. 與他一起發表過論文的人的Erdös Number 是 1 與Erdös Number是1的人發表過論文的是

原创 2012百度之星E題

#include"stdio.h" #include"string.h" #include"ctype.h" int main() { int i,j,fla1=1,fla2=1; char a[141]; gets(a); in

原创 uva_10213 - How Many Pieces of Land ?

題意:你在橢圓上選n個點, 連n*(n-1)條線,最多將圓分成幾塊。 算法:F(n) = 1 + C(n,2) + C(n,4); 錯誤原因: 給你一個int數,在for循環中判斷可能溢出,比如for(int i = xx, i <= n

原创 uva10010 - Where's Waldorf?

題意  在一個二維的字符數組中!找到給你單詞的開頭字母的位置!搜索方向是八個方向!注意只能是沿直線搜索不能跳躍! 連接:點擊打開鏈接 算法!模擬+單向DFS #include <stdio.h> #include <string.h>

原创 HDU 1443 約瑟夫問題

Problem Description The Joseph\\\\\\\'s problem is notoriously known. For those who are not familiar with the original

原创 10252 - Common Permutation

題意:按字典序輸出二個字符串相同的元素 算法:hash標記 連接:點擊打開鏈接 #include <stdio.h> int main ( ) { char str[1005], ch[1005]; while ( gets (

原创 hdu1290

http://acm.hdu.edu.cn/showproblem.php?pid=1290   這道題主要是平面劃分空間的遞推公式。 貌似初中好像學過。。。 都忘了,暈 還上網看了 推導公式、   (1)n條直線,最多可以把平面分爲多少

原创 2012百度之星J題

#include"stdio.h" int main() {  int i,j,mid,low,high,min=0x7fffffff,m,n,u,