# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
887330 | votranngocvy | Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) | C++14 | 925 ms | 60228 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 <bits/stdc++.h>
using namespace std;
#define int long long
#define pii pair<int,int>
#define piii pair<pii,int>
#define fi first
#define se second
#define mp make_pair
const int N = 1e6 + 5;
int a[N],n,m;
piii queries[N];
namespace sub1 {
int b[N];
void solve() {
for (int i = 1; i <= m; i++) {
for (int j = 1; j <= n; j++) b[j] = a[j];
int l = queries[i].fi.fi,r = queries[i].fi.se,k = queries[i].se;
bool check = true;
for (int j = l; j < r; j++)
if (b[j] > b[j + 1]) {
check = false;
break;
}
while (!check) {
bool found = false;
for (int j = l; j < r; j++)
if (b[j] > b[j + 1]) {
if (b[j] + b[j + 1] <= k) swap(b[j],b[j + 1]);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |