Submission #488907

# Submission time Handle Problem Language Result Execution time Memory
488907 2021-11-20T19:23:25 Z cfalas Road Closures (APIO21_roads) C++14
5 / 100
45 ms 4520 KB
#include "roads.h"
#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define INF 10000000
#define MOD 1000000007
#define MID ((l+r)/2)
#define HASHMOD 2305843009213693951
#define ll long long
#define ull unsigned long long
#define F first
#define S second
typedef pair<ll, ll> ii;
typedef pair<ii, int> iii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef map<int, int> mii;

#define EPS 1e-6
#define FOR(i,n) for(int i=0;i<((int)(n));i++)
#define FORi(i,a,b) for(int i=((int)(a));i<((int)(b));i++)
#define FOA(v, a) for(auto v : a)

int t, n;
vi a, b;

std::vector<long long> minimum_closure_costs(int N, std::vector<int> U,
                                             std::vector<int> V,
                                             std::vector<int> W) {
	n = N;
	a.resize(n);
	FOR(i,n) a[i] = W[i];
	sort(a.begin(), a.end());
	FORi(i,1,N) a[i] += a[i-1];
	reverse(a.begin(), a.end());
	return a;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 2 ms 332 KB Output is correct
9 Correct 1 ms 332 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Correct 0 ms 204 KB Output is correct
12 Correct 21 ms 2544 KB Output is correct
13 Correct 35 ms 4172 KB Output is correct
14 Correct 39 ms 4004 KB Output is correct
15 Correct 45 ms 4388 KB Output is correct
16 Correct 45 ms 4436 KB Output is correct
17 Correct 44 ms 4520 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 32 ms 3808 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 39 ms 3744 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 39 ms 3964 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 39 ms 3964 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 2 ms 332 KB Output is correct
9 Correct 1 ms 332 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Correct 0 ms 204 KB Output is correct
12 Correct 21 ms 2544 KB Output is correct
13 Correct 35 ms 4172 KB Output is correct
14 Correct 39 ms 4004 KB Output is correct
15 Correct 45 ms 4388 KB Output is correct
16 Correct 45 ms 4436 KB Output is correct
17 Correct 44 ms 4520 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 32 ms 3808 KB Output is correct
20 Correct 0 ms 204 KB Output is correct
21 Incorrect 39 ms 3744 KB Output isn't correct
22 Halted 0 ms 0 KB -