Submission #1322310

#TimeUsernameProblemLanguageResultExecution timeMemory
1322310limitsStone Arranging 2 (JOI23_ho_t1)C++20
100 / 100
161 ms25116 KiB
#pragma GCC optimize("Ofast") #pragma GCC optimize("O3,unroll-loops") #include <bits/stdc++.h> using namespace std; #define f0r(i, n) for (auto i = 0; i < (n); ++i) #define fnr(i, n, k) for (auto i = (n); i < (k); ++i) #define all(v) (v).begin(), (v).end() #define pb push_back #define F first #define S second #define ctn(x) cout << x << '\n' #define forl(a, l) for (auto a : l) #define ctl(l) for (auto &a : (l)) cout << a << ' '; cout << '\n'; #define lb(v, x) (lower_bound(all(v), x) - begin(v)) #define ub(v, x) (upper_bound(all(v), x) - begin(v)) #define pq priority_queue template <class T> using V = vector<T>; using ll = long long; using vi = V<int>; using vl = V<ll>; using pi = pair<int, int>; using ti = tuple<int, int, int>; using Adj = V<vi>; using vvi = V<vi>; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; cin >> n; vi A(n); map<int, vi> mp; f0r(i, n) { cin >> A[i]; mp[A[i]].pb(i); } int i = 0; while (i < n) { int c = A[i], e = mp[c].back(); for (; i <= e; ++i) ctn(c); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...