| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1353288 | putuputu | 지구 온난화 (NOI13_gw) | C++20 | 894 ms | 86476 KiB |
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int n;
cin >> n;
int a[n];
for(int i=0; i<n; i++){
cin >> a[i];
}
vector<pair<int, int>> p(n);
for(int i=0; i<n; i++){
p.push_back({a[i], i});
}
int ans=0, ans1=0;
sort(p.begin(), p.end());
reverse(p.begin(), p.end());
set<int> idx;
for(int i=0; i<n; i++){
idx.insert(p[i].second);
int cnt=0;
if(idx.count(p[i].second+1)){
cnt++;
}
if(idx.count(p[i].second-1)){
cnt++;
}
if(cnt==0){
ans++;
}
if(cnt==2){
ans--;
}
ans1=max(ans, ans1);
}
cout << ans1;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
