Submission #979637

# Submission time Handle Problem Language Result Execution time Memory
979637 2024-05-11T09:15:14 Z vjudge1 Swapping Cities (APIO20_swap) C++17
0 / 100
101 ms 14404 KB
#include "swap.h"

#include <cassert>
#include <cstdio>

#include <string>

#include <vector>
#include <map>
#include <set>

using namespace std;
vector<pair<int, int>> g[200005];
pair<int, int> p[200005];
map<pair<int, int>, int> mp, pos;
set<pair<int, int>> st;
int x, y, mx;
void init(int N, int M,
          std::vector<int> U, std::vector<int> V, std::vector<int> W) {
      x = N;
      y = M;
      for(int i = 0; i < M; i++){
          int a = U[i] + 1, b = V[i] + 1, c = W[i] + 1;
          // g[a].push_back({b, c});
          // g[b].push_back({a, c});
          // mp[{a, b}] = c;
          // mp[{b, a}] = c;

          // pos[{a, b}] = i + 1;
          // pos[{b, a}] = i + 1; 
          mx = max(mx, W[i]);

          st.insert({c, i + 1});
      }
}

int getMinimumFuelCapacity(int X, int Y) {
    X++;
    Y++;
    if(x - 1 == y) return -1;
    else return st.rbegin()->first;
}

Compilation message

swap.cpp: In function 'void init(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
swap.cpp:24:15: warning: unused variable 'a' [-Wunused-variable]
   24 |           int a = U[i] + 1, b = V[i] + 1, c = W[i] + 1;
      |               ^
swap.cpp:24:29: warning: unused variable 'b' [-Wunused-variable]
   24 |           int a = U[i] + 1, b = V[i] + 1, c = W[i] + 1;
      |                             ^
# Verdict Execution time Memory Grader output
1 Correct 2 ms 5720 KB Output is correct
2 Correct 2 ms 5464 KB Output is correct
3 Correct 2 ms 5468 KB Output is correct
4 Correct 2 ms 5468 KB Output is correct
5 Correct 2 ms 5724 KB Output is correct
6 Correct 2 ms 5724 KB Output is correct
7 Correct 2 ms 5724 KB Output is correct
8 Correct 2 ms 5724 KB Output is correct
9 Correct 35 ms 11036 KB Output is correct
10 Correct 42 ms 12176 KB Output is correct
11 Correct 49 ms 12164 KB Output is correct
12 Correct 45 ms 12636 KB Output is correct
13 Correct 45 ms 12500 KB Output is correct
14 Correct 38 ms 11100 KB Output is correct
15 Correct 80 ms 14224 KB Output is correct
16 Correct 101 ms 14080 KB Output is correct
17 Correct 81 ms 14268 KB Output is correct
18 Correct 98 ms 14404 KB Output is correct
19 Incorrect 41 ms 10136 KB Output isn't correct
20 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 5720 KB Output is correct
2 Correct 2 ms 5464 KB Output is correct
3 Incorrect 76 ms 13916 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 5720 KB Output is correct
2 Correct 2 ms 5464 KB Output is correct
3 Correct 2 ms 5468 KB Output is correct
4 Correct 2 ms 5468 KB Output is correct
5 Correct 2 ms 5724 KB Output is correct
6 Correct 2 ms 5724 KB Output is correct
7 Correct 2 ms 5724 KB Output is correct
8 Correct 2 ms 5724 KB Output is correct
9 Incorrect 1 ms 5464 KB Output isn't correct
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 5464 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 5720 KB Output is correct
2 Correct 2 ms 5464 KB Output is correct
3 Correct 2 ms 5468 KB Output is correct
4 Correct 2 ms 5468 KB Output is correct
5 Correct 2 ms 5724 KB Output is correct
6 Correct 2 ms 5724 KB Output is correct
7 Correct 2 ms 5724 KB Output is correct
8 Correct 2 ms 5724 KB Output is correct
9 Correct 35 ms 11036 KB Output is correct
10 Correct 42 ms 12176 KB Output is correct
11 Correct 49 ms 12164 KB Output is correct
12 Correct 45 ms 12636 KB Output is correct
13 Correct 45 ms 12500 KB Output is correct
14 Correct 38 ms 11100 KB Output is correct
15 Correct 80 ms 14224 KB Output is correct
16 Correct 101 ms 14080 KB Output is correct
17 Correct 81 ms 14268 KB Output is correct
18 Correct 98 ms 14404 KB Output is correct
19 Incorrect 76 ms 13916 KB Output isn't correct
20 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 5464 KB Output isn't correct
2 Halted 0 ms 0 KB -