結果

問題 No.1812 Uribo Road
ユーザー tailstails
提出日時 2023-03-07 22:16:41
言語 cLay
(20240104-1)
結果
AC  
実行時間 64 ms / 5,000 ms
コード長 533 bytes
コンパイル時間 4,319 ms
コンパイル使用メモリ 184,772 KB
実行使用メモリ 8,676 KB
最終ジャッジ日時 2023-10-18 05:37:07
合計ジャッジ時間 6,980 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
7,768 KB
testcase_01 AC 3 ms
7,768 KB
testcase_02 AC 3 ms
7,768 KB
testcase_03 AC 6 ms
8,152 KB
testcase_04 AC 3 ms
7,768 KB
testcase_05 AC 2 ms
7,768 KB
testcase_06 AC 3 ms
7,768 KB
testcase_07 AC 3 ms
7,800 KB
testcase_08 AC 3 ms
7,788 KB
testcase_09 AC 4 ms
7,796 KB
testcase_10 AC 3 ms
7,788 KB
testcase_11 AC 4 ms
7,776 KB
testcase_12 AC 36 ms
8,344 KB
testcase_13 AC 11 ms
8,368 KB
testcase_14 AC 11 ms
8,368 KB
testcase_15 AC 18 ms
8,196 KB
testcase_16 AC 25 ms
7,996 KB
testcase_17 AC 52 ms
8,384 KB
testcase_18 AC 14 ms
8,568 KB
testcase_19 AC 64 ms
8,628 KB
testcase_20 AC 64 ms
8,628 KB
testcase_21 AC 60 ms
8,656 KB
testcase_22 AC 38 ms
8,676 KB
testcase_23 AC 4 ms
7,852 KB
testcase_24 AC 3 ms
7,768 KB
testcase_25 AC 8 ms
8,076 KB
testcase_26 AC 3 ms
7,788 KB
testcase_27 AC 10 ms
8,256 KB
testcase_28 AC 16 ms
8,144 KB
testcase_29 AC 2 ms
7,768 KB
testcase_30 AC 4 ms
7,832 KB
testcase_31 AC 30 ms
8,400 KB
testcase_32 AC 3 ms
7,804 KB
testcase_33 AC 19 ms
8,340 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

int@n,@m,@k,@r--[k],a[m],b[],c[];
rd((a--,b--,c)(m));

wgraph<int>g;
g.setEdge(n,m,a,b,c);

int d[2k+2][2k];
int e[m];
rep(i,2k+2){
	g.getDist(i<2k?i&1?b[r[i/2]]:a[r[i/2]]:i==2k?0:n-1,e);
	rep(j,2k){
		d[i][j]=e[j&1?b[r[j/2]]:a[r[j/2]]];
	}
}

int f[1<<k][2k];
rep(i,1<<k){
	rep(j,2k){
		if(i&1<<j/2){
			int l=int_inf;
			if(int q=i^1<<j/2){
				rep(o,2k){
					if(q&1<<o/2){
						l<?=f[q][o]+d[o][j];
					}
				}
			}else{
				l=d[2k][j];
			}
			f[i][j^1]=l+c[r[j/2]];
		}
	}
}

wt(min[int][i,0,2k](f[(1<<k)-1][i]+d[2k+1][i]));
0