Submission #979485

# Submission time Handle Problem Language Result Execution time Memory
979485 2024-05-11T06:26:03 Z bubble_xd Swapping Cities (APIO20_swap) C++17
6 / 100
82 ms 10416 KB
#include "swap.h"

#include <bits/stdc++.h>
using namespace std;
using i64 = long long;

bool cycle = true;
int mx_weight = 0;
void init(int N, int M, std::vector<int> U, std::vector<int> V, std::vector<int> W) {
  vector<int> deg(N);
  for (int i = 0; i < M; i++) {
    deg[U[i]]++;
    deg[V[i]]++;
    mx_weight = max(mx_weight, W[i]);
  }
  for (int i = 0; i < N; i++) {
    if (deg[i] != 2) {
      cycle = false;
    }
  }
}

int getMinimumFuelCapacity(int X, int Y) {
  if (cycle) return mx_weight;
  return -1;
}

// #include "grader.cpp"
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 436 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 424 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 19 ms 4188 KB Output is correct
10 Correct 24 ms 4880 KB Output is correct
11 Correct 22 ms 4952 KB Output is correct
12 Correct 23 ms 5188 KB Output is correct
13 Correct 23 ms 5204 KB Output is correct
14 Correct 29 ms 4448 KB Output is correct
15 Correct 70 ms 8804 KB Output is correct
16 Correct 65 ms 8784 KB Output is correct
17 Correct 82 ms 9040 KB Output is correct
18 Correct 67 ms 8920 KB Output is correct
19 Correct 40 ms 6108 KB Output is correct
20 Correct 80 ms 9744 KB Output is correct
21 Correct 67 ms 10140 KB Output is correct
22 Correct 69 ms 10416 KB Output is correct
23 Correct 69 ms 10292 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 62 ms 8272 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 436 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 424 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Incorrect 1 ms 344 KB Output isn't correct
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 436 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 424 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 19 ms 4188 KB Output is correct
10 Correct 24 ms 4880 KB Output is correct
11 Correct 22 ms 4952 KB Output is correct
12 Correct 23 ms 5188 KB Output is correct
13 Correct 23 ms 5204 KB Output is correct
14 Correct 29 ms 4448 KB Output is correct
15 Correct 70 ms 8804 KB Output is correct
16 Correct 65 ms 8784 KB Output is correct
17 Correct 82 ms 9040 KB Output is correct
18 Correct 67 ms 8920 KB Output is correct
19 Incorrect 62 ms 8272 KB Output isn't correct
20 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -