# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
887303 | votranngocvy | Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) | C++14 | 922 ms | 33108 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 1e6 + 5;
int a[N],l[N],r[N],k[N],n,m;
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];
bool check = true;
for (int j = l[i]; j < r[i]; j++)
if (b[j] > b[j + 1]) {
check = false;
break;
}
while (!check) {
bool found = false;
for (int j = l[i]; j < r[i]; j++)
if (b[j] > b[j + 1]) {
if (b[j] + b[j + 1] <= k[i]) swap(b[j],b[j + 1]);
else found = true;
break;
}
if (found) break;
check = true;
for (int j = l[i]; j < r[i]; j++)
if (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... |