結果

問題 No.807 umg tours
ユーザー tailstails
提出日時 2020-11-06 17:00:52
言語 cLay
(20240104-1)
結果
AC  
実行時間 130 ms / 4,000 ms
コード長 582 bytes
コンパイル時間 2,987 ms
コンパイル使用メモリ 175,840 KB
実行使用メモリ 18,888 KB
最終ジャッジ日時 2023-09-19 01:46:24
合計ジャッジ時間 9,326 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,420 KB
testcase_01 AC 2 ms
5,616 KB
testcase_02 AC 2 ms
5,504 KB
testcase_03 AC 2 ms
5,424 KB
testcase_04 AC 2 ms
5,476 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,488 KB
testcase_07 AC 2 ms
5,488 KB
testcase_08 AC 2 ms
5,548 KB
testcase_09 AC 2 ms
5,456 KB
testcase_10 AC 2 ms
5,368 KB
testcase_11 AC 47 ms
12,308 KB
testcase_12 AC 72 ms
13,948 KB
testcase_13 AC 91 ms
16,408 KB
testcase_14 AC 37 ms
11,352 KB
testcase_15 AC 29 ms
11,200 KB
testcase_16 AC 94 ms
16,524 KB
testcase_17 AC 129 ms
18,776 KB
testcase_18 AC 127 ms
18,648 KB
testcase_19 AC 130 ms
18,652 KB
testcase_20 AC 80 ms
15,788 KB
testcase_21 AC 85 ms
15,736 KB
testcase_22 AC 29 ms
11,012 KB
testcase_23 AC 22 ms
10,644 KB
testcase_24 AC 38 ms
18,464 KB
testcase_25 AC 126 ms
18,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

int a[200000],b[200000],c[200000];

{
	int @n,@m;
	rd((a,b,c)(m));
	wgraph<int> g;
	g.setEdge(n+1,m,a,b,c);

	DijkstraHeap<ll> h;
	h.walloc(2n+2);
	h.init(2n+2);
	h.change(2,0);
	while(h.size){
		int i2=h.pop();
		long v=h.val[i2];
		int i=i2>>1;
		if(i2&1){
			for(int k=0;k<g.es[i];++k){
				int j=g.edge[i][k];
				int c=g.cost[i][k];
				h.change(j<<1|1,v+c);
			}
		}else{
			for(int k=0;k<g.es[i];++k){
				int j=g.edge[i][k];
				int c=g.cost[i][k];
				h.change(j<<1|0,v+c);
				h.change(j<<1|1,v);
			}
		}
	}
	wt(0);
	rep(i,2,n+1){
		wt(h.val[i<<1|0]+h.val[i<<1|1]);
	}
}
0