北京集訓②DAY2 Mroning -未完
阿新 • • 發佈:2017-10-13
none pen bsp style png clas esp aps show
對於一條邊 想要價值最小 肯定是刪點權最大的點
1 #include <cmath> 2 #include <cstdio> 3 #include <cstdlib> 4 #include <iostream> 5 #include <algorithm> 6 #include <map> 7 #include <vector> 8 #include <string> 9 #include <cstring> 10 using namespace代碼std; 11 int a[100005]; 12 long long ans; 13 int main() 14 { 15 freopen("god.in","r",stdin); 16 freopen("god.out","w",stdout); 17 int n,m,A,B,i; 18 scanf("%d%d",&n,&m); 19 for (i=1; i<=n; i++) scanf("%d",&a[i]); 20 while (m--) 21 { 22 scanf("%d%d",&A,&B); 23 ans+=min(a[A],a[B]); 24 } 25 cout<<ans; 26 return 0; 27 }
北京集訓②DAY2 Mroning -未完