結果

問題 No.2630 Colorful Vertices and Cheapest Paths
ユーザー 👑 p-adicp-adic
提出日時 2024-02-17 19:18:46
言語 cLay
(20240104-1)
結果
AC  
実行時間 252 ms / 2,500 ms
コード長 286 bytes
コンパイル時間 2,367 ms
コンパイル使用メモリ 178,996 KB
実行使用メモリ 48,192 KB
最終ジャッジ日時 2024-02-17 19:18:53
合計ジャッジ時間 6,891 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
16,832 KB
testcase_01 AC 191 ms
27,968 KB
testcase_02 AC 210 ms
44,352 KB
testcase_03 AC 2 ms
7,488 KB
testcase_04 AC 2 ms
7,488 KB
testcase_05 AC 2 ms
7,488 KB
testcase_06 AC 107 ms
12,736 KB
testcase_07 AC 182 ms
47,552 KB
testcase_08 AC 176 ms
43,072 KB
testcase_09 AC 182 ms
48,192 KB
testcase_10 AC 234 ms
48,064 KB
testcase_11 AC 234 ms
48,064 KB
testcase_12 AC 232 ms
48,064 KB
testcase_13 AC 252 ms
48,064 KB
testcase_14 AC 233 ms
48,064 KB
testcase_15 AC 176 ms
8,512 KB
testcase_16 AC 175 ms
8,512 KB
testcase_17 AC 174 ms
8,512 KB
testcase_18 AC 111 ms
19,264 KB
testcase_19 AC 156 ms
38,720 KB
testcase_20 AC 153 ms
33,088 KB
testcase_21 AC 177 ms
48,064 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll@N,@M,@--(A,B)[M],@--C[N],@W[10],@Q,@--(U,V)[Q],a[Q],c;rep(q,Q)a[q]=-1;REP(b,1024){c=sum[d,0,10@(b>>d)&1](W[d]);unionFind t('m',N,1);rep(j,M)if((b>>C[A[j]])&1&(b>>C[B[j]]))t.connect(A[j],B[j]);rep(q,Q)if((b>>C[U[q]])&1&(b>>C[V[q]])&t(U[q])==t(V[q])&(a[q]<0|a[q]>c))a[q]=c;}wtLn(a(Q));
0