結果

問題 No.1814 Uribo Road (Easy)
ユーザー tailstails
提出日時 2023-03-07 22:19:36
言語 cLay
(20240104-1)
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 533 bytes
コンパイル時間 3,291 ms
コンパイル使用メモリ 184,924 KB
実行使用メモリ 8,232 KB
最終ジャッジ日時 2023-10-18 05:37:13
合計ジャッジ時間 6,001 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,768 KB
testcase_01 AC 2 ms
7,768 KB
testcase_02 AC 2 ms
7,768 KB
testcase_03 AC 3 ms
7,768 KB
testcase_04 AC 2 ms
7,768 KB
testcase_05 AC 2 ms
7,768 KB
testcase_06 AC 2 ms
7,768 KB
testcase_07 AC 3 ms
7,768 KB
testcase_08 AC 2 ms
7,768 KB
testcase_09 AC 2 ms
7,772 KB
testcase_10 AC 3 ms
7,772 KB
testcase_11 AC 3 ms
7,788 KB
testcase_12 AC 3 ms
7,812 KB
testcase_13 AC 3 ms
7,800 KB
testcase_14 AC 3 ms
7,824 KB
testcase_15 AC 3 ms
7,768 KB
testcase_16 AC 3 ms
7,768 KB
testcase_17 AC 3 ms
7,768 KB
testcase_18 AC 3 ms
7,768 KB
testcase_19 AC 2 ms
7,768 KB
testcase_20 AC 4 ms
7,896 KB
testcase_21 AC 3 ms
7,792 KB
testcase_22 AC 5 ms
8,096 KB
testcase_23 AC 4 ms
7,908 KB
testcase_24 AC 6 ms
8,052 KB
testcase_25 AC 5 ms
8,048 KB
testcase_26 AC 6 ms
8,128 KB
testcase_27 AC 7 ms
8,184 KB
testcase_28 AC 7 ms
8,184 KB
testcase_29 AC 7 ms
8,184 KB
testcase_30 AC 7 ms
8,232 KB
testcase_31 AC 7 ms
8,232 KB
testcase_32 AC 3 ms
7,808 KB
testcase_33 AC 2 ms
7,776 KB
testcase_34 AC 2 ms
7,772 KB
testcase_35 AC 3 ms
7,836 KB
testcase_36 AC 3 ms
7,780 KB
testcase_37 AC 3 ms
7,808 KB
testcase_38 AC 4 ms
7,848 KB
testcase_39 AC 3 ms
7,788 KB
testcase_40 AC 3 ms
7,812 KB
testcase_41 AC 4 ms
8,116 KB
testcase_42 AC 4 ms
7,880 KB
testcase_43 AC 3 ms
7,800 KB
testcase_44 AC 4 ms
7,864 KB
testcase_45 AC 3 ms
7,784 KB
testcase_46 AC 6 ms
8,064 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