Submission #864285

# Submission time Handle Problem Language Result Execution time Memory
864285 2023-10-22T10:13:59 Z KK_1729 A Plus B (IOI23_aplusb) C++17
Compilation error
0 ms 0 KB
#include "aplusb.h"
#include <bits/stdc++.h>
using namespace std;

#define int long long
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define pb push_back
#define all(a) a.begin(), a.end()
#define endl "\n"
 
void printVector(vector<int> a){
    for (auto x: a) cout << x << " ";
    cout << endl;
}

vector<int> smallest_sums(int N, vector<int> A, vector<int> B) {
	vector<int> x;
	int u = A[0];
	FOR(i,0,N){
		x.pb(B[i]+A[0]);
		x.pb(A[i]+B[0]);
	}

	sort(all(x));
	vector<int> ans;
	FOR(i,0,N) ans.pb(x[i]);
	return ans;
}

Compilation message

aplusb.cpp: In function 'std::vector<long long int> smallest_sums(long long int, std::vector<long long int>, std::vector<long long int>)':
aplusb.cpp:18:6: warning: unused variable 'u' [-Wunused-variable]
   18 |  int u = A[0];
      |      ^
/usr/bin/ld: /tmp/ccPcv8L7.o: in function `main':
grader.cpp:(.text.startup+0x271): undefined reference to `smallest_sums(int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status