鍘熷垱棰樼洰 鐧介摱涔嬫槬 Problem and Solution

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了鍘熷垱棰樼洰 鐧介摱涔嬫槬 Problem and Solution相关的知识,希望对你有一定的参考价值。

鏍囩锛?a href='http://www.mamicode.com/so/1/xpl' title='xpl'>xpl   ios   hang   鍑虹幇   const   宸﹀彸   ati   鏃犳硶   姣旇緝   

鐧介摱涔嬫槬 Solution

姣旇禌鐢ㄩ闈€侀瑙c€佹爣绋嬪拰鏁版嵁鐢熸垚鍣ㄩ兘鎸傚湪 git@github.com:sun123zxy/spring.git 涓娿€?/p>

Problem

鐧介摱涔嬫槬 (spring.cpp/.in/.out) (2s,512MB)

Background

濡栨ⅵ姝e湪鏀堕泦鏄ュ害锛?/p>

Description

骞绘兂涔$敱 (n) 涓湴鐐瑰拰 (m) 鏉″崟鍚戝皬璺粍鎴愶紝绗?(i) 涓湴鐐硅暣鍚潃 (s_i) 鐨勬槬搴︺€傚姊︿粠浣嶄簬 (1) 鍙疯妭鐐圭殑鐧界帀妤煎嚭鍙戯紝娌垮浘涓婅矾寰勬敹闆嗘部璺殑鏄ュ害锛屾€绘槬搴︿负鏀堕泦鍒扮殑鎵€鏈夋槬搴︿箣鍜屻€?/p>

鍗婁汉鍗婄伒鐨勫姊﹀叿鏈変竴绉嶅悕鍙€滀汉濡栨Ы鈥濈殑灞炴€э紝璇ュ睘鎬ф湁涓ょ鐘舵€佲€斺€斺€滀汉绫婚€㈤瓟鈥濅笌鈥滃鎬€㈤瓟鈥濓紝鍑哄彂鏃剁姸鎬佷负鈥滀汉绫婚€㈤瓟鈥濄€傛煇浜涘皬璺笂鍙兘琚斁缃簡鈥滄.缃楃粨鐣屸€濄€傚湪缁忚繃琚斁缃粨鐣岀殑灏忚矾鏃讹紝濡栨ⅵ鐨勪汉濡栨Ы鐘舵€佸皢浼氬彂鐢熷彉鍖栤€斺€旇嫢缁忚繃杩欐潯灏忚矾鍓嶄汉濡栨Ы鐘舵€佷负鈥滀汉绫婚€㈤瓟鈥濓紝鍒欑粡杩囧悗灏嗗彉涓衡€滃鎬€㈤瓟鈥濓紱鍙嶄箣锛岃嫢缁忚繃鍓嶇姸鎬佷负鈥滃鎬€㈤瓟鈥濓紝鍒欑粡杩囧悗灏嗗彉涓衡€滀汉绫婚€㈤瓟鈥濄€傚綋涓斾粎褰撲汉濡栨Ы鐘舵€佷负鈥滃鎬€㈤瓟鈥濇椂锛屽姊︽墠鍙互鏀堕泦鍒板綋鍓嶆墍鍦ㄥ湴鐐规墍钑村惈鐨勬槬搴︺€?/p>

姣忎釜鐐圭殑鏄ュ害鍙兘琚敹闆嗕竴娆°€傚姊﹀彲浠ュ湪鍥句笂浠绘剰娓歌蛋锛屽苟鍙互閫夋嫨鍦ㄤ换鎰忎竴涓湴鐐瑰仠姝㈡敹闆嗐€?/p>

濡栨ⅵ甯屾湜鏀堕泦鍒扮殑鎬绘槬搴︽渶澶э紝浣嗗ス骞舵病鏈夊杩嘜I锛岃浣犲府蹇欑畻鍑哄ス鏈€澶氳兘鏀堕泦鍒板灏戞槬搴︺€?/p>

鍥犱负骞堕潪鎵€鏈変汉閮藉叿鏈夌粨鐣屽唴鐨勫父璇嗭紝濡栨ⅵ涔熸彁渚涗簡涓€浠介鎰忕畝杩?锛?/p>

缁欏畾涓€涓甫鐐规潈鏅€氭湁鍚戝浘鍜屼竴鍙叿鏈?(0/1) 鐘舵€佺殑濡栨ⅵ锛屼粠 (1) 鍙疯妭鐐瑰嚭鍙戯紝鍒濆鐘舵€佷负 (0) 銆傝竟鏈?(0/1) 杈规潈锛岀粡杩囪竟鏃剁姸鎬佽寮傛垨涓婅竟鏉冦€傚綋鍓嶇姸鎬佷负 (1) 鏃跺彲鍙栧緱鎵€鍦ㄧ偣鏉冿紝鐐规潈鍙兘琚彇寰椾竴娆°€傞棶鍦ㄥ浘涓婇殢鎰忔父璧板彲鑾峰緱鐨勬渶澶х偣鏉冨拰銆?/p>

Input

绗竴琛屽洓涓暣鏁?(n) 锛?(m) 锛岃〃绀哄浘鐢?(n) 涓偣锛?(m) 鏉¤竟鏋勬垚銆?/p>

鎺ヤ笅鏉ヤ竴琛屾湁 (n) 涓暣鏁?(s_i) 锛岃〃绀?span class="math inline">(i)鍙疯妭鐐硅暣鍚?(s_i) 鐨勬槬搴︺€?/p>

鎺ヤ笅鏉?(m) 琛屾瘡琛?(3) 涓暣鏁?(u_i) 锛?(v_i) 锛?(w_i) 锛岃〃绀烘湁涓€鏉′粠 (u_i) 鍒?(v_i) 鐨勬湁鍚戣竟锛岃嫢 (w_i = 1) 锛屽垯琛ㄧず璇ュ皬璺笂琚斁缃簡妫綏缁撶晫锛岃嫢 (w_i = 0) 锛屽垯琛ㄧず鏈鏀剧疆銆?/p>

Output

杈撳嚭涓€琛屼竴涓暣鏁帮紝琛ㄧず濡栨ⅵ鑳芥敹闆嗗埌鐨勬渶澶ф€绘槬搴︺€?/p>

Sample 1

Sample 1 Input

5 6
99 82 44 35 3
1 2 1
2 3 0
3 4 1
4 5 0
2 4 1
3 5 1

Sample 1 Output

126

Sample 1 Explanation

璺緞涓?(1) -> (2) -> (3) 锛屽彲鑾峰緱 (0 imes 99 + 1 imes 82 + 1 imes 44=126) 鐐规槬搴︺€?/p>

Sample 2

Sample 2 Input

9 10
9 9 8 2 4 4 3 5 3
1 2 0
2 3 1
3 2 0
3 4 0
4 5 1
5 6 0
6 4 1
2 5 0
7 8 1
9 8 1

Sample 2 Output

25

Sample 2 Explanation

璺緞涓?(1) -> (2) -> (3) -> (2) -> (5) -> (6) 锛屽彲浠ヨ幏寰?$0 imes 9 + 0 imes 9 + 1 imes 8 + 1 imes 9 + 1 imes 4 + 1 imes 4= 25 $ 鐐规槬搴︺€?/p>

Sample 3

瑙?sample 鐩綍涓?spring3.in/.ans 銆?/p>

璇ユ牱渚嬫槸涓€涓棤鐜浘銆?/p>

Sample 4

瑙?sample 鐩綍涓?spring4.in/.ans 銆?/p>

Constraints

瀵逛簬30%鐨勬暟鎹紝淇濊瘉鍥句腑鏃犵幆銆?/p>

瀵逛簬鍙﹀20%鐨勬暟鎹紝淇濊瘉鍥鹃殢鏈虹敓鎴愩€?/p>

瀵逛簬100%鐨勬暟鎹紝 (2 le N le 5 * 10^5) 锛?(1 le M le 10^6) 锛?(0 le s_i le 10^9) 锛?(1 le u_i,v_i le N) 锛?(w_i in { 0,1 }) 銆?/p>

Hints

鐢变簬骞绘兂涔′笉鍙楀父璇嗘潫缂氾紝涓嶄繚璇佷笉鍑虹幇閲嶈竟鍜岃嚜鐜紝涓嶄繚璇佸浘杩為€氥€?/p>

杈撳叆閲忚緝澶э紝璇蜂娇鐢ㄨ緝涓哄揩閫熺殑璇诲叆鏂瑰紡銆?/p>

淇濊瘉鏃堕檺鍦╯td鐢ㄦ椂鐨?鍊嶅乏鍙炽€俿td娌℃湁鍗″父锛岃鏀惧績椋熺敤銆?/p>

Source

sun123zxy

Fun Facts

Solution

(f[u][0/1]) 涓哄埌杈剧偣 (u) 鏃剁姸鎬佷负 (0/1) 鍙敹闆嗗埌鐨勬渶澶ф槬搴︼紝鑻?(f[u][t]) 鍙揪锛屾湁

[f[u][t] = t imes mathrm{val}[u] + max_{(v,w) in mathrm{pre}_u} f[v][t otimes w] ]

鍏朵腑 (mathrm{val}[u]) 鏄偣 (u) 鐨勬潈鍊硷紝 ((v,w) in mathrm{pre}_u) 琛ㄧず (u) 鍦―AG涓婄殑鍓嶉┍杈癸紝 (otimes) 浠h〃寮傛垨銆?/p>

绛旀鍗?(max_{u in G} max(f[u][0],f[u][1])) 銆?/p>

鏅€氬浘

鏅€氬浘鏈夌幆锛岀幆涓婄殑鐘舵€佽浆绉绘柟绋嬬浉浜掍緷璧栵紝鏃犳硶dp銆?/p>

鏍规嵁閮ㄥ垎鍒嗙殑鎻愮ず锛岃€冭檻缂╃偣銆?/p>

涓嶅Θ鍏堢湅鎵€鏈夊己杩為€氬垎閲忛兘鍙槸绠€鍗曠幆鐨勬儏鍐点€?/p>

鐜DAG

涓轰簡鏂逛究鎻忚堪锛屾垜浠畾涔夊涓嬩袱绉嶆弿杩帮細

  • 濂囩幆锛氱幆涓婃墍鏈夎竟鏉冨紓鎴栧拰涓?(1) 鐨勭幆銆?/li>
  • 鍋剁幆锛氱幆涓婃墍鏈夎竟鏉冨紓鎴栧拰涓?(0) 鐨勭幆銆?/li>

瀹规槗鍙戠幇濂囩幆涓婂彲浠ラ€氳繃缁曚竴鍦堢殑鏂瑰紡鍥炲埌鍘熺偣锛屼娇鐘舵€佸彂鐢熸敼鍙樸€備篃灏辨槸璇达紝涓嶈浠庤繘鍑轰綅缃拰鍒濆鐘舵€佸浣曪紝涓€涓鐜€诲彲浠ヨ緭鍑轰换鎰忕殑 (0) 鎴?(1) 銆傝€屽鏋滃湪濂囩幆涓婄粫涓ゅ湀锛屽氨鍙互鍙栧緱鐜笂鎵€鏈夌偣鐨勬槬搴︺€傛墍浠ョ洿鎺ョ缉鐐瑰鐞嗗嵆鍙€?/p>

閭d箞鍋剁幆濡備綍澶勭悊鍛紵

棣栧厛锛岃嫢杩涘叆鍋剁幆鐨勭殑浣嶇疆锛堝叆鐐癸級纭畾锛屾棤璁烘€庢牱鍦ㄥ伓鐜笂缁曞湀锛屽埌杈剧幆涓婃煇鐐癸紙鍑虹偣锛夋椂鐨勭姸鎬佹€绘槸鍞竴纭畾鐨勩€?/p>

杩涗竴姝ョ殑锛屽伓鐜笂鐨勭偣鍙牴鎹埌杈捐鐐规椂鐨勭姸鎬佽鍒嗕负涓ょ粍銆傜粍涓庣粍涔嬮棿鍦ㄧ幆涓婁氦閿欐帓鍒楋紝鎵€鏈夎竟鏉冧负 (1?) 鐨勮竟閮芥槸閮芥槸涓€涓棿闅斻€傝嫢鍏ョ偣鍜屽嚭鐐瑰湪鍚屼竴缁勫唴锛屽垯鐘舵€佷笉浼氬彂鐢熷彉鍖栵紱鍙嶄箣鍒欑姸鎬佹敼鍙樸€傝繖鍚彂鎴戜滑灏嗗伓鐜缉鎴愪袱涓偣鏉ュ鐞嗭紝姣忎竴涓偣浠h〃涓€涓粍銆?/p>

鑰冭檻鏄ュ害鐨勮幏鍙栥€傚鏋滆繘鍏ユ椂鐘舵€佷负 (0) 锛岄偅涔堝拰鍏ョ偣鍦ㄥ悓涓€缁勫唴鐨勭偣涓婄殑鏄ュ害閮芥棤娉曞彇寰楋紙鍥犱负缁忚繃璇ョ偣鏃剁姸鎬佸缁堜负 (0) 锛夛紝鑰屽湪涓嶅悓缁勭殑鐐逛笂鐨勬槬搴﹁兘澶熷彇寰楋紙鍥犱负缁忚繃璇ョ偣鏃剁姸鎬佸缁堜负 (1) 锛夛紱鍙嶄箣锛岃嫢杩涘叆鏃剁姸鎬佷负 (1) 锛岄偅涔堝拰鍏ョ偣鍦ㄥ悓涓€缁勭殑鐐逛笂鐨勬槬搴﹀彲浠ュ彇寰楋紝鍦ㄤ笉鍚岀粍鐨勪笉鑳藉彇寰椼€?/p>

缂╃偣鍚庡仛涓€浜涜璁哄氨鍙互浜嗐€?/p>

濂囧己杩為€氬垎閲?/h5>

寮鸿繛閫氬垎閲忔棤闈炴槸璁稿涓幆鍙犺捣鏉ョ殑杩為€氬潡銆傚鏋滀竴涓己杩為€氬垎閲忓寘鍚竴涓垨澶氫釜濂囩幆锛堢О涔嬩负鈥滃寮鸿繛閫氬垎閲忊€濓級锛岄偅涔堣寮鸿繛閫氬垎閲忓悓鏍锋湁濂囩幆鐨勬€ц川鈥斺€旀瘡涓偣閮藉彲浠ラ€氳繃鍦ㄥ鐜笂缁曞湀鑾峰緱 (0/1) 涓ょ鐘舵€侊紝鍧椾笂鎵€鏈夌偣鐨勬槬搴﹂兘鑳藉彇寰椼€?/p>

瀹炴祴鍙戠幇闅忔満鍥句腑鍑虹幇鍋跺己杩為€氬垎閲忕殑姒傜巼鏋佸皬锛屽洜姝ゅ彧澶勭悊濂囧己杩為€氬垎閲忕殑绠楁硶鍙互閫氳繃闅忔満鍥炬暟鎹€?/p>

(u) 鍒扮偣 (v) 鍚屾椂瀛樺湪鍋惰矾寰?(P) 鍜屽璺緞 (Q) 銆傞偅涔堝璺緞 (Q) 蹇呯劧涓庢煇鏉′粠 (v) 鍒?(u) 鐨勫璺緞 (R) 鍏卞悓缁勬垚浜嗕竴涓伓鐜紙鍋跺己杩為€氬垎閲忎腑鍙湁鍋剁幆涓斿悇鐐瑰己杩為€氾級銆傚垯鍋惰矾寰?(P) 鍜屽璺緞 (R) 鏋勬垚濂囩幆锛屼笌鍋囪鐭涚浘锛屾晠鎬ц川鎴愮珛銆?/p>

鏄ュ害鐨勮幏鍙栦篃涓庡伓鐜浉鍚屻€?/p>

鍒ゆ柇涓€涓己杩為€氬垎閲忔槸濂囨槸鍋讹紝鍙渶浜屽垎鍥炬煋鑹诧紝鍙栫幆涓婁换鎰忎竴涓偣浣滀负璧风偣DFS锛屽鏋滆兘浠ヤ笉鍚岀殑鐘舵€佸埌杈炬煇鐐癸紝閭h鍒嗛噺灏辨槸濂囩殑锛屽弽涔嬪垯鏄伓鐨勩€傛纭€ф瘮杈冩樉鐒讹紝璇佹槑鍦ㄦ鐣ュ幓銆?/p>

瀹炵幇

瀹炵幇缁嗚妭杈冨锛屽缓璁缉鐐瑰悗閲嶆柊寤哄浘銆?/p>

鍙互鐢?涓妭鐐瑰垎鍒唬鐞嗕袱涓垎缁勫悇鑷殑鍏ヨ竟鍜屽嚭杈癸紝绠楀嚭鍒拌揪璇ョ粍鐘舵€佷负 (0/1) 鏃惰繛閫氬潡鍐呬袱涓粍鐨勭偣鏉冨绛旀鐨勮础鐚€備负浜嗘柟渚匡紝瀹炵幇鏃跺彲浠ヤ互杈规暟x2鐨勪唬浠锋妸鑺傜偣鏁板帇缂╁埌2涓€?/p>

Code

/*
鐧介摱涔嬫槬 (spring) std
by sun123zxy

PS: If you got a runtime error, "-Wl,--stack=123456789"
*/
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
typedef long long ll;
ll Rd(){
	ll ans=0;bool fh=0;char c=getchar();
	while(c<鈥?鈥榺|c>鈥?鈥?{if(c==鈥?鈥? fh=1; c=getchar();}
	while(c>=鈥?鈥?amp;&c<=鈥?鈥? ans=ans*10+c-鈥?鈥?c=getchar();
	if(fh) ans=-ans;
	return ans;
}

const ll INF=1E18;

const ll PTN=1E6+5,EDN=2E6+5;
ll N;
struct Edge{ll u,v;bool w;ll nxt;};
struct Graph{
	Edge edge[EDN];
	ll graM,last[PTN];
	void GraphInit(){graM=0;for(ll i=0;i<PTN;i++) last[i]=0;}
	void AddBscEdge(ll u,ll v,bool w){
		edge[++graM]=(Edge){u,v,w,last[u]};
		last[u]=graM;
	}
	void AddUnEdge(ll u,ll v,bool w){
		AddBscEdge(v,u,w); 
	}
	ll ptW[PTN][2]; //value Youmu can get when reaching the vertex with state 0/1
}G1,G2;
ll Id(ll cId,bool col){
	return 2*cId-col;
}

ll bel[PTN],cN,rps[PTN]; //belong, number of components, representative vertax of the component
ll dfn[PTN],low[PTN],dN;
ll stk[PTN],tp;bool isI[PTN];
void Tarjan(ll u){
	dfn[u]=low[u]=++dN;
	stk[++tp]=u;isI[u]=1;
	for(ll i=G1.last[u];i!=0;i=G1.edge[i].nxt){
		ll v=G1.edge[i].v;
		if(isI[v]){
			low[u]=min(low[u],dfn[v]);
		}else if(!dfn[v]){
			Tarjan(v);
			low[u]=min(low[u],low[v]);
		}
	}
	if(dfn[u]==low[u]){
		rps[++cN]=u;ll t;
		do{
			t=stk[tp--];
			isI[t]=0;bel[t]=cN;
		}while(t!=u);
	}
}
bool cTyp[PTN]; //component type (0: even; 1: odd)
ll col[PTN];
void ColDFS(ll u,bool color,ll curC){
	col[u]=color;
	G2.ptW[Id(curC,color)][1]+=G1.ptW[u][1]; //calculate values for each group (even component)
	for(ll i=G1.last[u];i!=0;i=G1.edge[i].nxt){
		ll v=G1.edge[i].v;bool w=G1.edge[i].w;
		if(bel[v]!=curC) continue;
		if(col[v]==-1) ColDFS(v,color^w,curC);
		else if((color^w)!=col[v]) cTyp[curC]=1; //odd component
	}
}
void BuildG2(){
	for(ll i=1;i<=G1.graM;i++){
		ll u=G1.edge[i].u,v=G1.edge[i].v;bool w=G1.edge[i].w;
		ll cU=bel[u],cV=bel[v];
		if(!cU||!cV) continue; //edges Youmu can never reach
		if(cU==cV) continue;   //edges inside the component
		ll myV=Id(cV,col[v]*(cTyp[cV]^1));
		if(cTyp[cU]==1){
			G2.AddUnEdge(Id(cU,0),myV,w);
			G2.AddUnEdge(Id(cU,0),myV,w^1);
		}else{
			G2.AddUnEdge(Id(cU,col[u]),myV,w);     //from this group
			G2.AddUnEdge(Id(cU,col[u]^1),myV,w^1); //from the other group
		}
	}
}
ll f[PTN][2];
ll F(ll u,bool typ){
	if(f[u][typ]!=-1) return f[u][typ];
	f[u][typ]=-INF; 
	for(ll i=G2.last[u];i!=0;i=G2.edge[i].nxt){
		ll v=G2.edge[i].v;bool w=G2.edge[i].w;
		f[u][typ]=max(f[u][typ],G2.ptW[u][typ]+F(v,typ^w));
	}
	return f[u][typ];
}
ll ST=1;
void Solve(){
	cN=0;dN=0;tp=0;for(ll i=1;i<=N;i++) dfn[i]=low[i]=0,bel[i]=0,isI[i]=0;
	Tarjan(ST); //Only need to get components Youmu can reach
	G2.GraphInit();
	for(ll i=1;i<=N;i++) col[i]=-1;
	for(ll i=1;i<=cN;i++) cTyp[i]=0,ColDFS(rps[i],0,i);
	for(ll i=1;i<=cN;i++){
		if(cTyp[i]==1){ //odd component
			G2.ptW[Id(i,0)][0]=G2.ptW[Id(i,0)][1]+=G2.ptW[Id(i,1)][1]; //an odd component enjoys all the values
			G2.ptW[Id(i,1)][0]=G2.ptW[Id(i,1)][1]=0; //abandon Id(i,1)
		}else{ //even component
			G2.ptW[Id(i,0)][0]=G2.ptW[Id(i,1)][1];
			G2.ptW[Id(i,1)][0]=G2.ptW[Id(i,0)][1];
		}
	}
	BuildG2();
	
	for(ll i=1;i<=2*N;i++) f[i][0]=f[i][1]=-1;
	ll myST=Id(bel[ST],col[ST]*(cTyp[bel[ST]]^1));
	f[myST][0]=G2.ptW[myST][0];
	ll ans=-INF;
	for(ll i=1;i<=2*N;i++)
		ans=max(ans,max(F(i,0),F(i,1)));
	printf("%lld",ans);
}
int main(){
	freopen("spring.in","r",stdin);
	freopen("spring_std.out","w",stdout);
	G1.GraphInit();
	N=Rd();ll m=Rd();
	for(ll u=1;u<=N;u++) G1.ptW[u][1]=Rd();
	while(m--){
		ll u=Rd(),v=Rd();bool w=Rd();
		G1.AddBscEdge(u,v,w); 
	}
	Solve();
	return 0;
}

Omake

绗竴娆″嚭棰橈紝鏈夌喊婕忚澶氬鍖呮兜銆?/p>

蹇浜ら鏃舵墠鍙戠幇涓€骞村墠鍐欑殑std鍑洪攨浜嗭紝鍖嗗寙蹇欏繖鐨勯噸鍐欎簡涓€涓紝涓嶇煡閬撴湁娌℃湁鏂伴€犲嚭浠€涔坆ug銆傛暟鎹篃閫犲緱姣旇緝鍖嗗繖锛屽鏋滅垎鐐镐簡璇烽殢渚胯颈楠傚嚭棰樹汉鎴栬€?a href="https://www.cnblogs.com/sun123zxy/p/14019963.html">鍘讳粬鍗氬涓?/a>鍛婅瘔浠栵紙

鍙互璇磋繖閬撻鎶婁簩鍒嗗浘鎷撳睍鍒颁簡寮鸿繛閫氭湁鍚戝浘涓婏紝涓嶇煡閬撴湁娌℃湁浠€涔堟洿鏈夎叮鐨勬€ц川鍙互鍙戞帢銆?/p>

鍚庢潵鍋氬埌鍑犻亾鎬ц川鐩镐技鐨勯鐩紝杩欓噷鍒楀嚭鏉ヤ緵鍙傝€冿細 鍨冨溇鎾為鍑洪浜?/s>

鎬濊€冭儗鏅€庢牱涓庨鐩鍚堜篃鏄釜鎸烘湁瓒g殑杩囩▼銆?/p>

鎰熻阿鍚垜涔辨壇idea鐨?TbYangZ 鍜?Waper 锛屼互鍙婂皾璇曞弶鎺塻td鐨勪袱浣嶅媷澹?p9t6g 鍜?changruinian2020 銆?铏界劧閮藉け璐ヤ簡

灏辫繖浜涘惂銆?/p>

鈥斺€攕un123zxy

Oct. 2019 鍒濈瀹屾垚

Nov. 2020 鏈€鍚庢洿鏂?/p>

Next Phantasm...

以上是关于鍘熷垱棰樼洰 鐧介摱涔嬫槬 Problem and Solution的主要内容,如果未能解决你的问题,请参考以下文章

P9 澶т浆鍘熷垱鈥斺€斿洓涓楠わ紝杞绘澗鎼炲畾鏋舵瀯璁捐

DP(鍔ㄦ€佽鍒?缁忓吀璺緞闂 | LeetCode

A*(A_star)鎼滅储鎬荤粨

leetcode姣忔棩涓€棰樼郴鍒?鍏氦璺嚎

銆岄潰璇曞繀闂€峫eetcode楂橀棰樼簿閫?/a>