답안 #981061

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
981061 2024-05-12T18:40:39 Z Abito 자매 도시 (APIO20_swap) C++17
0 / 100
104 ms 21764 KB
#include "swap.h"
#include <bits/stdc++.h>
#define F first
#define S second
#define ep insert
#define pb push_back
using namespace std;
const int NN=1e5+5;
int n,m,mid,w[NN];
vector<pair<int,int>> adj[NN];
multiset<int> s;
void init(int N, int M,
          vector<int> U, vector<int> V, vector<int> W) {
    n=N,m=M;
    for (int i=0;i<m;i++) w[V[i]]=W[i],s.ep(W[i]);
    return;
}

int getMinimumFuelCapacity(int X, int Y) {
    if (X && Y && n>3){
        s.erase(s.find(w[X]));
        s.erase(s.find(w[Y]));
        int ans=max(*s.begin(),max(w[X],w[Y]));
        s.ep(w[X]);
        s.ep(w[Y]);
        return ans;
    }
    if (n>3){
        s.erase(s.find(w[X]));
        int x=*s.begin(),y=*++s.begin();
        int ans=max(w[X],max(x,y));
        s.ep(w[X]);
        return ans;
    }
    return -1;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Correct 1 ms 2904 KB Output is correct
3 Correct 1 ms 2652 KB Output is correct
4 Runtime error 3 ms 5212 KB Execution killed with signal 6
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Correct 1 ms 2904 KB Output is correct
3 Runtime error 104 ms 21764 KB Execution killed with signal 6
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Correct 1 ms 2904 KB Output is correct
3 Correct 1 ms 2652 KB Output is correct
4 Runtime error 3 ms 5212 KB Execution killed with signal 6
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Correct 1 ms 2904 KB Output is correct
3 Correct 1 ms 2652 KB Output is correct
4 Runtime error 3 ms 5212 KB Execution killed with signal 6
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Correct 1 ms 2904 KB Output is correct
3 Correct 1 ms 2652 KB Output is correct
4 Runtime error 3 ms 5212 KB Execution killed with signal 6
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Correct 1 ms 2904 KB Output is correct
3 Correct 1 ms 2652 KB Output is correct
4 Runtime error 3 ms 5212 KB Execution killed with signal 6
5 Halted 0 ms 0 KB -