AtCoder Beginner Contest 190
問題文
省略
省略
C++に変換後のコードはこちら
int N, M, A[1d5], B[1d5], K, C[17];
graph g;
{
ll res, **mat;
rd(N,M,(A--,B--)(M),K,(C--)(K));
g.setEdge(N,M,A,B);
walloc2d(&mat,K,K);
g.getDistPairMatrix(K,C,mat);
rep(i,K) rep(j,K) if(mat[i][j]==-1) mat[i][j] = ll_inf/20;
res = TSP_path(K,mat) + 1;
wt(if[res >= ll_inf/20, -1, res]);
}
Current time: 2024年04月27日04時24分21秒
Last modified: 2021年02月23日15時29分43秒 (by laycrs)
Tags: Competitive_Programming_Incomplete AtCoder AtCoder_Beginner_Contest ABC190 ABC_E
トップページに戻る
Logged in as: unknown user (not login)