# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1068226 | vjudge1 | Text editor (CEOI24_editor) | C++17 | 1 ms | 348 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>
#define int long long
using namespace std;
void solve() {
int n, sl, sc, el, ec;
cin >> n >> sl >> sc >> el >> ec;
sl--, sc--, el--, ec--;
vector<int> l(n);
for(int i = 0; i < n; i++) cin >> l[i];
int temp = min(abs(sc - ec), min(l[0] - sc + 1 - ec, sc + 1 + l[0] - ec));
cout << abs(sl - el) + min(abs(sc - ec), min(l[0] - sc - ec, sc + 2 + l[0] - ec)) << "\n";
}
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
solve();
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |