原创 1031 Hello World for U (20 分)

1031 Hello World for U (20 分) Given any string of N (≥5) characters, you are asked to form the characters into the shap

原创 1036 Boys vs Girls (25 分)

1036 Boys vs Girls (25 分) This time you are asked to tell the difference between the lowest grade of all the male stude

原创 1076 Forwards on Weibo (30 分)

1076 Forwards on Weibo (30 分) Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followe

原创 1021 Deepest Root (25 分)

1021 Deepest Root (25 分) A graph which is connected and acyclic can be considered a tree. The height of the tree depend

原创 1013 Battle Over Cities (25 分)

1013 Battle Over Cities (25 分) It is vitally important to have all the cities connected by highways in a war. If a city

原创 1034 Head of a Gang (30 分)

1034 Head of a Gang (30 分) One way that the police finds the head of a gang is to check people's phone calls. If there

原创 1061 判斷題 (15 分)

1061 判斷題 (15 分) 判斷題的評判很簡單,本題就要求你寫個簡單的程序幫助老師判題並統計學生們判斷題的得分。 輸入格式: 輸入在第一行給出兩個不超過 100 的正整數 N 和 M,分別是學生人數和判斷題數量。第二行給出 M 個不超

原创 1089 狼人殺-簡單版 (20 分)(枚舉)

1089 狼人殺-簡單版 (20 分) 以下文字摘自《靈機一動·好玩的數學》:“狼人殺”遊戲分爲狼人、好人兩大陣營。在一局“狼人殺”遊戲中,1 號玩家說:“2 號是狼人”,2 號玩家說:“3 號是好人”,3 號玩家說:“4 號是狼人”,4

原创 1052 賣個萌 (20 分)

1052 賣個萌 (20 分) 萌萌噠表情符號通常由“手”、“眼”、“口”三個主要部分組成。簡單起見,我們假設一個表情符號是按下列格式輸出的: [左手]([左眼][口][右眼])[右手] 現給出可選用的符號集合,請你按用戶的要求輸出表

原创 馬走日(深度優先搜索)

002:馬走日 題目鏈接:http://cxsjsxmooc.openjudge.cn/2017t2summerfinal/002/ 總時間限制: 1000ms 內存限制: 1024kB 描述 馬在中國象棋以日字形規則移動。 請編寫一段程

原创 ~scanf()和scanf()!=EOF

兩者作用是相同的。 ~是按位取反 scanf的返回值是輸入值的個數 如果沒有輸入值就是返回-1 -1按位取反結果是0 while(~scanf("%d", &n))就是當沒有輸入的時候退出循環   EOF,爲End Of File的縮寫,

原创 Tian Ji -- The Horse Racing(貪心)

Tian Ji -- The Horse Racing Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Tot

原创 大盜阿福(動態規劃)

001:大盜阿福 題目鏈接:http://cxsjsxmooc.openjudge.cn/2017t2summerfinal/001/ 總時間限制: 1000ms 內存限制: 65536kB 描述 阿福是一名經驗豐富的大盜。趁着月黑風高,

原创 06-圖2 Saving James Bond - Easy Version (25 分)

06-圖2 Saving James Bond - Easy Version (25 分) This time let us consider the situation in the movie "Live and Let Die" i

原创 06-圖1 列出連通集 (25 分)

  06-圖1 列出連通集 (25 分) 給定一個有N個頂點和E條邊的無向圖,請用DFS和BFS分別列出其所有的連通集。假設頂點從0到N−1編號。進行搜索時,假設我們總是從編號最小的頂點出發,按編號遞增的順序訪問鄰接點。 輸入格式: 輸入