結果

問題 No.2431 Viral Hotel
ユーザー tailstails
提出日時 2023-08-18 22:56:21
言語 cLay
(20240104-1)
結果
WA  
実行時間 -
コード長 557 bytes
コンパイル時間 3,435 ms
コンパイル使用メモリ 170,948 KB
実行使用メモリ 17,440 KB
最終ジャッジ日時 2023-08-18 22:56:28
合計ジャッジ時間 6,615 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 39 ms
11,816 KB
testcase_07 AC 38 ms
11,948 KB
testcase_08 AC 38 ms
12,972 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 13 ms
6,132 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 2 ms
4,376 KB
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 1 ms
4,376 KB
testcase_40 AC 2 ms
4,380 KB
testcase_41 AC 1 ms
4,376 KB
testcase_42 AC 1 ms
4,376 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

priority_queue<pair<ll,pair<ll,ll>>>q;
ll@n,@k,@m,@p;
int u[m],v[];
rd((u--,v--)(m));
graph g;
g.setEdge(n,m,u,v);
ll@s[n],r[n]{},t[n]{};
rep(k){
	ll@x--;
	t[x]=1;
	rep(j,g.es[x]){
		ll a=g.edge[x][j];
		q.push({-s[x],{x,a}});
	}
}
while(!q.empty()){
	auto b=q.top();
	q.pop();
	ll f=b.second.first;
	if(t[f]==1||r[f]==-b.first-p){
		ll x=b.second.second;
		if(!t[x]){
			t[x]=1;
			r[x]=-b.first;
			rep(j,g.es[x]){
				ll a=g.edge[x][j];
				q.push({b.first-s[x],{x,a}});
			}
		}else if(r[x]>-b.first-p){
			t[x]=2;
		}
	}
}
wt(sum[ll][i,0,n](t[i]==2));
0