Submission #377981

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3779812021-03-15 16:51:49jhwest2Robot (JOI21_ho_t4)C++14
100 / 100
595 ms78028 KiB
#include <bits/stdc++.h>
#define va first
#define vb second
using namespace std;
typedef long long lint;
typedef pair<int, int> pint;
typedef pair<lint, lint> plint;
const int MAX = 4e5 + 10;
int n, m;
lint D[MAX];
vector<int> A;
vector<plint> G[MAX];
vector<pair<int, pint>> V[MAX];
int main() {
cin.tie(0); ios_base::sync_with_stdio(0);
cin >> n >> m;
for (int i = 0; i < m; i++) {
int a, b, c, p; cin >> a >> b >> c >> p;
V[a].push_back({ c, {p, b} });
V[b].push_back({ c, {p, a} });
}
int sz = n;
for (int i = 1; i < n; i++) {
if (V[i].empty()) continue; sort(V[i].begin(), V[i].end());
for (int l = 0, r = 0; l < V[i].size(); l = r) {
lint s = 0;
while (r < V[i].size() && V[i][l].va == V[i][r].va) s += V[i][r++].vb.va;
if (r - l == 1) G[i].emplace_back(0, V[i][l].vb.vb);
else {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:25:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   25 |         if (V[i].empty()) continue; sort(V[i].begin(), V[i].end());
      |         ^~
Main.cpp:25:37: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   25 |         if (V[i].empty()) continue; sort(V[i].begin(), V[i].end());
      |                                     ^~~~
Main.cpp:26:34: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, std::pair<int, int> > >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |         for (int l = 0, r = 0; l < V[i].size(); l = r) {
      |                                ~~^~~~~~~~~~~~~
Main.cpp:28:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, std::pair<int, int> > >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   28 |             while (r < V[i].size() && V[i][l].va == V[i][r].va) s += V[i][r++].vb.va;
      |                    ~~^~~~~~~~~~~~~
Main.cpp:45:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   45 |         if (D[t.vb] != 4e18) continue; D[t.vb] = -t.va;
      |         ^~
Main.cpp:45:40: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   45 |         if (D[t.vb] != 4e18) continue; D[t.vb] = -t.va;
      |                                        ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...