Time of Update: 2018-12-04
網上找的能AC的代碼:#include<stdio.h> #include<string.h> #include<math.h> int prime[1000000] = {0}; int main() { int T,i,j,n,num,max,k; char name[100],s[100]; prime[0]=prime[1]=1; for(i = 2; i <1000; i++) for(j =
Time of Update: 2018-12-04
//模板開始#include <string> #include <vector> #include <algorithm> #include <iostream> #include <sstream> #include <fstream> #include <map> #include <set> #include <cstdio>
Time of Update: 2018-12-04
Milk #include <iostream> #include <string> using namespace std; int main() { int T, n, money, v, day; int vmin; double imin, temp; string brand, strmin; cin >> T; while (T--) { cin >> n; imin = -1.0;/
Time of Update: 2018-12-04
The 3n + 1 problem#include <iostream> #include <vector> using namespace std; int main() { int m,n; while (cin>>m>>n) { int result=0,max,min; //①此處最為關鍵,因為題目中並未指明輸入大的在前
Time of Update: 2018-12-04
由於OpenCV2.2裡面,把原來的CvvImage整個類給刪除掉了,因此在MFC下使用帶來諸多不方便,大家可以通過提前opencv2.1中的代碼的方法來解決(弄一個h檔案和一個cpp檔案,然後放到你的項目裡面一起編譯就可以了)。但是在s2010中會出現error C2039: “DrawToHDC”: 不是“ATL::CImage”的成員的錯誤。這主要是因為命名衝突引起的,引入命名空間可以解決。將CvvImage.h的倒數第二句改成:namespace cv{typedef CvvImage
Time of Update: 2018-12-04
由於導師不讓實習,所以找的也少,隨便投了一下,簡曆都沒填完整,就接收到面試通知,可見,即使不能走內部推薦,很多機會也都可以嘗試一下,不是一定要簡曆非常nb。 14:00
Time of Update: 2018-12-04
昨天hr約了今天二面,快兩點的時候電話響起。說簡曆不完整,讓我發一個過去,又是這個問題。趕緊發往她給的郵箱。兩點過幾分,電話響起。010的。接了百度的,問有空嗎?是否開始。開始。。先是讓自我介紹一下,這次基本上跟上次一樣說了。不過貌似講得更熟練了。簡略說說,應該對方也不喜歡太囉嗦的吧。然後,先問一個演算法題。一個數組,包含0-9的數,不重複,不確定個數。用這些數字組合的數中能被2,,3,5同時整除的最大的數字。比如說,1, 3, 2 三個數字,可以組成123,132, 23, 13等等。問我
Time of Update: 2018-12-04
(轉)這是VC6.0的一個相容性問題,可以按官方方法試一下原因:VC與VISIO衝突解決方案:1. 下載FileTool.exe,並解壓http://support.microsoft.com/kb/241396/zh-cn2. 開啟VC6.0,點擊File-Open Workspace,選擇剛解壓出來的FileTool.dsw,並確定3. 點擊Bulid-Build FileTool.dll,產生FileTool.dll檔案4. 把產生的FileTool.dll檔案拷貝到合適的地方(避免誤刪)
Time of Update: 2018-12-04
#include<iostream>#include<string>#include <iomanip>using namespace std;int main(){int n, m;int temp;char ch[101];string s;cin>>n;double count_line;double count_case;for(int i = 0; i < n; i++){//處理每個casecount_case =
Time of Update: 2018-12-04
轉自:http://bash.cyberciti.biz/guide/$IFSThe IFS is a special shell variable.You can change the value of IFS as per your requirments.The Internal Field Separator (IFS) that is used for word splitting after expansion and to split lines into words with
Time of Update: 2018-12-04
/* 求[1,n]內有多少個數字,該數字有13,且能被13整除 n<=10^9 x % 13 = 0 (pre*10^pos + next) % 13 = 0 pre是之前確定的部分 需要的參數為pre , pos , 狀態have have記錄pre擁有"13",pos+1位為"1",沒有"13" 分別用have = 2,1,0表示 然後記憶化搜尋*/#include <cstdio>#include
Time of Update: 2018-12-04
vc不通過,提交通過#include<stdio.h>#include<stdlib.h>struct c{int x;int y;int ord;}d[100];int cmp(const struct c *a, const struct c *b){ if ((*a).x == (*b).x) return (*a).y - (*b).y; else return (*a).x - (*b).x;}int
Time of Update: 2018-12-04
題目大意: 終於放寒假了,小明要和女朋友一起去看電影。這天,女朋友想給小明一個考驗,在小明正準備出發的時候,女朋友告訴他,她在電影院等他,小明過來的路線必須滿足給定的規則: 1、假設小明在的位置是1號點,女朋友在的位置是n號點,則他們之間有n-2個點可以走,小明每次走的時候只能走到比當前所在點編號大的位置; 2、小明來的時候不能按一定的順序經過某些地方。比如,如果女朋友告訴小明不能經過1 -> 2 ->
Time of Update: 2018-12-04
#include <cv.h>#include <cxcore.h>#include <highgui.h>int main(){//聲明IplImage指標IplImage* pFrame = NULL;IplImage* pFrImg = NULL;IplImage* pBkImg = NULL;CvMat* pFrameMat = NULL;CvMat* pFrMat = NULL;CvMat* pBkMat = NULL;CvCapture*
Time of Update: 2018-12-04
該程式是用圖的鄰接舉著實現的。如果想用圖的鄰接鏈表實現DFS演算法,只要把該程式中的firstAdj()和nextAdj()以及圖的建立等操作改用鄰接鏈表實現即可,其他的如DFS主程式架構可以不用修改。temp.cpp//圖的深度優先搜尋(DFS)//圖用鄰接矩陣表示#include<iostream>#include<fstream>#include "temp.h"using namespace std;int LocateVex(MGraph G,
Time of Update: 2018-12-04
dp[i][j] 表示a(1,i),b(1,j)取以a[i], b[j]結尾的最大公用上升子串的大小#include <iostream>using namespace std;const int N = 205;int dp[N][N];int a[N];int main() {int t;cin >> t;while(t--) {int n;cin >> n;for(int i = 1; i <= n; i++) {scanf("%d", &
Time of Update: 2018-12-04
轉自:http://blog.csdn.net/starlee/article/details/1774117 簡單易懂在開發中,經常會用到一些數組,它裡面存放一定數量(已知,不是太多)的特定元素。在使用數字表示的數組下標訪問數組中元素的時候,根本不知道該元素是否是需要的那個元素,而且使代碼可讀性降低,甚至還會出現下標越界的危險。
Time of Update: 2018-12-04
Manacher演算法學習: http://blog.csdn.net/vsooda/article/details/8725580代碼1:轉自http://blog.csdn.net/sprintfwater/article/details/8709458#include <stdio.h>#include <string.h>#include <stdlib.h>#define MAXN 100005int a[MAXN * 2];struct
Time of Update: 2018-12-04
參考:http://www.cppblog.com/Yuan/archive/2013/03/09/139299.html#198320用這種方法寫,一個流程是,列出式子(pre*10^pos + next) pre是確定的,next是變數 所以參數就為pre,pos加上一些其他的,還有一個標記doing,表示是計算有上界限制的還是沒有上界限制(所有情況,即end=9) dfs(pos-1 , npre , doing && i
Time of Update: 2018-12-04
這下必須記錄一下了。這東西實在太煩了,搞了好久。兩個錯誤很煩 Cannot connect creator comm socket 和 Circular all <- first dependency dropped.嘗試過很多方法,一下方法可行。別的也許可行,本人沒搞定。。1. opencv 安裝參考http://www.samontab.com/web/2012/06/installing-opencv-2-4-1-ubuntu-12-04-lts/非常完整,應該沒有失敗的可能。2.