제출 #924661

#제출 시각아이디문제언어결과실행 시간메모리
924661sleepntsheep지구 온난화 (NOI13_gw)C++17
0 / 40
179 ms12372 KiB
#include <iostream> #include <numeric> #include <fstream> #include <iomanip> #include <cmath> #include <cassert> #include <cstring> #include <vector> #include <algorithm> #include <deque> #include <set> #include <utility> #include <array> #include <complex> using u32 = unsigned; using i32 = int; using i64 = long long; using u64 = unsigned long long; using f64 = double; using f80 = long double; using namespace std; using pt = complex<f80>; #define ALL(x) begin(x), end(x) #define ShinLena cin.tie(nullptr)->sync_with_stdio(false); #define N 1000005 int n, a[N], f[N], b[N] ,c ,z; int main() { ShinLena; cin >> n; for (int i = 1; i <= n; ++i) cin >> a[i]; iota(b, b+1+n, 0); sort(b+1, b+1+n, [](int i, int j){ return a[i] > a[j]; }); if (a[b[1]] > 0) z = 1; for (int i = 1; i <= n; ++i) { int j = b[i]; ++c; if (j > 1 and !f[j-1]) --c; if (j < n and !f[j+1]) --c; if (i == n or a[j] != a[b[i]+1]) z = max(z, c); f[j] = 1; } cout << z; return 0; }
#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...