Time of Update: 2018-12-04
成段更新(通常這對初學者來說是一道坎),需要用到延遲標記(或者說懶惰標記),簡單來說就是每次更新的時候不要更新到底,用延遲標記使得更新延遲到下次需要更新or詢問到的時候#include <iostream>using namespace std;#define lson l, m, rt << 1#define rson m+1, r, rt << 1 | 1const int maxn = 111111;int h, w, n;int col[maxn
Time of Update: 2018-12-04
題意:在牆上貼海報,海報可以互相覆蓋,問最後可以看見幾張海報思路:這題資料範圍很大,直接搞逾時+超記憶體,需要離散化:離散化簡單的來說就是只取我們需要的值來用,比如說區間[1000,2000],[1990,2012]
Time of Update: 2018-12-04
說來慚愧,研究生二年級了,第一次對整個科研流程有個大概了瞭解。要感謝電腦視覺演算法與應用這本書。後面附錄包括了很多能用的資源,我做的是第14章行人檢測的boost演算法。http://people.csail.mit.edu/torralba/shortCourseRLOC/boosting/boosting.html按照實驗步驟做下來幾乎沒有問題。主要有幾點:1. 教程中沒有建立資料庫的步驟,需要下載 LabelMe
Time of Update: 2018-12-04
外行人做互連網,很多概念不懂。就拿最基礎的“召回率”和“準確率”這種概念,看看網上資料知道大概,自己用的時候,腦子裡繞著彎兒能想明白,可碰到別人活用的時候,腦子裡還是沒法一下子反應過來,還是要繞彎想一下。特地找了些資料,將這兩個概念整理一下,希望能更熟練。召回率和準確率是搜尋引擎(或其它檢索系統)的設計中很重要的兩個概念和指標。召回率:Recall,又稱“查全率”;準確率:Precision,又稱“精度”、“正確率”。在一個大規模資料集合中檢索文檔時,可把集合中的所有文檔分成四類:
Time of Update: 2018-12-04
#include<iostream>#include<cstdio>#include<cstring>using namespace std;const long long INF = 1e18;const int VN = 105;int n;int m;long long d[VN][VN];long long X[VN];long long L1,L2,L3,L4;long long C1,C2,C3,C4;inline long long
Time of Update: 2018-12-04
FFT 濾波器 FFT filtersVGA 調色盤和許多其他參數 VGA palette and many others按名稱排序 sort by name包括角度和刻度 including angle and scale保持目標 keep targets儲存 save儲存和裝載 save and load飽和度 saturation飽和加法和減法 add and subtract with saturate背景淡化 background flatten背景發現 find
Time of Update: 2018-12-04
與編輯距離思想類似,但是編輯距離每次只能增刪改。還涉及到字串的對齊問題。http://blog.csdn.net/vsooda/article/details/8313172而本題每次修改就修改一個區間。自然地,使用dp[i][j]表示從i 到 j 所需要的修改次數的上界。初始化dp[i][j]為dp[i+1][j] + 1如果s2[i] == s2[k] dp[i][j] = min(dp[i][j], dp[i+1][k] + dp[k+1][j]) 因為i 和 k相同 所以i 和
Time of Update: 2018-12-04
最近一直在做數位影像處理方面的項目,感覺有必要將相關的知識整理一下。 標題取得很大,映像工程其實是一個很廣泛的概念,包含了影像處理、映像分析、映像理解三個層次,目前參與的項目主要與影像處理與分析相關,映像理解方面的東西瞭解還不是很多,希望以後能有更多深入的機會。 映像工程的三個層次: 影像處理: 映像分析: 映像理解:
Time of Update: 2018-12-04
水。。#include <iostream>using namespace std;const int N = 105;const int INF = 0x1fffffff;int map[N][N];int D[N];int flag[N];int n, m;void init(){for(int i = 0; i < N; i++)for(int j = 0; j < N; j++)map[i][j] = INF;for(int i = 1; i <= N;
Time of Update: 2018-12-04
求道路的交叉點數。將道路按左邊城市從大到小排序。如果相同則按右邊從大到小排序。這樣就跟stars和cows一樣了。#include <iostream>#include <algorithm>using namespace std;const int maxn = 1010;int c[maxn],result[maxn];typedef struct{int e, s;} node;node nd[maxn * maxn];bool cmp(node a , node
Time of Update: 2018-12-04
#include<iostream.h>#include<stdlib.h>#include <fstream.h>#include<time.h>#include<math.h>typedef struct{int weight;int value;}item;double Random(){return (double)rand()/RAND_MAX;}int Randomi(int i,int j){return i+rand()
Time of Update: 2018-12-04
思路:狀態壓縮DP。很經典的狀態壓縮DP。用int型來表示每行的狀態(如果int型的二進位的第i位為1,則表示這一行的第i列有安裝大炮)。這樣的話由於最多有10列,故由計算可得最多有60種狀態。DP部分:dp[r][i][k]表示第r行的狀態為k,第r-1行的狀態為i時候,前r行最多能夠安裝的大炮數量。 #include<iostream>#define max(a,b) ((a)>(b)?(a):(b))using namespace std;int map[105];//
Time of Update: 2018-12-04
代碼中對輸入輸出的操作符重載要學習。這個題目的主要問題是幹擾資訊太多了。1. 按照英美的日曆的標準就是1752年之後算閏年的方法才改變的。2. 要知道某一天是星期幾,必須知道 1.1.1 是星期幾#include <iostream>#include <string>using namespace std;const string MonthName[]={"January", "February", "March", "April", "May", "June",
Time of Update: 2018-12-04
文章目錄 問你長度為N的串中不包含了模式串的串有幾個問你長度為1~N的串中包含了模式串的串總共有幾個 矩陣乘法:http://blog.csdn.net/vsooda/article/details/8510131構造trie圖,繼而構造出初始矩陣,mat[i][j]表示i走到j有幾種走法 ,這個矩陣自乘n次之後就表示i走到j走n步有幾種走法問你長度為N的串中不包含了模式串的串有幾個n屬於1 ~
Time of Update: 2018-12-04
題意:給出平面上的一些點,要求用一個最小的圓,把所有的點包圍起來。最小覆蓋圓,
Time of Update: 2018-12-04
用了string,如果不用會麻煩很多。#include <iostream>#include <string>using namespace std;int main(){int t;cin >> t;while(t--){int n;cin >> n;string id, start, end;cin >> id >> start >> end;string idstart, idend, startmin,
Time of Update: 2018-12-04
類似01背包。用hs[n]= 1表示是否可達。可以證明如果飯卡的錢大於5的話,必然會點價格最高的菜。所以問題轉化為求m-5範圍內點菜。越接近越好。這就是01背包。。#include <iostream>using namespace std;const int N = 1105;int hs[N];int price[N];int main(){int n, m;while(scanf("%d", &n), n){memset(hs, 0,
Time of Update: 2018-12-04
走AB這條路的前提是: B到home的最短路比A到home的最短路要短,求滿足這個要求的office到home的路有多少條SPFA:參考http://sgeteternal.iteye.com/blog/1148891spfa比dijkstra極大程度減少不必要的鬆弛操作。故而比dij快。#include <iostream>#include <vector>#include <cstdio>#include <cstdlib>#include &
Time of Update: 2018-12-04
類似上題。#include <stdio.h>#include <string.h>#define inf 0x7fffffffstruct{int v, pow, next;}edge[52*52*4];int n = 0, map[52][52], head[52*52], dis[52*52], dir[4][2] = {{-1, 0}, {0, -1}, {0, 1}, {1, 0}};__int64 choise[52][52];void init()//建圖{
Time of Update: 2018-12-04
#include<iostream>#include<string>using namespace std;int main(){ int n, m; string s; cin>>n; char ch[2]; for(int i = 0; i < n; i++){//對每個case處理 cin>>m; bool flag = false; for(int j = 0;