結果

問題 No.1545 [Cherry 2nd Tune N] Anthem
ユーザー tailstails
提出日時 2023-03-09 15:15:47
言語 cLay
(20240104-1)
結果
AC  
実行時間 78 ms / 3,000 ms
コード長 612 bytes
コンパイル時間 4,617 ms
コンパイル使用メモリ 181,544 KB
実行使用メモリ 35,864 KB
最終ジャッジ日時 2023-10-18 06:17:54
合計ジャッジ時間 17,881 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,792 KB
testcase_01 AC 3 ms
7,804 KB
testcase_02 AC 2 ms
7,800 KB
testcase_03 AC 2 ms
7,800 KB
testcase_04 AC 19 ms
17,844 KB
testcase_05 AC 64 ms
25,856 KB
testcase_06 AC 23 ms
17,120 KB
testcase_07 AC 14 ms
14,700 KB
testcase_08 AC 52 ms
16,176 KB
testcase_09 AC 13 ms
10,644 KB
testcase_10 AC 12 ms
12,984 KB
testcase_11 AC 36 ms
19,076 KB
testcase_12 AC 78 ms
24,072 KB
testcase_13 AC 18 ms
12,756 KB
testcase_14 AC 30 ms
19,264 KB
testcase_15 AC 9 ms
9,380 KB
testcase_16 AC 50 ms
22,692 KB
testcase_17 AC 10 ms
9,744 KB
testcase_18 AC 56 ms
17,928 KB
testcase_19 AC 27 ms
16,576 KB
testcase_20 AC 13 ms
9,932 KB
testcase_21 AC 55 ms
25,824 KB
testcase_22 AC 55 ms
20,960 KB
testcase_23 AC 25 ms
13,808 KB
testcase_24 AC 4 ms
7,996 KB
testcase_25 AC 4 ms
7,944 KB
testcase_26 AC 3 ms
7,816 KB
testcase_27 AC 4 ms
7,988 KB
testcase_28 AC 6 ms
7,976 KB
testcase_29 AC 5 ms
7,996 KB
testcase_30 AC 4 ms
7,928 KB
testcase_31 AC 5 ms
8,016 KB
testcase_32 AC 3 ms
7,888 KB
testcase_33 AC 6 ms
7,996 KB
testcase_34 AC 5 ms
7,964 KB
testcase_35 AC 11 ms
8,196 KB
testcase_36 AC 9 ms
8,076 KB
testcase_37 AC 4 ms
7,848 KB
testcase_38 AC 6 ms
7,972 KB
testcase_39 AC 3 ms
7,880 KB
testcase_40 AC 4 ms
7,892 KB
testcase_41 AC 2 ms
7,840 KB
testcase_42 AC 5 ms
7,968 KB
testcase_43 AC 5 ms
7,968 KB
testcase_44 AC 3 ms
8,052 KB
testcase_45 AC 3 ms
8,676 KB
testcase_46 AC 5 ms
8,604 KB
testcase_47 AC 7 ms
9,400 KB
testcase_48 AC 12 ms
12,700 KB
testcase_49 AC 10 ms
10,260 KB
testcase_50 AC 19 ms
12,724 KB
testcase_51 AC 3 ms
7,932 KB
testcase_52 AC 21 ms
12,596 KB
testcase_53 AC 9 ms
10,252 KB
testcase_54 AC 3 ms
8,064 KB
testcase_55 AC 16 ms
11,864 KB
testcase_56 AC 3 ms
8,100 KB
testcase_57 AC 19 ms
10,784 KB
testcase_58 AC 10 ms
10,172 KB
testcase_59 AC 4 ms
8,312 KB
testcase_60 AC 3 ms
8,648 KB
testcase_61 AC 5 ms
8,624 KB
testcase_62 AC 10 ms
10,068 KB
testcase_63 AC 7 ms
8,876 KB
testcase_64 AC 77 ms
24,680 KB
testcase_65 AC 4 ms
8,172 KB
testcase_66 AC 27 ms
35,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll@n,@s--,@t--,@k,@x[n],@m;
int y[m],a[],b[],c[n*k];
rd((a--,b--,y)(m));
wgraph<int>g;
g.setDirectEdge(n,m,b,a,y);
DijkstraHeap<ll>h;
h.malloc(n*k,1);
h.change(t*k+(k-1),x[t]);
c[t*k+(k-1)]=-1;
while(h.size){
	int i=h.pop();
	int j=i/k;
	int l=i%k;
	rep(o,g.es[j]){
		int p=g.edge[j][o];
		int r=max(0,l-1);
		int q=p*k+r;
		ll v=h.val[i]+g.cost[j][o]+x[p];
		if(!h.visited[q]&&(h.place[q]<0||h.val[q]>v)){
			h.change(q,v);
			c[q]=i;
		}
	}
}
if(h.visited[s*k]){
	wt("Possible");
	wt(h.val[s*k]);
	int z[n*k],w=0,u=s*k;
	while(u>=0){
		z[w++]=u/k+1;
		u=c[u];
	}
	wt(w);
	wt(z(w));
}else{
	wt("Impossible");
}
0