Submission #1065447

#TimeUsernameProblemLanguageResultExecution timeMemory
1065447MunkhturErdenebatA Plus B (IOI23_aplusb)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
#include <string.h>
#include <stdlib.h>
 #define ll long long
using namespace std;
    long long dfghjkl;
    long long tem,a,e,d,g=0,c,h=0,k[300011],me[4001230],m,t[1234567],n,i,j,f,mi,ha,he,ko,ka;
    string o,y,x[123456],z;
    long long ul,ma;
    char mr,taxi;
    long long bb,b;
    double xxx;
    pair<ll,long long> zxdfghj;
    vector<long long> q,kii;
    map<long long,long long> maa;
    
int main() {
    cin>>a;
    for(i=0 ; i<a ; i++){
        cin>>k[i];
    }
    for(i=0 ; i<a ; i++){
        cin>>t[i];
    }
    sort(k,k+a);
    sort(t,t+a);
    g=0;
    h=0;
    for(i=0 ; i<a ; i++){
        cout<<k[g]+t[h]<<" ";
        if(k[g+1]+t[h]>k[g]+t[h+1]){
            h++;
        }
        else{
            g++;
        }
    }
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccsYtj4c.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccoMFYVd.o:aplusb.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccsYtj4c.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