Submission #1334179

#TimeUsernameProblemLanguageResultExecution timeMemory
1334179SulASequence (APIO23_sequence)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template<typename T> using ordered_set = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

int sequence(int n, vector<int> a) {
    auto b = a;
    ranges::sort(b);
    int med = b[(n-1)/2];
    map<int,int> frq;
    int ans = 1;
    for (int x : a) {
        if (x >= med) {
            ans = max(ans, ++frq[x]);
        }
    }
//    cout<<med<<'\n';
    return ans;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    cout << sequence(9, {1, 1, 2, 3, 4, 3, 2, 1, 1});
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccAL91LG.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccLuZ8HG.o:sequence.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status