답안 #961351

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
961351 2024-04-11T22:07:13 Z Mohamed_Kachef06 자매 도시 (APIO20_swap) C++17
0 / 100
407 ms 20124 KB
#include "swap.h"

// #ifndef ONLINE_JUDGE
// #include "grader.cpp"
// #endif
#include <bits/stdc++.h>
using namespace std;

map<pair<int , int> , int> mp;
multiset<int> ms;

int n , m;
vector<int> u , v , w; 

void init(int N, int M,
          std::vector<int> U, std::vector<int> V, std::vector<int> W) {
      for (int i = 0 ; i < N ; i++){
        mp[{U[i] , V[i]}] = W[i]; ms.insert(W[i]);
      }     
      n = N;  m = M; 
      u = U; v = V; w = W;
}

int getMinimumFuelCapacity(int X, int Y) {
  if (X == 0 || n < 4) return -1;
  int a = mp[{0 , Y}] , b = mp[{0 , X}];
  ms.erase(ms.find(a)); ms.erase(ms.find(b)) ;
  int ans = max({*ms.begin() , a , b});
  ms.insert(a); ms.insert(b);
  return ans; 
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Runtime error 1 ms 604 KB Execution killed with signal 6
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 407 ms 20124 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Runtime error 1 ms 604 KB Execution killed with signal 6
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Runtime error 1 ms 604 KB Execution killed with signal 6
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Runtime error 1 ms 604 KB Execution killed with signal 6
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Runtime error 1 ms 604 KB Execution killed with signal 6
5 Halted 0 ms 0 KB -