# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1069008 | faruk | Text editor (CEOI24_editor) | C++17 | 0 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 all(a) a.begin(), a.end()
#define mp make_pair
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pii;
vector<ll> len;
ll n;
ll f_idx, t_idx;
ll wiggle(ll f_idx) {
ll to_add = abs(f_idx - t_idx);
to_add = min(to_add, abs(min(f_idx + len[0], len[0]*((ll)n - 1)) - t_idx) + 1);
if (f_idx - len[0] >= 0)
to_add = min(to_add, abs(max(0LL, f_idx - len[0]) - t_idx) + 1);
return to_add;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
pii f, t;
cin >> f.first >> f.second;
f.second--;
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... |