Submission #973064

# Submission time Handle Problem Language Result Execution time Memory
973064 2024-05-01T13:08:18 Z marinaluca A Plus B (IOI23_aplusb) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#pragma GCC opitmize ("O4")
#pragma GCC optimize ("fast-math")
#pragma GCC optimize ("unroll-loops")

using namespace std;

#define int long long
#define ll long long
#define xx first
#define yy second
#define all (x) begin (x), end(x)

vector <int> smallest_sums (int N, vector <int> a, vector <int> b){
    sort (a.begin(), a.end());
    sort (b.begin(), b.end())
    set <pair<int, pair<int, int>>> s;
    vector <int> rez;
    for (int i = 0; i < n; ++ i){
        s.insert ({a[i] + b[i], {i, 0}});
    }
    for (int i = 0; i < n; ++ i){
        auto val = *s.begin();
        rez.push_back(val.xx);
        s.insert ({a[s.yy.xx] + b[s.yy.yy + 1], {val.yy.xx, val.yy.yy + 1}});
        s.erase(val);
    }
    return rez;
}

Compilation message

aplusb.cpp:2: warning: ignoring '#pragma GCC opitmize' [-Wunknown-pragmas]
    2 | #pragma GCC opitmize ("O4")
      | 
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:16:30: error: expected ';' before 'set'
   16 |     sort (b.begin(), b.end())
      |                              ^
      |                              ;
   17 |     set <pair<int, pair<int, int>>> s;
      |     ~~~                       
aplusb.cpp:19:25: error: 'n' was not declared in this scope
   19 |     for (int i = 0; i < n; ++ i){
      |                         ^
aplusb.cpp:20:9: error: 's' was not declared in this scope
   20 |         s.insert ({a[i] + b[i], {i, 0}});
      |         ^
aplusb.cpp:22:25: error: 'n' was not declared in this scope
   22 |     for (int i = 0; i < n; ++ i){
      |                         ^
aplusb.cpp:23:21: error: 's' was not declared in this scope
   23 |         auto val = *s.begin();
      |                     ^