# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
732098 | Trunkty | 지구 온난화 (NOI13_gw) | C++14 | 212 ms | 22540 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/extc++.h>
using namespace std;
typedef long long ll;
//#define int ll
int n,curr,ans;
int arr[1000005];
vector<pair<int,int>> v;
bool check[1000005];
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> n;
for(int i=1;i<=n;i++){
cin >> arr[i];
v.push_back({arr[i],i});
}
sort(v.begin(),v.end(),greater<pair<int,int>>());
for(int i=0;i<v.size();i++){
int x = v[i].second;
check[x] = true;
curr++;
if(check[x-1]){
curr--;
}
if(check[x+1]){
curr--;
}
if(i==v.size()-1 or v[i+1].first!=v[i].first){
ans = max(ans,curr);
}
}
cout << ans << "\n";
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |