Submission #1071716

#TimeUsernameProblemLanguageResultExecution timeMemory
1071716jer033Text editor (CEOI24_editor)C++17
5 / 100
1 ms348 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; using pll = pair<ll, ll>; using tlii = tuple<ll, int, int>; using tiii = tuple<int, int, int>; int main() { std::ios::sync_with_stdio(false); int N; cin >> N; int sl, sc, el, ec; cin >> sl >> sc >> el >> ec; vector<int> width(N+1, 0); for (int i=1; i<=N; i++) cin >> width[i]; if (N<=2) { if ((sl==el) and (sc==ec)) cout << "0\n"; else if (el==2) cout << "1\n"; else if (sl==2) cout << 1+min(ec-1, width[1]+1-ec) << '\n'; else cout << min(abs(sc-ec), 2+min(ec-1, width[1]+1-ec)) << '\n'; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...