0w1

Entries from 2016-04-02 to 1 day

CFR 129 C. Statues ( BFS )

Problem - C - Codeforces WA了一次,以為只會原地待著,或往上或往右或往右上移動。仔細想想,這全部方向都得考慮。 #include <bits/stdc++.h> using namespace std; const int MAXH = 8 + 2; const int MAXW = 8 + 2; typedef pair< int, int > pii; char G[ MAXH ][ MAXW</bits/stdc++.h>…

CFR 129 B. Students and Shoelaces ( DFS )

Problem - B - Codeforces 把度數和邊的變量維護好就很簡單。 #include <bits/stdc++.h> using namespace std; const int MAXN = 100 + 2; const int MAXM = MAXN * MAXN / 2; int n, m; vector< int > G[ MAXN ]; int deg[ MAXN ], d_deg[ MAXN ]; void solve(){ int cnt =</bits/stdc++.h>…

CFR 129 D. String ( Priority Queue )

Problem - D - Codeforces 因為關鍵的只有最小的10萬個,所以可以用priority queue模擬。不過現在這個方法過不了,因為judge time 變成兩倍。抓了別人的code來測試果真如此。雖然說有另一種解法是用後綴陣列,我這禮拜要趕緊學起來。 #include <bits/stdc++.h> using namesp</bits/stdc++.h>…