Submission #979778

# Submission time Handle Problem Language Result Execution time Memory
979778 2024-05-11T10:59:15 Z Mher777 Swapping Cities (APIO20_swap) C++17
6 / 100
84 ms 7260 KB
#include "swap.h"
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <array>
#include <string>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <list>
#include <iterator>
#include <numeric>
#include <complex>
#include <utility>
#include <random>
#include <cassert>
#include <fstream>
using namespace std;
mt19937 rnd(7069);
typedef int itn;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef float fl;
typedef long double ld;
using vi = vector<int>;
using vll = vector<ll>;
using mii = map<int, int>;
using mll = map<ll, ll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define ff first
#define ss second
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define mpr make_pair
#define yes cout<<"Yes\n"
#define no cout<<"No\n"
#define all(x) (x).begin(), (x).end()
const int dx[8] = { -1, 0, 1, 0, -1, -1, 1, 1 };
const int dy[8] = { 0, -1, 0, 1, -1, 1, -1, 1 };
const int MAX = int(1e9 + 5);
const ll MAXL = ll(1e18) + 5ll;
const ll MOD = ll(1000000007);
const ll MOD2 = ll(998244353);

const int N = 100005;
int p[N], sz[N], check[N], deg[N];
vector<pair<int, pii>> edge;
int mx = 0;
int n, m;

void init(int N, int M, vi U, vi V, vi W) {
    n = N, m = M;
    for (int i = 0; i < m; ++i) {
        mx = max(mx, W[i]);
        edge.pub({ W[i],{U[i],V[i]} });
    }
    sort(all(edge));
}

int getMinimumFuelCapacity(int X, int Y) {
    if (m >= n) return mx;
    return -1;
}

/*
1.
5 6
0 1 4
0 2 4
1 2 1
1 3 2
1 4 10
2 3 3
3
1 2
2 4
0 1

2.
3 2
0 1 5
0 2 5
1
1 2

answers
1.
3
10
4

2.
-1
*/
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 24 ms 3812 KB Output is correct
10 Correct 30 ms 4300 KB Output is correct
11 Correct 28 ms 4252 KB Output is correct
12 Correct 30 ms 4296 KB Output is correct
13 Correct 30 ms 4472 KB Output is correct
14 Correct 27 ms 4052 KB Output is correct
15 Correct 71 ms 5812 KB Output is correct
16 Correct 71 ms 5836 KB Output is correct
17 Correct 72 ms 5876 KB Output is correct
18 Correct 76 ms 6124 KB Output is correct
19 Correct 41 ms 4636 KB Output is correct
20 Correct 71 ms 6612 KB Output is correct
21 Correct 73 ms 6888 KB Output is correct
22 Correct 75 ms 7240 KB Output is correct
23 Correct 76 ms 7260 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Incorrect 84 ms 5720 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Incorrect 0 ms 348 KB Output isn't correct
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 24 ms 3812 KB Output is correct
10 Correct 30 ms 4300 KB Output is correct
11 Correct 28 ms 4252 KB Output is correct
12 Correct 30 ms 4296 KB Output is correct
13 Correct 30 ms 4472 KB Output is correct
14 Correct 27 ms 4052 KB Output is correct
15 Correct 71 ms 5812 KB Output is correct
16 Correct 71 ms 5836 KB Output is correct
17 Correct 72 ms 5876 KB Output is correct
18 Correct 76 ms 6124 KB Output is correct
19 Incorrect 84 ms 5720 KB Output isn't correct
20 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -