Submission #857047

# Submission time Handle Problem Language Result Execution time Memory
857047 2023-10-05T10:13:21 Z busamate Floppy (RMI20_floppy) C++14
0 / 100
26 ms 2648 KB
#include <stdlib.h>
#include <string.h>
#include <set>

#include "floppy.h"

using namespace std;

void read_array(int subtask_id, const std::vector<int> &v)
{
    int N = v.size();
    string bits('0', 2 * N);

    int tart = 0;
    set<int> szet;
    szet.clear();
    for (int i = 0; i < N; i++)
    {
        while (!szet.empty() && v[*szet.rbegin()] < v[i])
        {
            bits[tart++] = '1';
            auto it = szet.end();
            it--;
            szet.erase(it);
        }
        szet.insert(i);
        tart++;
    }

    save_to_floppy(bits);
}

std::vector<int> solve_queries(int subtask_id, int N,
                               const std::string &bits,
                               const std::vector<int> &aa, const std::vector<int> &bb)
{
    int Q = aa.size();
    std::vector<int> ans(Q);

    /*vector<int> kerd[40000];
    for (int i = 0; i < N; i++)
        kerd[i].clear();

    for (int i = 0; i < Q; i++)
        kerd[bb[i]].push_back(i);

    set<int> szet;
    szet.clear();
    int tart = 0;
    for (int i = 0; i < N; i++)
    {
        while (bits[tart] == '1')
        {
            auto it = szet.end();
            it--;
            szet.erase(it);
            tart++;
        }
        tart++;
        szet.insert(i);
        for (int j : kerd[i])
        {
            ans[j] = (*szet.lower_bound(aa[j]));
        }
    }*/

    return ans;
}

Compilation message

stub.cpp: In function 'void run2()':
stub.cpp:101:30: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  101 |     if (query_answers.size() != M) {
      |         ~~~~~~~~~~~~~~~~~~~~~^~~~
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 6 ms 860 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 26 ms 2648 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -