Submission #940137

# Submission time Handle Problem Language Result Execution time Memory
940137 2024-03-07T05:52:38 Z vjudge1 Dreaming (IOI13_dreaming) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>	

using namespace std;

#define all(a) a.begin(), a.end()                                                   
#define rall(a) a.rbegin(), a.rend()                 
#define sz(a) (int)a.size()
#define s second
#define f first
 
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
     
vector<pii> rid = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
vector<pii> dir = {{-1, -1}, {-1, 1}, {1, -1}, {1, 1}};

int travelTime(int n, int m, int l, int a[], int b[], int c[]) {
	vector<int> s = {0, 0, 0};
	for (int i = 0; i < m; i++) s.push_back(c[i]);
	sort(rall(s));
	return max(s[0] + s[1] + l, s[1] + s[2] + 2 * l);	     	
}

#ifdef M
main() {
	//freopen("rsq.in", "r", stdin);                                                                                     
	//freopen("rsq.out", "w", stdout);                                                                                     
	ios_base::sync_with_stdio(0);	                                                                                       
	cin.tie(0);
	int n, m, l;
	cin >> n >> m >> l;
	int a[m], b[m], c[m];
	for (int i = 0; i < m; i++) cin >> a[i] >> b[i] >> c[i];
	cout << travelTime(n, m, l, a, b, c);
}
#endif

Compilation message

/usr/bin/ld: /tmp/ccaJUTO2.o: in function `main':
grader.c:(.text.startup+0xd1): undefined reference to `travelTime'
collect2: error: ld returned 1 exit status