原创 1056. Mice and Rice

好奇怪的表達方式,這道題的英文給跪了 第三行的序列居然是給出依次要進行比較的老鼠的標號。 11 3 25 18 0 46 37 3 19 22 57 56 10 6 0 8 7 10 5 9 1 4 2 3 先比較第6,0,8號老鼠,此

原创 深入淺出MFC學習筆記:MFC六大關鍵技術仿真之永續生存

永續生存 MFC中很重要的一個模塊:負責實現資料的讀寫過程,即數據該怎麼去保存到硬盤中和從硬盤中取出來。 參考文獻:深入淺出MFC-侯捷 對象導向有一個術語:Persistence,有了此機制之後,對象就能永續保存。 MFC有一套Seri

原创 1025. PAT Ranking

//sort// 1025. PAT Ranking.cpp: 主項目文件。 #include "stdafx.h" #include <cstdio> #include <cstring> #include <algorithm> u

原创 1033. To Fill or Not to Fill

cars refueling problem:with greedy algorithm go to http://blog.csdn.net/newner/article/details/8637065 點贊 收藏

原创 1019. General Palindromic Number

// 1019. General Palindromic Number.cpp: 主項目文件。 #include "stdafx.h" #include <cstdio> bool isPalindromic(int *arr, in

原创 1012. The Best Rank

// 1012. The Best Rank.cpp: 主項目文件。 #include "stdafx.h" #include <cstdio> #include <cstring> #include <algorithm> using

原创 題目1494:Dota

學習完全揹包 // 題目1494:Dota.cpp: 主項目文件。 #include "stdafx.h" #include <cstdio> #include <cstring> #define max(a,b) a>b?a:b c

原创 題目1347:孤島連通工程

http://ac.jobdu.com/problem.php?pid=1347 用getchar讀取數據居然可以少這麼多,比起scanf整整少了320ms 並查集優化: (1)路徑壓縮 我們找到最久遠的祖先時“順便”把它的子孫直接連接到

原创 深入淺出MFC學習筆記:MFC六大關鍵技術仿真之動態生成

動態生成 參考文獻:深入淺出MFC-侯捷 開始着手剖析動態生成的實現 有了類別型錄網,就可以開始着手解決棘手的動態生成問題。動態生成的困難點在於你沒有辦法在程序執行期間,根據動態獲得的一個類別名稱(通常是讀檔),要求程序產生一個對象。如果

原创 1008. Elevator

// 1008. Elevator.cpp: 主項目文件。 #include "stdafx.h" #include <cstdio> int main() { int n; scanf("%d",&n); int sum

原创 1011. World Cup Betting

// 1011. World Cup Betting.cpp: 主項目文件。 #include "stdafx.h" #include <cstdio> char getKey(int pos){ if(pos==0) return

原创 socket 單步調試正確,F5調試錯誤,運行也錯誤的解決方案

引用icansaymyabc的話語:解決方案如下 socket程序是與操作系統緊密相關的,它異步調用了各種系統資源。 你的問題我見得多了,實質上就是在socket的異步操作尚未得到應答之前你的單線程工作流已經把socket對象銷燬了。單步

原创 1034. Head of a Gang

study disjoint-set data stucture:the key of solving this problem is the strategy to set and compute every equivalence

原创 1037. Magic Coupon

Two arrays:NC[],NP[] Supposed that two points (l1 and r1)start from the head and the tail of the array of NC seperately

原创 1031. Hello World for U

// 1031. Hello World for U.cpp: 主項目文件。 #include "stdafx.h" #include <cstdio> #include <cstring> int main() { int