답안 #1029373

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1029373 2024-07-20T19:43:51 Z VMaksimoski008 자매 도시 (APIO20_swap) C++17
6 / 100
75 ms 16264 KB
#include "swap.h"
#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;

const int maxn = 1e5 + 5;
int n, m;
vector<pii> graph[maxn];
vector<int> deg(maxn);
int mn = 1e9, mx = 0;

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++) {
        graph[U[i]].push_back({ V[i], W[i] });
        graph[V[i]].push_back({ U[i], W[i] });
        mx = max(mx, W[i]);
        deg[U[i]]++; deg[V[i]]++;
    }

    for(int i=0; i<N; i++) mn = min(mn, deg[i]);
}

int getMinimumFuelCapacity(int X, int Y) {
    if(mn == 1) return -1;
    return mx;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 3164 KB Output is correct
2 Correct 1 ms 3164 KB Output is correct
3 Correct 1 ms 3164 KB Output is correct
4 Correct 1 ms 3164 KB Output is correct
5 Correct 1 ms 3164 KB Output is correct
6 Correct 1 ms 3164 KB Output is correct
7 Correct 1 ms 3164 KB Output is correct
8 Correct 1 ms 3164 KB Output is correct
9 Correct 23 ms 7440 KB Output is correct
10 Correct 27 ms 8364 KB Output is correct
11 Correct 28 ms 8284 KB Output is correct
12 Correct 29 ms 8528 KB Output is correct
13 Correct 28 ms 8532 KB Output is correct
14 Correct 27 ms 7512 KB Output is correct
15 Correct 59 ms 10124 KB Output is correct
16 Correct 57 ms 10024 KB Output is correct
17 Correct 69 ms 10364 KB Output is correct
18 Correct 59 ms 10424 KB Output is correct
19 Correct 32 ms 7504 KB Output is correct
20 Correct 59 ms 15452 KB Output is correct
21 Correct 63 ms 15632 KB Output is correct
22 Correct 75 ms 16132 KB Output is correct
23 Correct 66 ms 16264 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 3164 KB Output is correct
2 Correct 1 ms 3164 KB Output is correct
3 Incorrect 52 ms 10604 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 3164 KB Output is correct
2 Correct 1 ms 3164 KB Output is correct
3 Correct 1 ms 3164 KB Output is correct
4 Correct 1 ms 3164 KB Output is correct
5 Correct 1 ms 3164 KB Output is correct
6 Correct 1 ms 3164 KB Output is correct
7 Correct 1 ms 3164 KB Output is correct
8 Correct 1 ms 3164 KB Output is correct
9 Incorrect 1 ms 3160 KB Output isn't correct
10 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 3160 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 3164 KB Output is correct
2 Correct 1 ms 3164 KB Output is correct
3 Correct 1 ms 3164 KB Output is correct
4 Correct 1 ms 3164 KB Output is correct
5 Correct 1 ms 3164 KB Output is correct
6 Correct 1 ms 3164 KB Output is correct
7 Correct 1 ms 3164 KB Output is correct
8 Correct 1 ms 3164 KB Output is correct
9 Correct 23 ms 7440 KB Output is correct
10 Correct 27 ms 8364 KB Output is correct
11 Correct 28 ms 8284 KB Output is correct
12 Correct 29 ms 8528 KB Output is correct
13 Correct 28 ms 8532 KB Output is correct
14 Correct 27 ms 7512 KB Output is correct
15 Correct 59 ms 10124 KB Output is correct
16 Correct 57 ms 10024 KB Output is correct
17 Correct 69 ms 10364 KB Output is correct
18 Correct 59 ms 10424 KB Output is correct
19 Incorrect 52 ms 10604 KB Output isn't correct
20 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 3160 KB Output isn't correct
2 Halted 0 ms 0 KB -