zoukankan      html  css  js  c++  java
  • 【Codeforces 444A】DZY Loves Physics

    【链接】 我是链接,点我呀:)
    【题意】

    题意

    【题解】

    两个点的子图他们的"密度"是比所有联通生成子图都要大的 "只要胆子大,遇到什么问题都不怕!"

    【代码】

    #include <bits/stdc++.h>
    #define rep1(i,a,b) for (int i = a;i <= b;i++)
    #define rep2(i,a,b) for (int i = a;i>= b;i--)
    #define ll long long
    using namespace std;
    
    const int N = 500;
    
    int n,m;
    int a[N+10];
    
    int main(){
        ios::sync_with_stdio(0),cin.tie(0);
        cin >> n >> m;
        rep1(i,1,n) cin >> a[i];
        double ans = 0;
        rep1(i,1,m){
            int x,y,z;
            cin >> x >> y >> z;
            double temp = 1.0*(a[x]+a[y])/z;
            ans = max(ans,temp);
        }
        cout<<fixed<<setprecision(15)<<ans<<endl;
        return 0;
    }
    
    
  • 相关阅读:
    sql推断时间
    COCOFrame
    第41周一
    第40周日
    第40周六
    第40周五
    第40周四
    第40周三国庆
    第40周二晚
    第40周二
  • 原文地址:https://www.cnblogs.com/AWCXV/p/10674198.html
Copyright © 2011-2022 走看看