Submission #570225

#TimeUsernameProblemLanguageResultExecution timeMemory
570225ChrisM2309Road Closures (APIO21_roads)C++14
0 / 100
63 ms4016 KiB
#include "roads.h" #include <bits/stdc++.h> using namespace std; typedef pair<int,int> ii; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<vi> vvi; typedef vector<ii> vii; typedef vector<vii> wgraf; typedef pair<int,ii> edge; #define UNVISITED 0 #define VISITED 1 #define INF 1000000000 #define pb push_back #define F first #define S second #define all(x) (x).begin(), (x).end() std::vector<long long> minimum_closure_costs(int N, std::vector<int> U, std::vector<int> V, std::vector<int> W) { vector<ll> ans(N - 1); sort(all(W)); ll sum = 0; for (auto i : W) sum += i; ans.pb(sum); for (int i = 1; i < W.size(); i++){ sum -= W[i]; ans.pb(sum); } return ans; }

Compilation message (stderr)

roads.cpp: In function 'std::vector<long long int> minimum_closure_costs(int, std::vector<int>, std::vector<int>, std::vector<int>)':
roads.cpp:29:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 |  for (int i = 1; i < W.size(); i++){
      |                  ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...