# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
494348 | jasen_penchev | Floppy (RMI20_floppy) | C++14 | 0 ms | 0 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 "floppy.h"
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#define endl '\n'
using namespace std;
const int MAXN = 40000;
int link[MAXN + 5];
void save_to_floppy(const string &bits);
void read_array(int subtask_id, const vector<int> &v)
{
int n = v.size();
string bits = "";
stack<int> st;
for (int i = 0; i < n; ++ i)
{
while (st.size() and v[st.top()] < v[i])
{
bits += '1';
st.pop();
}
st.push(i);
bits += '0';
}