原创 Morgan Stanley OA題庫

原地址:http://blog.csdn.net/donhao/article/details/5661039 【Q1】 Which of the following statements accurately describe unar

原创 Google APAC Round D題解

Problem A. Dynamic Grid 最基礎的搜索,我用DFS做的,標記棋盤上每一個位置初始化爲未搜索,遍歷整個棋盤,如果遇到1且以前從沒搜索到的話就從該點開始不停搜索,直到搜完,複雜度O(m*n) 代碼 int m,

原创 第一篇博客

自己真是太渣了。。謹記

原创 Codeforces Round330 Div2題解

這次太狗血了,進行到一半結果C題有問題unrated了。 A題不寫了,比較簡單 B. Pasha and Phone 大意就是給長度爲n的數,分爲n/k部分,即每部分k個digit,所以總共有n/k個k位數。對於第i個數,求能被Ai整除

原创 Codeforces Round332 部分題解

A. Patrick and Shopping 應用Floyd-Warshall的想法,先把每兩點之間的最短距離更新了,然後最後的結果就是d1 + d2 + d3 #define FOR(a, b, n) for(int (a) = (