Submission #532863

# Submission time Handle Problem Language Result Execution time Memory
532863 2022-03-04T06:11:32 Z ohohorz Swapping Cities (APIO20_swap) C++14
6 / 100
130 ms 15664 KB
#include "swap.h"

#include <vector>
#include<set>
#include<algorithm>
#include<climits>
using namespace std;

// #define int long long
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define sz(x) (int)x.size()

const int MAXN = 1e5 + 5;
const int INF = INT_MAX;
const int LOGN = 22;

int n, m;
vector< pair <int,int> > g[MAXN];
bool cycle = 0;
int mx;
void init(int N, int M, std::vector<int> U, std::vector<int> V, std::vector<int> W) {
  n = N,m = M;

  for(int i = 0;i < m;i++){
    int u = U[i] + 1;
    int v = V[i] + 1;
    mx=max(mx, W[i]);
    g[u].pb(mp(v, W[i]));
    g[v].pb(mp(u, W[i]));
  }
  if(n == m){
      cycle = 1;
  }
}

int getMinimumFuelCapacity(int X, int Y) {
  X++, Y++;
  if(cycle==1){
      return mx;
  }
  return -1;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2624 KB Output is correct
2 Correct 2 ms 2628 KB Output is correct
3 Correct 2 ms 2508 KB Output is correct
4 Correct 2 ms 2636 KB Output is correct
5 Correct 3 ms 2636 KB Output is correct
6 Correct 2 ms 2636 KB Output is correct
7 Correct 2 ms 2700 KB Output is correct
8 Correct 2 ms 2636 KB Output is correct
9 Correct 81 ms 8512 KB Output is correct
10 Correct 58 ms 9888 KB Output is correct
11 Correct 69 ms 9748 KB Output is correct
12 Correct 54 ms 10188 KB Output is correct
13 Correct 61 ms 10220 KB Output is correct
14 Correct 46 ms 8924 KB Output is correct
15 Correct 118 ms 14028 KB Output is correct
16 Correct 130 ms 13844 KB Output is correct
17 Correct 123 ms 14264 KB Output is correct
18 Correct 116 ms 14296 KB Output is correct
19 Correct 61 ms 8884 KB Output is correct
20 Correct 111 ms 15076 KB Output is correct
21 Correct 107 ms 15148 KB Output is correct
22 Correct 114 ms 15660 KB Output is correct
23 Correct 124 ms 15664 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2624 KB Output is correct
2 Correct 2 ms 2628 KB Output is correct
3 Incorrect 93 ms 14064 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2624 KB Output is correct
2 Correct 2 ms 2628 KB Output is correct
3 Correct 2 ms 2508 KB Output is correct
4 Correct 2 ms 2636 KB Output is correct
5 Correct 3 ms 2636 KB Output is correct
6 Correct 2 ms 2636 KB Output is correct
7 Correct 2 ms 2700 KB Output is correct
8 Correct 2 ms 2636 KB Output is correct
9 Incorrect 2 ms 2608 KB Output isn't correct
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 2608 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2624 KB Output is correct
2 Correct 2 ms 2628 KB Output is correct
3 Correct 2 ms 2508 KB Output is correct
4 Correct 2 ms 2636 KB Output is correct
5 Correct 3 ms 2636 KB Output is correct
6 Correct 2 ms 2636 KB Output is correct
7 Correct 2 ms 2700 KB Output is correct
8 Correct 2 ms 2636 KB Output is correct
9 Correct 81 ms 8512 KB Output is correct
10 Correct 58 ms 9888 KB Output is correct
11 Correct 69 ms 9748 KB Output is correct
12 Correct 54 ms 10188 KB Output is correct
13 Correct 61 ms 10220 KB Output is correct
14 Correct 46 ms 8924 KB Output is correct
15 Correct 118 ms 14028 KB Output is correct
16 Correct 130 ms 13844 KB Output is correct
17 Correct 123 ms 14264 KB Output is correct
18 Correct 116 ms 14296 KB Output is correct
19 Incorrect 93 ms 14064 KB Output isn't correct
20 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 2608 KB Output isn't correct
2 Halted 0 ms 0 KB -