Submission #589711

#TimeUsernameProblemLanguageResultExecution timeMemory
589711Mohammed_AtalahWiring (IOI17_wiring)C++17
Compilation error
0 ms0 KiB
// Template path: /home/mohammed/.config/sublime-text-3/Packages/User
#include "wiring.h"
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;

// typedef
typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

// Marcos
#define int long long
#define fast ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)




// use \n insted of endl

long long min_total_length(std::vector<int> r, std::vector<int> b) {

	int szr = r.size();
	int szb = b.size();
	reverse(b.begin(), b.end());
	int total = 0;
	for (int i = 0 ; i < szr - 1; i++) {
		total += abs(r[i] - r[i + 1]) * (i + 1);
	}

	for (int i = 0 ; i < szb - 1; i++) {
		total += abs(b[i] - b[i + 1]) * (i + 1);
	}

	total += abs(r[szr - 1] - b[szr - 1]) * max(szr, szb);
	return total;

}

// int32_t main() {

// 	fast;
// #ifndef ONLINE_JUDGE
// 	freopen("input.txt", "r", stdin);
// 	freopen("output.txt", "w", stdout);
// #endif

// 	// Just another problem (-_-)

// 	int t;
// 	cin >> t;
// 	// t = 1
// 	while (t--) {
// 		main_solve();
// 	}

// }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccbQrLV0.o: in function `main':
grader.cpp:(.text.startup+0x23a): undefined reference to `min_total_length(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status