# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
857048 | busamate | Floppy (RMI20_floppy) | C++14 | 56 ms | 7380 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |