Submission #996357

#TimeUsernameProblemLanguageResultExecution timeMemory
996357Dan4Life자매 도시 (APIO20_swap)C++17
Compilation error
0 ms0 KiB
#include "swap.h" #include <bits/stdc++.h> using namespace std; #define all(a) begin(a),end(a) const int mxN = (int)3e5+10; multiset<int> S; int edge[mxN]; void init(int N, int M, vector<int> U, vector<int> V, vector<int> W) { for(auto u : W) S.insert(u); for(int i = 0; i < M; i++) edge[V[i]] = W[i]; } int getMinimumFuelCapacity(int X, int Y) { int ans = 0; if(X==0){ ans = max(ans, edge[Y]); S.erase(S.find(edge[Y])); if(sz(S)<2) return -1; ans = max(ans, *next(begin(S))); S.insert(edge[Y]); } else{ ans = max(ans, edge[X]); ans = max(ans, edge[Y]); S.erase(S.find(edge[X])); S.erase(S.find(edge[Y])); if(S.empty()) return -1; ans = max(ans, *begin(S)); S.insert(edge[X]); S.insert(edge[Y]); } return ans; }

Compilation message (stderr)

swap.cpp: In function 'int getMinimumFuelCapacity(int, int)':
swap.cpp:22:6: error: 'sz' was not declared in this scope
   22 |   if(sz(S)<2) return -1;
      |      ^~