Submission #805760

# Submission time Handle Problem Language Result Execution time Memory
805760 2023-08-03T22:47:08 Z HD1 Cheap flights (LMIO18_pigus_skrydziai) C++14
0 / 100
246 ms 42044 KB
// we all are lost trying to be someone.
#include <bits/stdc++.h>
#define fastio ios_base::sync_with_studio(0); cin.tie(0);
#define sz(x) ll(x.size())
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define pb push_back
#define ss second
#define ff first
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> ii;
const int MAX=1e6;
const int inf=1e9;
const int mod=1e9+7;
vector<ii> gfo[MAX];
ll A[MAX];
void solve(){
    ll n, m, u, v, w;
    cin>>n>>m;
    for(ll i=0; i<m; i++){
        cin>>u>>v>>w;
        A[u]+=w;
        A[v]+=w;
        gfo[u].pb({v,w});
        gfo[v].pb({u,w});
    }
    ll a=*max_element(A,A+n+1);
    cout<<a<<endl;
    return;
}
int main(){
    solve();
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 12 ms 23764 KB Output is correct
2 Incorrect 12 ms 23796 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 12 ms 23764 KB Output is correct
2 Incorrect 12 ms 23796 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 132 ms 35752 KB Output is correct
2 Correct 246 ms 42044 KB Output is correct
3 Incorrect 86 ms 29996 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 132 ms 35752 KB Output is correct
2 Correct 246 ms 42044 KB Output is correct
3 Incorrect 86 ms 29996 KB Output isn't correct
4 Halted 0 ms 0 KB -