Submission #536735

#TimeUsernameProblemLanguageResultExecution timeMemory
536735Zhora_004Baloni (COCI15_baloni)C++17
100 / 100
1864 ms7240 KiB
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <cmath> #include <algorithm> #include <vector> #include <set> #include <unordered_set> #include <queue> #include <deque> #include <string> #include <sstream> #include <iomanip> #include <map> #include <unordered_map> #include <stack> #include <cstdio> #include <climits> #include <tuple> #include <ctime> #include <cstring> #include <numeric> #include <functional> #include <chrono> #include <cassert> #include <bitset> //#include <bit> //#include <ranges> //#include <numbers> #define itn int #define sacnf scanf #define sz(a) ((int)((a).size())) // printf("%.10f\n", ans); using ll = long long; using namespace std; const ll mod = 1e9 + 7; const int N = 1e5 + 5; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; vector<int> v(n); for (int i = 0; i < n; i++) cin >> v[i]; for (int cnt = 1; ; cnt++) { int i; for (i = 0; i < n; i++) if (v[i] != 2e9) break; if (i == n) return cout << cnt - 1, 0; int h = v[i]; for (; i < n; i++) if (v[i] == h) v[i] = 2e9, h--; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...