답안 #732096

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
732096 2023-04-28T11:42:33 Z Trunkty 지구 온난화 (NOI13_gw) C++14
13 / 40
844 ms 65536 KB
#include <bits/extc++.h>
using namespace std;
typedef long long ll;
#define int ll

int n,curr,ans;
int arr[1000005];
map<int,vector<int>> mp;
bool check[100005];

signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
    cin >> n;
    for(int i=1;i<=n;i++){
        cin >> arr[i];
        mp[arr[i]].push_back(i);
    }
    for(auto it=mp.end();it!=mp.begin();){
        it--;
        for(int j:it->second){
            check[j] = true;
            curr++;
            if(check[j-1]){
                curr--;
            }
            if(check[j+1]){
                curr--;
            }
            ans = max(ans,curr);
        }
    }
    cout << ans << "\n";
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 468 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 468 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 10 ms 2596 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 72 ms 12964 KB Output is correct
2 Correct 41 ms 12756 KB Output is correct
3 Correct 71 ms 12976 KB Output is correct
4 Correct 74 ms 12876 KB Output is correct
5 Correct 73 ms 12872 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 519 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 844 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -