Submission #653632

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
6536322022-10-27 13:11:16pauloamedDango Maker (JOI18_dango_maker)C++14
0 / 100
31 ms70916 KiB
#include<bits/stdc++.h>
using namespace std;
// Edge structure: handles node pointed to, capacity
// and the index in v[to] to its reverse edge
struct Edge{
int to, rev;
int cap; //
bool is_rev;
Edge(int t, int c, int r, bool irev):to{t},rev{r},cap{c},is_rev{irev}
{}
};
struct Flow{
int n, s, t; // n: # nodes, s: source, t: sink
vector<vector<Edge>> v; // extended adj list
vector<int> lvl; // indicates the lvl for each node. used for the lvl graph
// assures that each edge is completely visited only once. keeps sort of backup
// of the index of the last visited edge
// there is no need to revisit an edge, hence, these can be skipped
vector<int> lastPos;
// constructor
Flow(int N, int src, int snk){
this->n = N;
this->s = src;
this->t = snk;
v = vector<vector<Edge>>(n, vector<Edge>());
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

dango_maker.cpp: In member function 'int Flow::dfs(int, int)':
dango_maker.cpp:62:24: warning: comparison of integer expressions of different signedness: '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} and 'std::vector<Edge>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   62 |       for(; lastPos[i] < v[i].size(); ++lastPos[i]){
dango_maker.cpp: In member function 'std::vector<std::pair<int, int> > Flow::get_cut()':
dango_maker.cpp:97:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Edge>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   97 |       for(int j = 0; j < v[i].size(); ++j){
      |                      ~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...