Submission #1075388

#TimeUsernameProblemLanguageResultExecution timeMemory
1075388Ausp3xText editor (CEOI24_editor)C++17
0 / 100
1 ms392 KiB
// 人外有人,天外有天 // author: Ausp3x #pragma GCC optimize("O1, O2, O3, Ofast, unroll-loops") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; #define fi first #define se second #define pb push_back // #define DEBUG typedef long long lng; typedef __int128 lli; template<class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; int const INF32 = 0x3f3f3f3f; lng const INF64 = 0x3f3f3f3f3f3f3f3f; void solve() { int n; cin >> n; int sl, sc; cin >> sl >> sc; int el, ec; cin >> el >> ec; vector<int> C(n + 1); for (int i = 1; i <= n; i++) { cin >> C[i]; C[i]++; } if (el < sl) { swap(sl, el); swap(sc, ec); } if (n <= 2) { int ans = abs(el - sl) + abs(ec - sc); if (el != sl) ans = min(ans, C[sl] - sc + 1 + ec - 1); cout << ans << endl; return; } return; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t = 1; // cin >> t; while (t--) { solve(); } return 0; }

Compilation message (stderr)

Main.cpp:4:55: warning: bad option '-f O2' to pragma 'optimize' [-Wpragmas]
    4 | #pragma GCC optimize("O1, O2, O3, Ofast, unroll-loops")
      |                                                       ^
Main.cpp:4:55: warning: bad option '-f O3' to pragma 'optimize' [-Wpragmas]
Main.cpp:4:55: warning: bad option '-f Ofast' to pragma 'optimize' [-Wpragmas]
Main.cpp:4:55: warning: bad option '-f unroll-loops' to pragma 'optimize' [-Wpragmas]
Main.cpp:22:12: warning: bad option '-f O2' to attribute 'optimize' [-Wattributes]
   22 | void solve() {
      |            ^
Main.cpp:22:12: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes]
Main.cpp:22:12: warning: bad option '-f Ofast' to attribute 'optimize' [-Wattributes]
Main.cpp:22:12: warning: bad option '-f unroll-loops' to attribute 'optimize' [-Wattributes]
Main.cpp:55:10: warning: bad option '-f O2' to attribute 'optimize' [-Wattributes]
   55 | int main() {
      |          ^
Main.cpp:55:10: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes]
Main.cpp:55:10: warning: bad option '-f Ofast' to attribute 'optimize' [-Wattributes]
Main.cpp:55:10: warning: bad option '-f unroll-loops' to attribute 'optimize' [-Wattributes]
#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...