題目: You are given a rectangular field of n × m cells. Each cell is either empty or impassable (contains an obstacle). Empty cells are marked with '.', impassable cells are marked with '*'. Let's call two empty
Longest Ordered Subsequence A numeric sequence of ai is ordered if a1 < a2 < ... < aN. Let the subsequence of the given numeric sequence (a1, a2, ..., aN) be any sequence (ai1, ai2, ..., aiK), where 1 <= i1 < i2 < ... <
這道題目估計大家會很熟悉,的確和前面那個找幸運數很相同,不過有不同,就是規則不同,這裡就是能整除幸運數的也是幸運數,由於數目的範圍很小,所以可以先找出1000內包含4或者7的幸運數,在暴力找出。 #include <iostream> #include <cstdio> #include <cstring> using namespace std; int main() { int i; int a[
初次接觸,https://www.cnblogs.com/liu-runda/p/6262832.html,通過這個部落格學習的建圖方式。建好圖後套板子即可。 #include <bits/stdc++.h>using namespace std;const int MAXN = 300;const int INF = 0x7fffffff;struct edge{ edge(){} edge(int _to, int _cap, int _rev, int _id)
設計模式之命令模式11 背景 正常做一個項目,有客戶,需求組,美工組,開發組。然後專案經理負責統籌整個項目的進度和安排。 這時,客戶找到專案經理說任何一個事情,增加需求,刪除需求,增加頁面,修改頁面等等。這樣就造就了命令模式 類圖 代碼實現 首先要定義各個組的抽象類別 public abstract class Group { public abstract void add(); public abstract void delete();